Skip to content

Instantly share code, notes, and snippets.

@debabrata100
Created February 17, 2021 09:44
Show Gist options
  • Save debabrata100/c82e79566ffa6be422afebbf2b806066 to your computer and use it in GitHub Desktop.
Save debabrata100/c82e79566ffa6be422afebbf2b806066 to your computer and use it in GitHub Desktop.
Js Interview questions
## React Js Interview Questions
1. Explain How react works.
2. What makes React different from other libraries>
3. What is Reconciliation?
4. What are the best practices one should think and follow while designing a component?
5. What is a Higher Order Component in react? Explain with code example.
6. What are the ways with which you can delay the loading of modules in react? Which one is better over another and why?
7. How React handles code splitting?
8. What are the ways to reuse a react component state logic ? Which one is better over another and why?
9. What are render props ?
10. What is component composition ?
11. What are control and uncontroled components?
12. How can you optimize a React Js application?
13. What are the lifecycle methods used in react? What are the deprecated methods?
14. Explain working of getSnapshotBeforeUpdate method.
15. How can you address run time errors in react app in production?
16. What are Error Boundaries in react? Which are the errors react can not handle with Error boundaries?
17. What are Fragments ?
18. How can you lazy load a react component in a server render react app?
19. What are the libraries built for server side rendering on top of React?
20. What is forwardRef?
21. What is props drilling in react?
22. What is Context Api?
23. Can we consume multiple contexts ? If Yes How ?
24. Explain how can you update context from a nested component.
25. What are ways to consume context api in a class component?
26. What are the ways to consume context api in a functional component?
27. When a context value change, does all decendant component rerender or only the ones which consume the context?
28. Can you update a component state using Jquery?
29. What are Refs? Give two use cases of refs?
30. Can you inherit a React component from another ? If yes, How? If no, Why?
31. What are React Hooks?
32. What are motivations behind React Hooks?
33. Is there any advantage of using hooks over class based approach?
34. Explain how useReducer hook works.
35. Which is better useState vs useReducer?
36. What is the difference useEffect and uselayoutEffect hooks?
37. What is difference between useMemo and useCallback ?
38. What is useDebugValue hook used for in react?
39. How will you hold previous props values in a functional component?
40. Explain custom hooks ? What is alternative for custom hooks in a class component?
41. Can you implement a custom hooks for useMemo/useCallback?
42. What are the argument types useState hook support?
43. What is react Profiler tool used for ?
44. What is the significance of keys in React?
45. Why should not developer user Array Index for key prop? Explain with an example?
46. What are Protals in react ?
47. What are ways for type checking in React?
48. What are synthetic events ?
49. What is event pooling ?
50. Do you write unit tests? if yes what libraries you use for that ?
51. Explain unit testing vs Integration testing vs e2e testing.
52. Have you used Axios? How od you suspend an Api call in between?
53. There is a situation where you have yo hit an API and it fails, How to implement a functionality to retry API call until it succeeds infinite times. What’s your approach and why?
54. Explain Redux in detail?
55. Can we create multiple Redux Store in a single App?
56. What are the steps to introduce Redux into a react App?
57. Explain Thunk Vs Saga. What is the difference ?
58. What are the hooks provided by react-redux?
59. You want upgrade your app from an older version of react before hooks to latest version. How will you do?
60. You have a button in a child component. When you click, you want to handle the click event in another child component of the same parent. How will you do that?
61. Write code to show how useMemo and useCallback work?
62. How react handles event bubbling and event capturing?
63. You have a server rendered App login page. Your browser javascript is disabled. How will you submit the login form ?
64. You want to upload 5 images and store the base64 urls of each in a react component state and render the loaded images. How will you achieve this?
65. Name an html element that is always used as uncontrolled component.
66. Why do you manage your application with Redux?
67. Redux Provider vs Context Provider
68. (Redux)How to use dynamic reducers?
69. (Saga) How to use dynamic Saga?
70. What are Pure functions?
71. What is a pure component?
72. What happens when a type checking(ex. propType) fails in a production App?
73. Virtual DOM and Shadow DOM implementation
## Javascript Questions
What are CJS, AMD, UMD, and ESM in Javascript?
What are different ways to achieve Inheritance in Javascript?
What is prototype chain?
What are the different OOPs concepts? How can you achive those in Javascript?
What is event loop and concurrency model in Javascript?
What are the two ways of Event Propagation in Javascript?
What is Event capturing and how to achive that?
What is Event Delegation?
What is difference between event.target and event.currentTarget?
What are the primitive data types in Javascript?
What is difference between Shallow Copy and Deep Copy?
Can you write a function to clone an Object?
What does this keyword do in Javascript?
What is hoisting in javascript and how to avoid that?
What is a closure?
Explain call, apply and bind methods.
Write a polyfill for bind method.
Write a polyfill for apply method.
What is currying ?
What is callback in Javascript? Ans: It helps the control flow with async calls.
What is callback hell and how to avoid that?
What are Promises?
What is difference between Promise and Async/Await?
What are iterators and generators?
What makes a string spread over an array?
How can you make an object iterable?
What is Symbol and what is its relation with generators?
What is the link between Async Await, Promise ad generators?
What are some use cases of Symbol?
What is difference bewteen let and var?
What is difference between let and const?
How to stop modifying variables declared with const?
How to stop object adding new properties but allow updating and deleting?
Object freeeze vs seal vs preventExtention?
How will you achieve Data privacy in Javascript?
Which are the built in iterators in Javascript?
How can you prevent inheriting properties from an Object?
What are WeekMaps and WeekSets?
What are some major features in ES6?
Give an Example of a ES6 class.
What is the difference between declaring an Arrow function and a normal function inside a es6 class?
What are static properties and static methods do in a ES6 class?
How do you call a static method from a child class?
How to make parallel requests using Async/Await?
Promise.all vs Promise.race vs Promise.any vs Promise.allSettled
Promise.all resolves promises when all promises passed or any of the failed? How to achieve any one of the promise is resolved then do something?
Array.slice vs Array.splice
Array.map vs Array.reduce
Design Pattens in Javascript?
Why we use design patterens?
Local Storage vs Cookies
What is the benefit of Destructuring ?
What are webworker ?
What is a service worker?
Sorting array of Objects
What is a higher order function. Write one of your own hof.
Write a function to hang your browser for 10 secs.
Build a stack.
Build a Queue.
Build a Set.
Write a class that extends built-in Objects like Set or Map etc If yes Give an Example.
How to memoize any function in Javascript?
## HTML & CSS
What is Accessibility?
What are some semantic elements in Javascript?
What is difference block and inline-block css properties?
What is difference inline and block elements?
Absolute vs relative position?
Why should we use flexbox design over traditional display properties to design a page?
What are Pseudo elemets and Pseudo classes?
What is box model?
border-box vs content-box
What are different ways to center align an element?
What are different device widths for responsive design?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment