0% found this document useful (0 votes)
17 views

Javascript Technical Questions

Javascript trivia style questions
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Javascript Technical Questions

Javascript trivia style questions
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Javascript Technical Questions

Basics

1. What are the different data types in JavaScript?


2. What’s the difference between var, let, and const?
3. How does JavaScript handle type coercion? Provide examples.
4. Explain the concept of hoisting in JavaScript.
5. What is the difference between == and ===?

Functions and Scopes

6. What is the difference between function declarations and function expressions?


7. Explain closures and provide an example use case.
8. What are arrow functions, and how do they differ from regular functions?
9. What is the purpose of the this keyword? How is it determined?
10. Explain the difference between call(), apply(), and bind().

Objects and Prototypes

11. What is the difference between Object.create() and using a constructor


function?
12. How does JavaScript’s prototypal inheritance work?
13. What are JavaScript’s built-in methods for iterating over an object’s properties?
14. What is the difference between shallow copy and deep copy? How can you
implement each?
15. How do you define a method in an object? How does it differ from a regular function?

Arrays and Iterables

16. What are the differences between .map(), .filter(), and .reduce()?
17. How do you find unique elements in an array?
18. What is the purpose of for...in and for...of? When should you use each?
19. Explain the Array.prototype.splice() and slice() methods.
20. How does destructuring work for arrays and objects?

Asynchronous JavaScript
21. What is the difference between synchronous and asynchronous code?
22. Explain the difference between setTimeout() and setInterval().
23. What is a promise? How does it differ from a callback?
24. Explain async/await and how they relate to promises.
25. What are the states of a promise?

Error Handling

26. How does JavaScript handle errors using try...catch?


27. What is the difference between a syntax error and a runtime error?
28. How do you create a custom error in JavaScript?
29. What is the purpose of the finally block in error handling?
30. How can you handle errors in asynchronous code?

Modules

31. What is the difference between import and require?


32. How do you export multiple functions or variables from a module?
33. What are named exports and default exports? Provide examples.
34. Explain the purpose of the export and import keywords.
35. How do ES modules differ from CommonJS modules?

Event Handling

36. What is event delegation in JavaScript?


37. What is the difference between e.preventDefault() and
e.stopPropagation()?
38. Explain the event loop and how it handles asynchronous tasks.
39. What is the difference between bubbling and capturing phases in event propagation?
40. How do you add and remove event listeners in JavaScript?

Advanced Concepts

41. What are generators in JavaScript? How do they differ from regular functions?
42. Explain the concept of a promise chain and its importance.
43. What is the difference between WeakMap and Map?
44. What is the difference between null and undefined?
45. How does JavaScript handle memory management and garbage collection?
Performance and Optimization

46. What are some techniques to optimize JavaScript performance?


47. What is the purpose of debouncing and throttling? Provide examples.
48. How does JavaScript handle large data sets with setImmediate() or
requestAnimationFrame()?
49. Explain how to optimize DOM manipulation in JavaScript.
50. What is a memory leak, and how can you prevent it in JavaScript?

Miscellaneous

51. What are template literals, and how do you use them?
52. What are tagged templates in JavaScript?
53. How do you polyfill a feature in JavaScript?
54. What is the difference between Object.freeze() and Object.seal()?
55. Explain the difference between a Symbol and a regular object property.

You might also like