Top 100 JavaScript Interview Questions

JavaScript Interview Questions For Freshers

    1. What are the data types in JavaScript ?
    2. What is an object in JavaScript ?
    3. In how many ways we can define an object in JavaScript ?
    4. How to define a class in JavaScript ?
    5. What is defineProperty() method of javascript Object ?
    6. What is scope in JavaScript ?
    7. Explain variable hoisting ?
    8. Explain closures in javascript ?
    9. Difference between null and undefined ?
    10. Difference between == and === ?
    11. What are the new features in ES6 , which were not there in previous JavaScript version ?
    12. Explain time complexity ?
    13. What is space complexity ?
    14. What will be the output of the below code: let obj ={ a: 10, vir : function(){ x(); console.log(this.a); function x(){ console.log(this.a) } } } obj.vir();

    15. What will be the output of the below code for (var i= 0; i < 5; i++){ setTimeout(() => console.log(i)); }
    16. What will be the output of the below code :- var a = 90; doit(); function doit(){ console.log(a); var a = 10; }
    17. Explain call(), bind() and apply() in JavaScript ?
    18. Advantage of using arrow functions ?
    19. What is webpack and babel ?
    20. How can we add an element at the start of a JavaScript array ?
    21. How to capitalise all the first letters of a given string ?
    22. What will be the output of below code snippet :-function x() {return 2}alert(x());function x() {return 3}
    23. What will be output of following code doit(); var doit = function (){ alert('x'); }
    24. Difference between pass by value and pass by reference ?
    25. What will be the output of following code:- for (var i= 0; i < 5; i++){ (function(i) { setTimeout( () => console.log(i)) })(i); }
    26. What is InstanceOf operator ?
    27. What is the use of constructor() in a class ?
    28. What will be the output of the following :
      console.log(4.toString());
      console.log(4.2.toString());

      console.log(4*undefined);
    29. How can we use javascript Set to remove duplicate elements of an array ?
    30. What is the data storage limit of a cookie ? and what is the maximum number of characters that can be stored in a cookie string ?
    31. How to make deep copy and shallow copy of objects ?
    32. What's the difference between for loop and for each loop ?
    33. What is a unary function ?
    34. What is JSON in javascript and what are its advantages ?
    35. What is JSON.stringify() ?
    36. What is JSON.parse() ?


    Source:- JavaScript Developer Interview Questions for Freshers 

JavaScript Interview Questions For Experienced 

  1. What is Callback hell ?
  2. Explain promises in JavaScript ?
  3. Difference between observable and a promise
  4. How to create custom events in JavaScript ?
  5. Difference between prototype and _proto_ ?
  6. Explain prototypal inheritance in JavaScript ?
  7. Difference between for in and for of loop ?

  8. Difference between get and post methods ?
  9. Difference between post and put methods ?
  10. When we pass an object to a function are they passed by reference or by value ?
  11. What do u understand by the terms mutable and immutable in JavaScript ?
  12. What is Async and Await in JavaScript ?
  13. Is array a data type ?
  14. How can we overwrite any JavaScript inbuilt property (like array.push())
  15. Explain exception handling in JavaScript ?
  16. Difference between a transpiler and a compiler ?
  17. How to check if a number is an integer without using math function and without converting number into string or array ?
  18. Use of JavaScript clearInterval() ?
  19. How to define a private method or variable inside a class in JavaScript or ES6 ?
  20. Can arrow functions be used as constructor functions ?
  21. What is Map in JavaScript ?
  22. How to implement authentication in a website ?
  23. How would you implement pagination using JavaScript ?
  24. Difference between a browser tab and a window in context of localstorage and sessionstorage ?
  25. What is oauth in context of jwt ?
  26. What is nginx used for ?
  27. How to change the redirection URLs after the build has been made ?
  28. What is a JWT , what are it's parts and what is its use ?
  29. What are ‘set’ in javascript ?
  30. Do we have reverse() method on javascript string ?
  31. Name some array methods in JavaScript ?
  32. Which operation is faster among == and === ?
  33. Explain Array's sort method for sorting numbers. What is the time complexity of this method ?
  34. What is Micro frontend architecture ?
  35. What is the difference between first class function and higher order function ?    
  36. What is temporal dead zone ?
  37. Difference between put and patch method in javascript ?
  38. How to convert an object to an Array in JavaScript ?
  39. What is memoization in JavaScript ?
  40. How to write a function ‘Sum’ such that on calling sum(a)(b)(c)....() where a,b,c etc are numbers , the output will be a+b+c+....(function calls with parameters) ?
  41. What are the design patterns in JavaScript ?
  42. What is event loop in JavaScript ?
  43. How to deep clone in JavaScript ?
  44. How to flatten an array in JavaScript ?
  45. What is debounce in JavaScript ?
  46. Write a code to flatten the contents of an object ?
  47. How to create virtual dom in JavaScript ?
  48. What is critical rendering path ?
  49. What is a freeze method in JavaScript ?
  50. What are solid principles in JavaScript ?
  51. What is the seal method in JavaScript ?
  52. Difference between Angular and React ?
  53. How to watch variable changes in JavaScript ?
  54. How to create a change detection mechanism of JavaScript framework ?
  55. What is functional programming in JavaScript ?
  56. What is the use of function currying in JavaScript ?
  57. What is quick sort and what is it’s time complexity ?
  58. Explain bubble sort and insertion sort with example ?
  59. What is a REST API ?
  60. How to apply conditional breakpoints in chrome browser debugging tool ?
  61. Why storing JWT in cookie is safer than storing JWT in session storage or local storage? Is storing in cookie 100 percent safe ? what if I copy JWT from cookie in the browser debug panel and use it in a CSRF attack ?
  62. What is an execution context and lexical environment in JavaScript ?
  63. What is generator function in JavaScript ?
  64. What are JavaScript iterators ?



For more questions and answers visit our website at  frontend interview questions

Comments

Popular posts from this blog

JavaScript Developer Interview Questions for Freshers

Frontend Interview Questions External Links

JavaScript Interview Questions For 3 Years Of Experience