๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ :
- Closures & Scope
- Event Loop & Async
- Promises & Async/Await
- Hoisting & This Keyword
- Prototypes & Inheritance
๐ฅ๐ฒ๐ฎ๐ฐ๐ :
- useState & useEffect
- Context API & useContext
- Custom Hooks
- Component Lifecycle
- State Management (Redux/Zustand)
๐ฃ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ & ๐ข๐ฝ๐๐ถ๐บ๐ถ๐๐ฎ๐๐ถ๐ผ๐ป:
- Code Splitting & Lazy Loading
- Memoization (useMemo, useCallback)
- Virtual DOM & Reconciliation
- Bundle Optimization
- Web Vitals & Performance Metrics
๐๐๐๐ฒ๐ป๐๐ถ๐ฎ๐น ๐๐ผ๐ป๐ฐ๐ฒ๐ฝ๐๐:
- Event Delegation & Bubbling
- Debouncing & Throttling
- Error Boundaries & Error Handling
- Browser Storage (localStorage, sessionStorage)
- REST APIs & HTTP Methods
๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ ๐ฏ๐ฎ๐๐ฒ๐ฑ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐
- Implement
Promise.allpolyfill - Implement
Promise.anypolyfill - Implement
Array.prototype.reducepolyfill - Implement Lodashโs
flattenmethod - Implement auto-retry for promises
- Throttle promises by batching
- Debouncing implementation
- Throttling implementation
- Execute N callback-based async tasks in series
- Output prediction for tricky 10โ15 JavaScript snippets
- Object vs Map differences in JavaScript
- Difference between
PATCHandPUT - What is the difference between debounce and throttle?
- How does the JavaScript Engine work?
- What is the Event Loop and how does the Microtask Queue work?
- Explain Virtual DOM and its comparison mechanism
- How to control tab order in DOM (explain
tabIndex) - What is Event Capturing and Bubbling
- How to override
toStringonString.prototype - What is OAuth and how does it work?
- How does SSO work?
- What are REST API methods and their differences?
- Principles of Functional Programming
- What are microservices?
๐ฅ๐ฒ๐ฎ๐ฐ๐-๐ฆ๐ฝ๐ฒ๐ฐ๐ถ๐ณ๐ถ๐ฐ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐
- Why do keys matter in React and how do they improve performance?
- Explain how
useStateworks internally - Implement a basic version of
useState - What are React Portals? How are modals mounted using them?
- What are Error Boundaries in React?
- How does memoization work in React?
- SSR vs CSR with examples and use-cases
- What is Module Federation?
- What is Micro-Frontend Architecture?
- Server-Side Rendering techniques to improve SEO
- What are memory leaks in React and how to detect them?
- How to measure performance in a React application?
- How would you build a tool like Create React App?
- How do you structure reusable UI components in React?
๐ญ. ๐๐ฎ๐น๐น ๐ฆ๐๐ฎ๐ฐ๐ธ
โ ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ถ๐?
The Call Stack is where JavaScript keeps track of function calls. It is a stack structure that handles synchronous code execution.
โ ๐๐ผ๐ ๐ฑ๐ผ๐ฒ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ?
- When a function is invoked, itโs pushed onto the stack.
- Once it finishes, itโs popped off.
- If an error occurs during execution, itโs thrown from the stack.
๐ฎ. ๐๐๐ฒ๐ป๐ ๐ค๐๐ฒ๐๐ฒ (๐๐ฎ๐น๐น๐ฏ๐ฎ๐ฐ๐ธ ๐ค๐๐ฒ๐๐ฒ)
โ ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ถ๐?
The Event Queue (also known as the callback queue) stores events that are to be processed asynchronously, like events triggered by a setTimeout or DOM events.
โ ๐๐ผ๐ ๐ฑ๐ผ๐ฒ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ?
- When the Call Stack is empty, the Event Loop checks the Event Queue.
- It then pushes the next task onto the stack for execution.
๐ฏ. ๐ ๐ถ๐ฐ๐ฟ๐ผ๐๐ฎ๐๐ธ ๐ค๐๐ฒ๐๐ฒ
โ ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ถ๐?
The Microtask Queue holds tasks that need to be executed after the currently executing script, but before any events in the event queue. Microtasks include promise callbacks and other tasks like MutationObserver.
โ ๐๐ผ๐ ๐ฑ๐ผ๐ฒ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ?
Once the call stack is empty and before the event queue is processed, the event loop picks up and processes tasks in the microtask queue. This ensures that promises are resolved before other events are processed.
๐ฐ. ๐๐๐ฒ๐ป๐ ๐๐ผ๐ผ๐ฝ
โ ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ถ๐?
The Event Loop is the mechanism that allows JavaScript to perform non-blocking operations by managing the order in which tasks are executed from the call stack, event queue, and microtask queue.
- ๐๐ผ๐ ๐ฑ๐ผ๐ฒ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ? The event loop constantly checks the call stack. If the call stack is empty, it checks the microtask queue and processes any pending microtasks. After all microtasks are processed, the event loop picks events from the event queue for execution.
๐๐ฒ๐ ๐ฃ๐ผ๐ถ๐ป๐:
Microtasks are always executed before the event queue. This is why Promise.then() is processed before setTimeout().
๐ฑ. ๐ฆ๐ฒ๐๐ง๐ถ๐บ๐ฒ๐ผ๐๐ ๐ฎ๐ป๐ฑ ๐ฆ๐ฒ๐๐๐ป๐๐ฒ๐ฟ๐๐ฎ๐น
โ ๐ช๐ต๐ฎ๐ ๐ถ๐ ๐ถ๐?
setTimeout() and setInterval() are used to schedule code execution after a specified time, but they are added to the event queue and are processed after all synchronous code and microtasks.
- ๐๐ผ๐ ๐ฑ๐ผ๐ฒ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ? The setTimeout() and setInterval() tasks are executed after the current script is finished executing, which is why you may see asynchronous code run after synchronous code (even if itโs scheduled for immediate execution).
- What is React, and what problem does it solve?
- What are the main features of React?
- What is the difference between a class component and a functional component?
- What is JSX, and why is it used in React?
- How does the Virtual DOM work in React?
- What is reconciliation in React?
- Explain the concept of React Fiber.
- What are keys in React, and why are they important?
- What are props and state in React?
- How is state different from props?
- What are React Hooks, and why were they introduced?
- Explain the useState and useEffect hooks with examples.
- What is the difference between useMemo and useCallback?
- How does useRef work, and what are its common use cases?
- What are custom hooks, and how do you create one?
- What is the difference between useLayoutEffect and useEffect?
- How do you handle cleanup in useEffect?
- Can you explain the rules of hooks?
- What are the different phases of a React componentโs lifecycle?
- What are lifecycle methods in class components?
- How can you replicate lifecycle methods using hooks?
- What is the difference between componentDidMount and useEffect?
- How can you optimize re-renders in React components?
- How is state managed in React applications?
- What are controlled and uncontrolled components?
- What is the Context API in React, and how is it used?
- What is Redux, and how does it work with React?
- What are the differences between Redux, MobX, and Context API?
- How does useReducer differ from useState?
- What are actions, reducers, and stores in Redux?
- What is React Suspense, and how does it improve performance?
- Explain React.lazy() and code splitting.
- What is server-side rendering (SSR) in React?
- How does hydration work in Next.js?
- What is React Concurrent Mode (or Concurrent Features)?
- What are higher-order components (HOCs)?
- What are render props in React?
- What are portals in React, and where are they used?
- How can you optimize performance in large React apps?
- What are fragments in React?
- How are events handled in React?
- What is event bubbling and event capturing?
- How do you handle forms and validations in React?
- What is React Router, and how does routing work?
- What is the difference between BrowserRouter and HashRouter?
- How do you pass data between routes in React Router v6?
- What are the best practices for structuring React projects?
- How do you test React components?
- What are snapshot tests in React?
What tools are commonly used for testing React apps (e.g., Jest, RTL, Cypress)?
Difference between useMemo and useCallback.
What is a key in React? Why do we use it, and what happens if we donโt?
What is the difference between useLayoutEffect and useEffect?
How do you manage the state if your state is dependent on the previous state?
How do you optimize a React application? How does lazy loading work? Where exactly is lazy loading beneficial?
How browser read TypeScript?
How event loop work? Which has more priority macro task queue or, micro task queue? If I have 100 tasks in macro and 1 in micro, which will be executed first?
What techniques would you use to prevent layout shifts (CLS) and improve perceived performance in a React application?
How will you debug any production issue without writing logs?
What is Webpack? benefits of using it?
How to measure the web app performance?
What is the difference between Real DOM and Virtual DOM, and how does this work in deep?
Create a parent box, then display 3 boxes diagonally inside it.
If the browser cache becomes full due to your application storing too much data, how would you prevent the application from crashing or breaking?
How can I debug and stop a React component from re-rendering multiple times due to changes in another component?
Output of code below, what is the value of c?
const [c, setC] = useState(0);
useEffect(() => {
console.log(โhelloโ);
setC(c + 1);
setC(c+1)
setC(c+1)
});Scenario-based questions on event bubbling and stopPropagation.
Overloading and overriding in JavaScript
What are Error Boundaries?
What is the difference between createElement and using a component tag in React?
What are debouncing and throttling? Give examples.
What is React?
What is useMemo ?
What are the features of React ?
What is JSX ?
What is DOM ?
What is Virtual Dom ?
What is component life cycle of React class component ?
What are fragments in react ?
What are props in react ?
What are synthetic events in react ?
What are the difference between Package.json and Package.lock.json ?
What are the differences between client side and server side rendering ?
What is state in Reactjs?
What are props ?
What are the differences between State and Props in react ?
What is props drilling ?
What are the disadvantages of props drilling and How we can avoid props drilling ?
What are Pure components in React ?
Whatare Refโs in React?
What is meant by forward ref ?
What are Error boundaries ?
What are Higher order components in react ?
What are the differences between controlled and uncontrolled components ?
What is useCallback ?
What are the differences between useMemo and useCallback ?
What are keys in React ?
What is Lazy loading in React ?
What is suspense in React ?
What are custom hooks ?
What is useReducer hook ?
What are Portals in react ?
What is context in react ?
Practical question: Give an example of context api usage ?
What is the purpose of callback function as an argument of setState()?
Practical question: create a custom hook for increment/decrement counter ?
Which lifecycle hooks in class component are replaced with useEffect in functional components ?
What is Strict mode in react ?
What are the different ways to pass data from child component to parent component in react ?
Practical question: How to send data from child to parent using callback functions ?
Practical question: How to send the data from child component to parent using useRef ?
How do you optimize your react application ?
How would you consume a RESTful JSON API in reactjs?
43.different design patterns used in react?context api vs redux
prop types in react(How to apply validation on props in react)
What are React Mixins ?
what are the different hooks you have used ?
What are render props in react ?
What are the different types of exports and imports ?
What are the differences between create element vs clone element in react ?
When to use useState and useReducer?
What are protected routes in react ?
What is react-router has context menu
Become a member
JavaScriptโ:
Can you explain hoisting and give an example?
What is the difference between var, let, and const?
What is event delegation in JavaScript?
How does the this keyword work within different contexts?
โ๏ธ ReactJS:
What is the difference between using useCallback and useMemo?
What is the impact of Virtual DOM on performance?
Can you explain the React component lifecycle (with hooks)?
How can you optimize a re-render in React?
โ๏ธ Next.js:
What is the difference between using getServerSideProps or getStaticProps?
How does routing function in Next.js?
What are the advantages of Next.js over CRA?
There was also a small coding exercise from the interviewer:
Create a simple todo list app with the ability to add, update, and delete using React hooks.
JavaScript Deep Dive
This round focused heavily on JS fundamentals and hands-on coding.
Key topics included:
- Output-based questions around this, arrow functions, and call/apply/bind
- A currying problem (Try question here: https://lnkd.in/dVUaWXvc)
- Implementing a polyfill for Array reduce method (Try question here: https://lnkd.in/dfn6Mkpf)
- Writing a function to fetch data from an API with a timeout/abort feature
๐ป Round 2 โ Machine Coding
This round tested real-world implementation skills.
Tasks included:
- Implementing prototypal inheritance from scratch
- Building a login form (focus on structure, validation, and state management) (Similar question: https://lnkd.in/dZdA-pbB)
๐งฉ Round 3 โ Hiring Manager Discussion
This was a mix of technical depth and project understanding.
Covered topics:
- In-depth discussion on past projects and design decisions
- Focus areas like SDLC, observability, debuggability, and performance optimization
๐งญ Takeaway:
Angel Oneโs interview process strongly emphasizes JavaScript mastery, hands-on problem-solving, and system-level thinking. If youโre preparing โ make sure you can explain your code and design choices clearly, not just make them work.
Top Javascript #interview Questions
- What is the difference between var, let, and const in JavaScript?
- What are closures in JavaScript, and how do they work?
- What is the this keyword in JavaScript, and how does it behave in different contexts?
- What is a JavaScript promise, and how does it handle asynchronous code?
- What is the event loop, and how does JavaScript handle asynchronous operations?
- What is hoisting in JavaScript, and how does it work?
- What are JavaScript data types, and how do you check the type of a variable?
- What is the difference between null and undefined in JavaScript?
- What is a callback function, and how is it used?
- How do you manage errors in JavaScript?
- What is the difference between setTimeout() and setInterval()?
- How do JavaScript promises work, and what is the then() method?
- What is async/await, and how does it simplify asynchronous code in JavaScript?
- What are the advantages of using async functions over callbacks?
- How do you handle multiple promises simultaneously?
- What are higher-order functions in JavaScript, and can you provide an example?
- What is destructuring in JavaScript, and how is it useful?
- What are template literals in JavaScript, and how do they work?
- How does the spread operator work in JavaScript?
- What is the rest parameter in JavaScript, and how does it differ from the arguments object?
- What is the difference between an object and an array in JavaScript?
- How do you clone an object or array in JavaScript?
- What are object methods like Object.keys(), Object.values(), and Object.entries()?
- How does the map() method work in JavaScript, and when would you use it?
- What is the difference between map() and forEach() in JavaScript?
- What is event delegation in JavaScript, and why is it useful?
- What are JavaScript modules, and how do you import/export them?
- What is the prototype chain in JavaScript, and how does inheritance work?
- What is bind(), call(), and apply() in JavaScript, and when do you use them?
- How does JavaScript handle equality comparisons with == and ===?
- What is the Document Object Model (DOM), and how does JavaScript interact with it?
- How do you prevent default actions and stop event propagation in JavaScript?
- What is the difference between synchronous and asynchronous code in JavaScript?
- What is the difference between an event object and a custom event in JavaScript?
- How do you optimize performance in JavaScript applications?
Here are 10 real React.js interview scenarios with smart answers ๐ง
1๏ธโฃ Scenario: The interviewer asks โ โYour React app is lagging. How do you find the root cause?โ
A: Use React Profiler, track component re-renders, and identify heavy components or unnecessary state updates.
2๏ธโฃ Scenario: โYou updated a prop, but UI didnโt reflect the change. What could be wrong?โ
A: State immutability issue or memoized child component not detecting prop changes.
3๏ธโฃ Scenario: โYou have two API calls โ one depends on another. How would you handle it in React?โ
A: Chain the calls using async/await or use Promise.all if they can run in parallel, managing loading state cleanly.
4๏ธโฃ Scenario: โYour useEffect is firing twice. Whatโs the reason?โ
A: React Strict Mode in development double-invokes effects; ensure side effects are idempotent.
5๏ธโฃ Scenario: โYour component unmounts before async data arrives. How do you prevent state update errors?โ
A: Use cleanup function or AbortController to cancel requests on unmount.
6๏ธโฃ Scenario: โYour user list component re-renders even when data doesnโt change.โ
A: Optimize with React.memo, useMemo, or useCallback to prevent unnecessary renders.
7๏ธโฃ Scenario: โHow would you improve the performance of a large table with 10,000+ rows?โ
A: Virtualize the list using libraries like react-window or react-virtualized.
8๏ธโฃ Scenario: โWhat if two components need the same data but arenโt parent-child?โ
A: Use Context API or a global store like Redux, Zustand, or Recoil.
9๏ธโฃ Scenario: โYou deployed your React app and got a blank screen โ what do you check first?โ
A: Check route paths, build paths, console errors, and environment variables.
๐ Scenario: โHow would you debug a component that randomly breaks after navigation?โ
A: Inspect React DevTools for props/state, check unmounted component updates, and verify cleanup in effects.
Top comments (0)