{
  "id": 68334,
  "title": "30 technical interview questions, explained the way you'd actually say them",
  "url": "https://urgent.news/2026/08/03/30-technical-interview-questions-explained-the-way-youd-actually-say",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-03T03:05:35.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ramana_babu_c787073206bef/30-technical-interview-questions-explained-the-way-youd-actually-say-them-4a3g"
  },
  "original_language": "en",
  "account": "1. A closure is a function that retains access to variables from the scope in which it was created, even after the outer function has completed execution. This concept is crucial in real-world code as it enables the creation of private variables, debouncing, memoization, and module patterns.\n\n2. When using setTimeout(fn, 0) versus Promise.then(), the Promise callback executes first. The .then() callbacks are placed in the microtask queue, which is processed before any macrotasks, such as the setTimeout function, even with a 0ms delay.\n\n3. The var keyword is function-scoped, meaning it shares the same variable across all iterations of a loop. On the other hand, let is block-scoped, providing each iteration with its own unique variable binding. This distinction is critical when using closures within loops.\n\n4. The == operator performs type coercion before comparison, leading to unexpected results like 0 being considered equal to false or an empty string being considered equal to 0. In contrast, the === operator compares both type and value, eliminating these potential pitfalls.\n\n5. In callback functions with regular functions, the 'this' keyword refers to the object that called the function. However, in arrow functions, 'this' is lexically bound to the scope where the function was defined, ensuring consistent behavior regardless of how the arrow function is invoked.\n\n6. If a property is not found on an object in JavaScript, the interpreter traverses the object's prototype chain. This chain consists of the object itself, then its prototype, then that prototype's prototype, and so on, until the property is found or a null value is reached.\n\n7. For search-as-you-type functionality, debounce is the preferred approach. It delays the execution of a function until a certain period of inactivity has passed since the last call. On the other hand, for scroll listeners, throttle should be used. Throttling limits the rate at which a function is executed, ensuring consistent and controlled updates.\n\n8. Use Promise.all when you require all results from a set of promises, and want the promise to reject if any of the promises fail. In contrast, Promise.race is employed when you only need the result from the first promise that resolves, regardless of whether it succeeds or fails.\n\n9. Certain functions can be called before their definition due to JavaScript's hoisting mechanism. Function declarations are fully hoisted, meaning their declarations are moved to the top of their containing scope before code execution. In contrast, let declarations only hoist the variable declaration, not the assignment, leading to a potential error if called before definition.\n\n10. Currying is a technique where a function with multiple arguments is transformed into a series of functions that each take a single argument. This technique proves useful for creating reusable, partially-configured functions that can be easily composed and customized.\n\n11. Updating the Virtual DOM in React is more efficient than directly updating the real DOM. React employs a process known as diffing, where it compares the old and new virtual trees, identifying and updating only the specific real DOM nodes that have changed. This approach minimizes the overhead of direct DOM manipulation.\n\n12. When the dependency array is omitted in a useEffect hook, the effect runs after every single render. This automatic re-rendering behavior can lead to performance issues and potential infinite loops if the effect itself updates the component's state, creating a continuous cycle.\n\n13. React batches updates from multiple setState calls within the same event handler to improve performance. This means that multiple state changes performed within a single event handler will be applied as a single re-render, rather than triggering separate re-renders for each change.\n\n14. When using array indices as keys for list items in React, the performance may suffer if the list is reordered. This is because React uses the key attribute to identify and track elements during re-renders. Utilizing the index as a key implies that the item at a specific position has changed when it actually moves, leading to unnecessary re-renders and potential issues.\n\n15. Controlled inputs in React are inputs whose value is managed by the component's state and updated via the onChange event handler. In contrast, uncontrolled inputs rely on the DOM's native value, which can be accessed and manipulated using refs. The key difference lies in how the input's value is controlled and updated within the component's lifecycle.\n\n16. useMemo and useCallback serve different purposes in memoizing values within React. useMemo memoizes the result of a computed value, allowing React to cache and reuse the result of an expensive calculation across multiple renders. On the other hand, useCallback memoizes the function itself, ensuring a stable reference that remains consistent across renders, particularly useful when passing functions as dependencies to memoized children.\n\n17. Context may not be the optimal tool when dealing with frequently-changing state, as it re-renders all components consuming the context on any state change. In such cases, it is preferable to employ alternative solutions like custom hooks or separate state management libraries to avoid unnecessary re-renders and maintain optimal performance.\n\n18. React.memo performs a shallow comparison of props when determining whether a component should re-render. If the props contain new object, array, or function references, React will treat them as different even if the underlying data remains the same. To address this issue and prevent unnecessary re-renders, it is essential to ensure that the prop values remain stable and comparable between renders.\n\n19. A custom hook is a JavaScript function whose name begins with the word 'use' and internally calls other React hooks. This naming convention, enforced by React's linter, signifies that the function adheres to the rules of hooks, enabling the creation of reusable and modular logic that can be shared across components.\n\n20. Error Boundaries in React do not function like conventional try/catch statements. While try/catch is designed to catch synchronous errors occurring within the code you directly execute, Error Boundaries specifically intercept and handle JavaScript errors that occur during the rendering process or in lifecycle methods. This exception handling mechanism allows developers to gracefully manage and display error states when errors occur within React components.",
  "summary": "30 Technical Interview Questions You Should Be Able to Explain Out Loud (JS / React / Node) Most interview prep content gives you a definition. Real interviews test something different: can you explain your reasoning clearly, out loud, under a little pressure — not just recite the right words. I put together 30 questions across JavaScript, React, and Node.js. Every answer here is written the way…",
  "key_points": [
    "Closure enables private variables and debouncing/memoization in JavaScript code.",
    "setTimeout(fn, 0) executes after Promise.then() due to microtask processing.",
    "var is function-scoped, while let is block-scoped, affecting closure behavior in loops."
  ],
  "editors_take": null,
  "illustration": "https://urgent.news/ill/68334.png",
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}