Photo of 64 Javascript interview questions from top tech companies to practice

64 Javascript interview questions from top tech companies to practice

Hi, I’m Brian, a former senior software engineer and now software engineering advisor at Pathrise. I have worked with hundreds of software engineers to help them land their dream job.

Javascript is an incredibly versatile language that many companies, big and small, use in their stack. It is one of the top programming languages for software engineers as well as front-end, back-end, and full-stack developers. If you are preparing to interview for one of these types of roles, you should spend time practicing the questions you will be asked.

We have worked with hundreds of software engineers and developers on their job search, spending a lot of time on their technical interview preparation, so we created this list of 64 Javascript interview questions from real tech companies that can be used for practice and tips to keep in mind when you go into the interview.

  1. Facebook question – Explain the concept of ES6 promises to a 5-year-old.  
  2. Airbnb question – What are the advantages of using ES6 maps over objects? What about using ES6 sets over arrays?  
  3. Google question – Given 2 identical DOM trees (but not equal) and one element of the first DOM tree, how would you find this element in the second DOM tree?  
  4. Twitter question – Can you write a function that deeply flattens an array?  
  5. Netflix question – Given a picture, how would you hide/show a child’s picture hovering on this parent?  
  6. LinkedIn question – How would you ensure clicking on a picture would go to a specific link? How would you ensure the child is positioned in the top right of the parent picture?  
  7. Microsoft question – If you were building a search tool and wanted search results to pop up as you typed but the server call was taxing, write a function that gets called on every key down but calls the server when the user stops typing for 400ms.  
  8. Google question – Given an input array and another array that describes a new index for each element, mutate the input array so that each element ends up in their new index. Discuss the runtime of the algorithm and how you can be sure there won’t be infinite loops.  
  9. Facebook question – In JavaScript, write a function that takes an array as input that can contain both ints and more arrays (which can also contain an array or int) and return the flattened array.
  10. Google question – How do you make a function that only calls input function f every 50 milliseconds?  
  11. Twitter question – How do you make a function that takes f and returns a function that calls f on a timeout?  
  12. Airbnb question – Write a function reveal() that outputs the number of tiles shown when a user clicks on a tile. Each tile shows the number of bombs as its neighbor. If the user clicks on a tile that is a bomb, the game is over. If that tile is 0, reveal all its neighbors. 
  13. Microsoft question – Describe what happens when a user clicks a link in a browser.  
  14. Netflix question – Design a webpage which can auto-post new posts when you reach the bottom of the page by using JavaScript. 
  15. Google question – Write the code to find the balance point of the array.
  16. IBM question – Describe your experience developing AI applications.  
  17. Groupon question – Implement a to-do list’s delete method on a website.
  18. eBay question – What is the difference between null and undefined?
  19. Facebook question – Are Javascript and JScript the same? Are Typescript and Javascript the same?
  20. Airbnb question – Name some of the Javascript frameworks.
  21. Twitter question – Explain the typeof operator.
  22. IBM question – What are anonymous functions in Javascript? What is the difference between an anonymous function and a named function?
  23. Google question – What are self executing functions?
  24. Uber question – What is a function callback?
  25. eBay question – What happens when the recursion calling is applied to two functions?
  26. Netflix question – Explain the term: closure.
  27. Facebook question – Explain the terms: synchronous and asynchronous code.
  28. Microsoft question – How do you add an element at the beginning of an array? How do you add one at the end?
  29. IBM question – What is Ajax? What are the disadvantages of Ajax? Which are the two methods used for cross domain Ajax calls?
  30. AMD question – Differentiate between == and === 
  31. Groupon question – What is JSON?
  32. Fiserv question – What is the significance of, and reason for, wrapping the entire content of a JavaScript source file in a function block?
  33. Twitter question – What is the significance, and what are the benefits, of including ‘use strict’ at the beginning of a JavaScript source file?
  34. Facebook question – What is NaN? What is its type? How can you reliably test if a value is equal to NaN?
  35. Airbnb question – What will the code below output? Explain your answer.
    1. console.log(0.1 + 0.2);
    2. console.log(0.1 + 0.2 == 0.3);
  36. LinkedIn question – Discuss possible ways to write a function isInteger(x) that determines if x is an integer.
  37. Microsoft question – Write a simple function (less than 160 characters) that returns a boolean indicating whether or not a string is a palindrome.
  38. Google question – What is the difference between textContent and innerText?
  39. Uber question – What is the difference between HTMLCollection and NodeList?
  40. Netflix question – How can an HTMLCollection be traversed?
  41. Fiserv question – What is the difference between childNode and children?
  42. Twitter question – What is the difference between firstChild and firstElementChild?
  43. Facebook question – Name the two functions that are used to create an HTML element dynamically.
  44. Netflix question – What is the difference between remove() and removeChild()?
  45. Fiserv question – What is an event bubbling in Javascript?
  46. Twitter question – Implement an autocomplete system: given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix.
  47. Microsoft question – You run an e-commerce website and want to record the last N order ids in a log. Implement a data structure to accomplish this, with the following API:
    1. record(order_id): adds the order_id to the log
    2. get_last(i): gets the ith last element from the log. i is guaranteed to be smaller than or equal to N. You should be as efficient with time and space as possible.
  48. LinkedIn question – How can we include jQuery library in ASP.Net project?
  49. Uber question – In what scenarios jQuery can be used?
  50. Airbnb question – What is the difference between find and children methods?
  51. Groupon question – What is jQuery connect?
  52. Facebook question – How do you use connect?
  53. Google question – What are the features of jQuery that has been used in web applications?
  54. eBay question – What are the browser related issues for jQuery?
  55. Facebook question – How many times would `addEventListener(‘scroll’, handleScroll);` run as the user looks at their news feed? And what would be user experience if the `handleScroll` function takes 100ms to execute.  Do we need to add a jQuery file in both the master and content page?
  56. Twitter question – What are the basic selectors in jQuery?
  57. Dessault Systemes question – What is the use of the jQuery.data method?
  58. Groupon question – What is the use of each function in jQuery?
  59. Netflix question – What is the difference between size and length of jQuery?
  60. Google question – Can we add more than one ‘document.ready’ function to a page?
  61. Microsoft question – What is the use of jQuery load method?
  62. Airbnb question – What are the 4 parameters used for the jQuery Ajax method?
  63. Facebook question – Why are jQuery filters used?
  64. Dessault Systemes question – Which testing libraries would you use to test jQuery functions?

Once you have mastered the technical questions that come up in the interviews, you should spend time readying yourself so you are confident and successful. Our mentors work with candidates every day who have the right hard skills, but struggle with the soft skills needed to impress the interviewer. Use these tips to help you as you prepare.

  • Don’t jump right in, ask questions first

You might feel like you need to start coding as soon as you get the problem in front of you, but we recommend taking 15-30 seconds to read through fully and ask some questions that can help make sure you are on the right track. “Are repetitions allowed?” or “Do you want to return permutations or combinations?” are good examples of these types of clarifying questions.

  • Proactively show what you know

As you work, give the interviewer quick tidbits of information so they can get a sense of your breadth of knowledge. While it might take a little bit of time away from coding, it greatly reduces potentially uncomfortable silences, especially in times when you are thinking and not actively working.

  • Give context on your decisions

Similarly, you should be walking the interviewer through your decisions and explain why you are doing what you are doing. Providing the reasoning behind your choices will give them more insight into your thought process, which can be especially beneficial if you have made a mistake in your work.

  • Ask collaborative questions to get guidance

While you work, you might find that you are hitting a wall. You can take this moment to bring your interviewer into your issue. Just try to avoid using the word “hint.” Instead, make collaborative statements like “my assumptions are X and Y, I’m thinking of doing Z. But I’m struggling with solving [problem].” You can also try questions like,

  • I was wondering if you had any thoughts.
  • Do you think I’m going down the right direction?
  • Do you think my assumptions are incorrect?

With these questions & tips in your back pocket, you should be more than prepared for your next technical onsite interview. Feel like you need more help? Check out these resources to practice more software engineering interview questions.

You can also check out our other interview question lists:

Pathrise is a career accelerator that works with students and professionals 1-on-1 so they can land their dream job in tech. With these tips and guidance, fellows have seen their interview scores double.

If you want to work with any of our mentors 1-on-1 to get help with your software engineer interviews or with any other aspect of the job search, become a Pathrise fellow.

Apply today

Pathrise logo

Leave a Reply

Your email address will not be published. Required fields are marked *