≡ Menu

Javascript Job Interview Questions

Here is a nice list of  Javascript & React interview questions.

How many of these questions can you answer correctly without using AI?

1. Group API calls in batches to reduce server load.

2. Create your own Promise.all implementation.

3. Design a Promise.any that resolves to the first fulfilled promise.

4. Develop a Promise.race to resolve based on the fastest result.

5. Implement Promise.allSettled to handle multiple results—fulfilled or rejected.

6. Add a finally method for promises that always runs, regardless of outcome.

7. Convert traditional callback-based functions into promises (promisify).

8. Implement custom methods for Promise.resolve() and Promise.reject().

9. Execute N async tasks in series—one after another.

10. Handle N async tasks in parallel and collect results.

11. Process N async tasks in race to pick the fastest one.

12. Recreate setTimeout() from scratch.

13. Rebuild setInterval() for periodic execution.

14. Design a clearAllTimers function to cancel all timeouts and intervals.

15. Add auto-retry logic for failed API calls with exponential backoff.

16. Create a debounce function to limit how often a task is executed.

17. Implement throttling to control the frequency of function calls.

18. Build a custom Promise from scratch.

19. Build a cache system to memoize identical API calls for better performance.

20. Develop a promise chaining system to handle dependent tasks seamlessly.

21. Write a timeout-safe promise to reject automatically if it takes too long.

22. Implement a retry mechanism with a maximum attempt limit.

23. Create a cancelable promise to terminate unwanted async tasks.

24. Build an event emitter to handle custom events in an asynchronous flow.

25. Simulate async polling to continuously check server updates.

26. Design a rate limiter to handle high-frequency API requests.

27. Implement a job scheduler that runs async tasks at specified intervals.

28. Develop a parallel execution pool to limit concurrency in async tasks.

29. Create a lazy loader for async data fetching.

30. Build an async pipeline to process tasks in stages with dependencies.

React Interview Questions

1. What are the limitations of React in building large-scale applications?

2. How does React manage the Virtual DOM, and what are the benefits?

3. Can React Hooks fully replace Redux for state management? Explain why or why not.

4. What are the best practices for managing state in large React applications?

5. How would you optimize performance in a React app with large component trees?

6. Explain React’s Strict Mode and its impact on development.

7. How can you prevent unnecessary re-renders in React functional components?

8. Describe the key differences between functional and class components in React.

9. What is the significance of the React Fiber architecture?

10. How does React handle side effects, and how can you manage them effectively?

11. Explain the differences between `useMemo()` and `useCallback()` in React.

12. How would you implement dynamic form handling and validation in React?

13. What is lazy loading in React, and how does it improve application performance?

14. How would you handle errors in a React app, and what is the role of error boundaries?

15. What are the benefits of server-side rendering (SSR) in React applications?

16. How do you handle styling in React components? Discuss different approaches.

17. How would you pass data between sibling components in React without using Redux?

18. Explain the use case of `useEffect()` for fetching data from an API.

19. How do you handle asynchronous operations in React using `async/await` or Promises?

20. How would you re-render a component when the window is resized?

21. Describe how React Context API can be used for state management in an app.

22. What is the role of React Router, and how does it work with dynamic routing?

23. Explain the concept of controlled and uncontrolled components in React.

24. How would you optimize React app performance when handling large lists or grids?

25. Explain the difference between shallow and deep comparison in React’s `shouldComponentUpdate`.

26. How do you handle asynchronous code execution and state updates in React?

27. How would you implement custom hooks to abstract logic in React?

28. What are higher-order components (HOCs) in React, and how are they used?

29. How would you implement a search feature with debouncing in React?

30. Explain React’s reconciliation process and how it updates the DOM efficiently.

Questions about these topics might be asked if you are interviewing for a frontend position:

1. Closures
2. Event Loop and Asynchronous JavaScript
3. Hoisting
4. Scope and Lexical Scope
5. this Keyword
6. Prototypal Inheritance
7. Callbacks, Promises, and Async/Await
8. JavaScript Engines and Optimization
9. Destructuring
10. Higher-Order Functions
11. bind(), call(), and apply()
12. Modules and Imports/Exports
13. Error Handling (try/catch)
14. Debouncing and Throttling
15. DOM Manipulation
16. Object-Oriented Programming (OOP) Principles in JS

Leet Code Style Interview Questions

1. Reverse a String
2. Check if a String is a Palindrome
3. Remove Duplicates from a String
4. Find the First Non-Repeating Character
5. Count the Occurrences of Each Character
6. Reverse Words in a Sentence
7. Check if Two Strings are Anagrams
8. Find the Longest Substring Without Repeating Characters
9. Convert a String to an Integer (atoi Implementation)
10. Compress a String (Run-Length Encoding)
11. Find the Most Frequent Character
12. Find All Substrings of a Given String
13. Check if a String is a Rotation of Another String
14. Remove All White Spaces from a String
15. Check if a String is a Valid Shuffle of Two Strings
16. Convert a String to Title Case
17. Find the Longest Common Prefix
18. Convert a String to a Character Array
19. Replace Spaces with %20 (URL Encoding)
20. Convert a Sentence into an Acronym
21. Check if a String Contains Only Digits
22. Find the Number of Words in a String
23. Remove a Given Character from a String
24. Find the Shortest Word in a String
25. Find the Longest Palindromic Substring

{ 0 comments… add one }

Leave a Comment