Interview Questions Flashcards

1
Q

What is React?

A

React is a popular JavaScript library for building user interfaces that allows developers to create interactive and dynamic web applications efficiently. It uses a component-based architecture to break down the UI into reusable, self-contained pieces.

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

What is Redux?

A

Redux is a JavaScript library used for managing the state of a web application in a predictable and centralized manner. Its primary purpose is to help maintain and update the application’s data in a consistent way, making it easier to manage and debug complex applications.

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

How does Redux work?

A

Redux manages the application’s state in a single store and manages the state with actions and reducers. Actions describe changes or events in-app while reducers specify how the state should modify based on the action. Components can subscribe to the store to receive the updated state, facilitating a structured data flow in the app.

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

What makes Redux so special?

A

Redux is special because it provides a predictable and centralized way to manage an application’s state.

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

Redux setup process?

A

install redux, create store, create reducers functions, create action objects, dispatch actions, connect components to store, subscribe components to store, optional middleware (redux-thunk), initialize state, and render components

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

What are reducers in Redux?

A

In Redux, reducers are functions that specify how an application’s state should change in response to actions.

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

Why do you choose React?

A

Because React is component-based, it promotes reusability and makes it easier to build complex applications. React uses the virtual DOM, optimizing rendering. Backed by a strong community and maintained by Facebook. React has a RIch ecosystem of 3rd party libraries (react-router, redux) that extend functionality.

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

What is AJAX?

A

Asynchronous Javascript and XML, allow the web app to retrieve data in the background making web apps faster and seamless. Sending and receiving data without refreshing the whole page

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

What is reponsive design?

A

creating websites that adapt to various screen-sized to ensure its user-friendly.

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

What is the difference between REST and RESTful API?

A

REST is the architectural style, the set of guidelines, best practices, and constraints.

RESTful API is the actual implementation of that architectural style. It’s what developers create and consumers (like apps or other services) interact with over the web.

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

what is a RESTful api?

A

A RESTful API is a web service that adheres to REST principles, using standard HTTP methods for clients to access and manipulate resources in a predictable way

RESTful APIs provide a standardized way to communicate with backend systems to create dynamic and interactive applications.

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

what is the purpose of a RESTful API?

A

The purpose of using a RESTful API is to enable applications to exchange data over the Internet in a standardized manner,

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

what is closure?

A

Closure is a function that retains access to variables in its outer scope even after the outer scop function has finished executing. This allows the inner function to “remember” those variables, providing a way to encapsulate data, often used for creating private variables and maintaining state within functions.

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

What is a promise?

A

A Promise is an asynchronous value, a value that is unknown now but can be known in the future. its like saying “I’ll let you know when I am done, you can decide what to do later whether success or error”. this way better to load data preventing the whole app from freezing.

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

What is a callback?

A

A function passed as a parameter to another function.

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

What are the major features of React?

A

component based which are reusable components to build complex apps, virtual dom and reconciliation which updates only specific components not the entire app, React allows you to write in JSX, JS syntax that makes your code more readable, strong community behind it

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

What is JSX?

A

JavaScript XML, a syntax extension used for Javasciprt used in React to describe how the UI should look like.. It is HTML-like code that makes it easier to create and render components in a readable manner. JSX later gets transformed into javascript with Babel.

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

What is the Virtual DOM?

A

Virtual DOM is a blueprint of the actual DOM.

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

How does the Virtual DOM work?

A

When something changes, the virtual DOM is updated first, then it compares the virtual DOM with the actual DOM, and changes only update the parts that are different.

20
Q

What is the difference between state and props?

A

Props are immutable, are used for parent-child communication, promote reusability and one-way data flow

State is mutable, managed internally, triggers reusability and is scoped to the component

21
Q

what is state?

A

State is the status and data store of a component at a specific point in time. It encompasses all the variables data and dictates how the component looks and behaves.

22
Q

What does lifting state up mean and why do we do it?

A

Lifting state refers to moving the state from child to parent component. By doing so you centralize the state management making it easier to coordinate interactions and data flow between sibling components

23
Q

Why do we set a key property when we map over an array in React?

A

The ‘key’ helps React know which elements have changed or need to be updated, optimizing the rendering process.

24
Q

what are the core principles of Redux?

A

The core principles of Redux are maintaining a single immutable state tree and an unidirectional data flow. Actions describe changes that are processed by reducers to update the state, which in turn re-renders the UI. Redux ensures a predictable and debuggable app.

25
Q

How do I make an AJAX request using Redux?

A

In Redux you usually make AJAX requests using middleware such as Redux Thunk. Within your action create you initialize the AJAX request and then dispatch actions to update the state based on the response.

26
Q

What are the benefits of using Redux DevTools?

A

Redux DevTools are useful for debugging as they can track the Redux store of an application.

27
Q

How do I use React DevTools? What does this help me with?

A

In React DevTools you can inspect the components state and props helping with the debugging process.

28
Q

What is closure and how is it used by React?

A

When there is a function inside another function then the inner function has access to the variables and scope of the outer function and its ancestors.

React uses closures to capture and remember the current state and props in functional components and hooks, like useState and useEffect. This enables better encapsulation and helps in maintaining state across re-renders, providing a more predictable behavior, especially in asynchronous operations.

29
Q

What is redux-thunk?

A

Redux-Thunk is a Redux middleware used for write action create that output functions instead of plain objects. This allows you to manage Asynchronous operations and dispatch different actions depending on the API calls.

30
Q

What is the difference and similarities between React context vs Redux?

A

Both are used to manage state. React context is built in React and Redux is a more structured and scalable architecture used to make more complex applications.

31
Q

What’s the benefit of using async/await?

A

Makes async/await code improve readability and improve error handling as try/catch blocks can be added.

32
Q

What is cookie? cookies vs localStorage vs sessionStorage?

A

Cookies, localStorage, and sessionStorage are web storage options that differ in accessibility, lifetime, and storage capacity. Cookies are accessible on both the server and client, have expiration settings, and are limited to 4KB, while localStorage and sessionStorage are client-side only, with localStorage being persistent and sessionStorage limited to a browser session, both offering around 5-10MB of storage

33
Q

What is prototypal inheritance?

A

Prototypal inheritance in Javascript allows objects to access other objects and functions based on the prototype chain.

34
Q

What is the DOM?

A

The Document Object Model (DOM) is a structured representation of an HTML or XML document, allowing you to manipulate its content and structure using JavaScript. its the bridge between HTML and JS.

35
Q

How to copy an Array?

A

[…array] or array.slice() –> both are shallow copies

36
Q

How to compare two objects?

A

Perform a shallow comparison by iterating through one of the objects comparing each key and value with the other object.

37
Q

What is asynchronous programming and why is it important in JavaScript?

A

Improves user experience by allowing you to perform JS operation in the background without interrupting the main thread of execution.

38
Q

What is hoisting?

A

In JS, Hoisting is moving the variable and function declaration to the top of the containing scope. This enables function and variable call before declaration.

39
Q

What is apply, call and bind?

A

Apply, Call and Bind, are used to set the “this” context on a function. Apply and call are invoked immediately and Bind is set for a predetermined this.

40
Q

DIfference between let, var, const

A

All these are for variable declarations. Var is function scope and is hoisted to undefined. While let and const are block scope and are not hoisted, Const doesn’t have reassignment property.

41
Q

What’s the difference between a variable that is: null, undefined or undeclared? How would you go about checking for any of these states?

A

null is an explicitly empty value set by the developer.
undefined means a variable has been declared but hasn’t been assigned a value yet.
Undeclared variables are those that have not been declared at all and trying to access them results in an error.

42
Q

what is higher order function?

A

Higher Order functions increase the maintainability and functionality of a function by allowing you to pass functions as other arguments.

43
Q

What is the difference between store and reducer

A

Store contains the entire state tree of an application, a reducer is a function that takes the current state and an action and is able to update the state based on the dispatched action.

44
Q

What is the difference between == and ===?

A

”==” does type coercion. meaning it makes both values the same type before comparing, while “===” check for both type and value.

45
Q

What are Agile Methodologies?

A

Agile is a flexible approach to project management and software development that emphasizes incremental delivery, collaboration, and adaptability to change.

46
Q

What is the Scrum Method?

A

Scrum is a framework within Agile that structures teamwork with specific roles, regular progress checks, and iterative product increments to deliver work efficiently.