Web Technologies Flashcards

1
Q

What is the purpose of HTML5’s <canvas> element?</canvas>

A

The <canvas> element provides a way to draw graphics, animations, and other visual content using JavaScript.</canvas>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the box model in CSS.

A

The box model describes how elements are structured in terms of content, padding, border, and margin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you include JavaScript in an HTML page?

A

You can include JavaScript using the

 tag, either inline or by referencing an external file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between null and undefined in JavaScript?

A

null is a deliberate absence of value, while undefined signifies a variable that has been declared but hasn’t been assigned a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain CSS specificity.

A

CSS specificity determines which styles are applied when there are conflicting rules. It’s based on the combination of selectors used in the rule.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is event delegation in JavaScript?

A

Event delegation is a technique where you attach an event handler to a parent element and let it handle events on its child elements, reducing memory consumption and improving performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a closure in JavaScript?

A

A closure is a function that captures variables from its containing lexical scope, allowing those variables to be accessed even after the outer function has finished executing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain the concept of hoisting in JavaScript.

A

Hoisting is the behavior where variable and function declarations are moved to the top of their containing scope during the compilation phase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does CSS Flexbox work?

A

Flexbox is a layout model that allows you to design complex layouts with a more efficient and predictable arrangement of elements in a container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the localStorage and sessionStorage APIs in JavaScript?

A

These APIs allow you to store key-value pairs in the browser. localStorage stores data with no expiration, while sessionStorage stores data for the duration of a session.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does AJAX stand for?

A

AJAX stands for “Asynchronous JavaScript and XML,” a set of techniques for making asynchronous requests to a server from a web page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you create an AJAX request in JavaScript?

A

You can use the XMLHttpRequest object or the more modern fetch API to create AJAX requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is JSON?

A

JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you parse JSON in JavaScript?

A

You can use the JSON.parse() method to convert a JSON string into a JavaScript object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is CORS, and why is it important?

A

CORS (Cross-Origin Resource Sharing) is a security feature implemented by browsers to prevent unauthorized requests from different origins. It ensures that requests are made only to trusted sources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a single-page application (SPA)?

A

An SPA is a web application that dynamically updates content on a single web page, providing a more fluid and seamless user experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the virtual DOM in React?

A

The virtual DOM is a lightweight copy of the actual DOM in memory. React uses it to efficiently update the actual DOM by minimizing direct manipulations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Explain two-way data binding in Angular.

A

Two-way data binding automatically synchronizes data between the model and the view, so changes in the view are reflected in the model and vice versa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a component in Vue.js?

A

In Vue.js, a component is a reusable and self-contained unit that encapsulates both the UI and its behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the purpose of React Router?

A

React Router is a library that enables client-side routing in a React application, allowing you to create different “pages” within a single-page application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How does Angular handle dependency injection?

A

Angular has a built-in dependency injection system that allows you to manage and inject dependencies into components, services, and other parts of the application.

22
Q

What is Vuex in Vue.js?

A

Vuex is a state management library for Vue.js applications, providing a centralized store to manage the application’s state and data.

23
Q

What is JSX in React?

A

JSX (JavaScript XML) is a syntax extension for JavaScript used with React to describe what the UI should look like.

24
Q

Explain the concept of props in React.

A

Props (short for properties) are a way to pass data from a parent component to a child component in React.

25
Q

How do you handle forms and user input in Angular?

A

Angular provides the ngModel directive and reactive forms to handle user input and form validation.

26
Q

What is the purpose of the <meta></meta> tag in HTML?

A

The <meta></meta> tag provides metadata about the HTML document, such as character encoding, authorship, and viewport settings.

27
Q

Explain the concept of event propagation in JavaScript.

A

Event propagation describes the order in which events are processed as they bubble up from the target element through its ancestors or capture down from ancestors to the target.

28
Q

How can you include an external CSS file in an HTML document?

A

You can link an external CSS file using the <link></link> element within the <head> section of the HTML document.

29
Q

What is the purpose of the async attribute in a

 tag?
A

The async attribute in a

 tag tells the browser to download the script asynchronously and not block the HTML parsing while fetching the script.
30
Q

Explain the concept of event delegation in jQuery.

A

Event delegation in jQuery involves attaching an event handler to a parent element and using event bubbling to handle events on its child elements.

31
Q

What is the difference between let, const, and var in JavaScript for declaring variables?

A

let and const are block-scoped declarations introduced in ES6, while var is function-scoped and has different behavior regarding hoisting.

32
Q

What is the purpose of the z-index property in CSS?

A

The z-index property controls the stacking order of elements in the z-axis, determining which elements appear above or below others.

33
Q

Explain the concept of callback functions in JavaScript.

A

A callback function is a function passed as an argument to another function, which is executed at a later time, often asynchronously.

34
Q

How do you handle errors in JavaScript?

A

Errors in JavaScript can be handled using try-catch blocks, which allow you to catch and manage exceptions that occur during code execution.

35
Q

What is the difference between inline and block elements in HTML?

A

Inline elements do not start on a new line and only take up as much width as necessary, while block elements start on a new line and occupy the full width available.

36
Q

What is the purpose of the XMLHttpRequest object in AJAX?

A

The XMLHttpRequest object allows you to make HTTP requests from a web page, enabling the retrieval of data from a server without requiring a full page refresh.

37
Q

What is the role of the Content-Type header in an HTTP request?

A

The Content-Type header indicates the media type of the resource being sent or requested, helping the server and browser understand how to handle the data.

38
Q

How can you handle cross-origin requests in AJAX?

A

Cross-origin requests are typically managed using techniques like JSONP (JSON with Padding), CORS (Cross-Origin Resource Sharing), or server-side proxying.

39
Q

What is the purpose of the responseType property in an AJAX request?

A

The responseType property allows you to specify the type of data you expect to receive in the response, such as JSON, text, or blob.

40
Q

Explain the difference between synchronous and asynchronous AJAX requests.

A

Synchronous requests block the execution of other code until the request is complete, while asynchronous requests allow the code to continue executing while waiting for the response.

41
Q

What is the virtual DOM in Vue.js?

A

Similar to React, Vue.js uses a virtual DOM to optimize updates by comparing the virtual DOM tree with the actual DOM and applying changes efficiently.

42
Q

Explain the concept of JSX in React.

A

JSX is a syntax extension for JavaScript used in React to describe the structure and appearance of the UI components using XML-like syntax.

43
Q

What is the purpose of the ngFor directive in Angular?

A

The ngFor directive is used to loop through an array or iterable and generate HTML elements for each item.

44
Q

How does Vue.js handle reactivity?

A

Vue.js achieves reactivity by using a reactive system that tracks changes to data and automatically updates the DOM when the data changes.

45
Q

How do you optimize the performance of a Vue.js application?

A

Vue.js provides optimization techniques such as using directives like v-if and v-for efficiently, using keys to help Vue track element identity, and employing lazy-loading for components.

46
Q

What is the role of a service in Angular?

A

Services in Angular are used to encapsulate and share data, business logic, or external communication between components.

47
Q

What is the purpose of the React useEffect hook?

A

The useEffect hook in React is used for handling side effects in functional components, such as data fetching, DOM manipulation, and subscriptions.

48
Q

How do you pass data from a parent component to a child component in Vue.js?

A

Data can be passed from a parent component to a child component in Vue.js using props.

49
Q

What is the role of a reducer in React’s context API?

A

A reducer is a function used to manage state changes in React’s context API. It takes the current state and an action and returns a new state.

50
Q
A