FullStackFSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Kill Your Tech Interview
3877 Full-Stack, Algorithms & System Design Interview Questions
Answered To Get Your Next Six-Figure Job Offer
      
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Top 179 JavaScript Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Topic Progress:

Theoretical Questions

Q1:   

What is the object type?

  
Add to PDF   Entry 
Q2:   

What is typeof operator?

  
Add to PDF   Entry 
Q3:   

Explain arrays in JavaScript

  
Add to PDF   Entry 
Q4:   

Explain equality in JavaScript

  
Add to PDF   Entry 
Q5:   

What is Scope in JavaScript?

  
Add to PDF   Entry 
Q6:   

What's the difference between Host objects and Native objects?

  
Add to PDF   Junior 
Q7:   

What's the difference between throw Error('msg') vs throw new Error('msg')?

  
Add to PDF   Junior 
Q8:   

Explain the same-origin policy with regards to JavaScript.

  
Add to PDF   Junior 
Q9:   

What is the difference between == and ===?

  
Add to PDF   Junior 
Q10:   

Is there anyway to force using strict mode in Node.js?

  
Add to PDF   Junior 
Q11:   

Why would you use something like the load event? Does this event have disadvantages? Do you know any alternatives, and why would you use those?

  
Add to PDF   Junior 
Q12:   

What is strict mode?

  
Add to PDF   Junior 
Q13:   

What is Callback Hell and what is the main cause of it?

  Related To: Node.js
Add to PDF   Junior 
Q14:   

What does use strict do?

  
Add to PDF   Junior 
Q15:   

Explain event bubbling and how one may prevent it

  
Add to PDF   Junior 
Q16:   

What are some of the advantages/disadvantages of writing JavaScript code in a language that compiles to JavaScript?

  
Add to PDF   Junior 
Q17:   

What language constructions do you use for iterating over object properties and array items?

  
Add to PDF   Junior 
Q18:   

Explain Values and Types in JavaScript

  
Add to PDF   Junior 
Q19:   

Explain Null and Undefined in JavaScript

  
Add to PDF   Junior 
Q20:   

Explain what is Linear (Sequential) Search and when may we use one?

 JSPY Related To: Searching, Python
Add to PDF   Junior 
Q21:   

Why is it, in general, a good idea to leave the global scope of a website as-is and never touch it?

  
Add to PDF   Junior 
Q22:   

What is let keyword in JavaScript?

  
Add to PDF   Junior 
Q23:   

Explain what is Binary Search

 JSJavaPY Related To: Searching, Java
Add to PDF   Junior 
Q24:   

What is a Polyfill?

  
Add to PDF   Junior 
Q25:   

What is the motivation for bringing Symbol to ES6?

  
 Add to PDF   Mid 
Q26:   

What's the difference between using let and var to declare a variable in ES6?

  
 Add to PDF   Mid 
Q27:   

What is generator in JS?

  
 Add to PDF   Mid 
Q28:   

Why is extending built-in JavaScript objects not a good idea?

  
 Add to PDF   Mid 
Q29:   

What advantages are using arrow functions?

  
 Add to PDF   Mid 
Q30:   

What are the advantages and disadvantages of using use strict?

  
 Add to PDF   Mid 
Q31:   

When should we use generators in ES6?

  
 Add to PDF   Mid 
Q32:   

How to compare two objects in JavaScript?

  
 Add to PDF   Mid 
Q33:   

What will be the output of the following code?

  
 Add to PDF   Mid 
Q34:   

What is a closure, and how/why would you use one?

  
 Add to PDF   Mid 
Q35:   

What's a typical use case for anonymous functions?

  
 Add to PDF   Mid 
Q36:   

What will be the output of the following code?

  
 Add to PDF   Mid 
Q37:   

Suggest one simple way of removing duplicates from an array using ES6

  
 Add to PDF   Mid 
Q38:   

What is the difference between Anonymous and Named functions?

  
 Add to PDF   Mid 
Q39:   

Explain the difference between Object.freeze() vs const

  
 Add to PDF   Mid 
Q40:   

Why should we use ES6 classes?

  
 Add to PDF   Mid 
Q41:   

What are the differences between ES6 class and ES5 function constructors?

  
 Add to PDF   Mid 
Q42:   

What is Currying?

  
 Add to PDF   Mid 
Q43:   

What is the difference between document load event and document DOMContentLoaded event?

  
 Add to PDF   Mid 
Q44:   

What is the difference between a shim and a polyfill?

  
 Add to PDF   Mid 
Q45:   

What do you think of AMD vs CommonJS?

  
 Add to PDF   Mid 
Q46:   

What is the definition of a Higher-Order Function?

  
 Add to PDF   Mid 
Q47:   

What is a Jump (or Block) Search?

 JSJavaPY Related To: Searching, Python
 Add to PDF   Mid 
Q48:   

Explain the difference between undefined and not defined in JavaScript

  
 Add to PDF   Mid 
Q49:   

What is Coercion in JavaScript?

  
 Add to PDF   Mid 
Q50:   

What is IIFEs (Immediately Invoked Function Expressions)?

  
 Add to PDF   Mid 
Q51:   

Explain what is Interpolation Search

 JSPY Related To: Searching, Python
 Add to PDF   Mid 
Q52:   

What is export default in JavaScript?

  Related To: Node.js
 Add to PDF   Mid 
Q53:   

When should I use Arrow Functions in ES6?

  
 Add to PDF   Mid 
Q54:   

What are the benefits of using spread syntax in ES6 and how is it different from rest syntax?

  
 Add to PDF   Mid 
Q55:   

Explain Function.prototype.bind.

  
 Add to PDF   Mid 
Q56:   

Could you explain the difference between ES5 and ES6

  
 Add to PDF   Mid 
Q57:   

Describe Closure concept in JavaScript as best as you could

  
 Add to PDF   Mid 
Q58:   

What is the preferred syntax for defining enums in JavaScript?

  
 Add to PDF   Mid 
Q59:   

What's the difference between .call and .apply?

  
 Add to PDF   Mid 
Q60:   

What is the drawback of creating true private in JavaScript?

  
 Add to PDF   Mid 
Q61:   

Explain the differences on the usage of foo between function foo() {} and var foo = function() {}

  
 Add to PDF   Mid 
Q62:   

Does JavaScript have a map function to iterate over an object properties?

  Related To: Node.js
 Add to PDF   Senior 
Q63:   

How would you prevent Callback Hell without using promises, async or generators?

  Related To: Node.js
 Add to PDF   Senior 
Q64:   

Explain how JSONP works (and how it's not really Ajax)

  
 Add to PDF   Senior 
Q65:   

Could you compare usage of Module Pattern vs Constructor/Prototype pattern?

  
 Add to PDF   Senior 
Q66:   

When would you use import * as X from 'X' ?

  Related To: Node.js
 Add to PDF   Senior 
Q67:   

What tools can be used to assure consistent code style?

  
 Add to PDF   Senior 
Q68:   

What is the Temporal Dead Zone in ES6?

  
 Add to PDF   Senior 
Q69:   

Explain Prototype Inheritance in JavaScript?

  
 Add to PDF   Senior 
Q70:   

Explain what is Hoisting in Javascript

  
 Add to PDF   Senior 
Q71:   

What's the difference between a variable that is: null, undefined or undeclared? How would you go about checking for any of these states?

  
 Add to PDF   Senior 
Q72:   

Describe the JS module design pattern

  
 Add to PDF   Senior 
Q73:   

Explain the Prototype Design Pattern

  
 Add to PDF   Senior 
Q74:   

Can you give an example for destructuring an object or an array in ES6?

  
 Add to PDF   Senior 
Q75:   

What does the term Transpiling stand for?

  
 Add to PDF   Senior 
Q76:   

Can you describe the main difference between a .forEach loop and a .map() loop and why you would pick one versus the other?

  
 Add to PDF   Senior 
Q77:   

What is the new keyword in JavaScript?

  
 Add to PDF   Senior 
Q78:   

When should you NOT use arrow functions in ES6? Name three or more cases.

  
 Add to PDF   Senior 
Q79:   

Check if a given string is a isomorphic

  
 Add to PDF   Senior 
Q80:   

Explain difference between: function Person(){}, var person = Person(), and var person = new Person()?

  
 Add to PDF   Senior 
Q81:   

What is Hoisting in JavaScript?

  
 Add to PDF   Senior 
Q82:   

What are the actual uses of ES6 WeakMap?

  
 Add to PDF   Senior 
Q83:   

How can you share code between files?

  
 Add to PDF   Senior 
Q84:   

Can you give an example of a curry function and why this syntax offers an advantage?

  
 Add to PDF   Expert 
Q85:   

In JavaScript, why is the this operator inconsistent?

  
 Add to PDF   Expert 
Q86:   

Does JavaScript pass by references or pass by values?

  Related To: Node.js
 Add to PDF   Expert 
Q87:   

Is JavaScript a pass-by-reference or pass-by-value language?

  
 Add to PDF   Expert 
Q88:   

Is it possible to reset an ECMAScript 6 generator to its initial state?

  
 Add to PDF   Expert 
Q89:   

What's the difference between ES6 Map and WeakMap?

  
 Add to PDF   Expert 
Q90:   

How to deep-freeze object in JavaScript?

  
 Add to PDF   Expert 
Q91:   

Compare Async/Await and Generators usage to achive same functionality

  
 Add to PDF   Expert 
Q92:   

What is the difference between the await keyword and the yield keyword?

  
 Add to PDF   Expert 

Code Challenges

Q1:   

Sum of Array Plus One

  
 Add to PDF   Entry 
Q2:   

Lucky sevens

  
 Add to PDF   Entry 
Q3:   

Explain how Bubble Sort works

 JSPY Related To: Sorting
 Add to PDF   Entry 
Q4:   

String Rotation

  
 Add to PDF   Entry 
Q5:   

Oddball sum

  
 Add to PDF   Entry 
Q6:   

Test divisors of three

  
 Add to PDF   Entry 
Q7:   

Sum of several arrays

  
 Add to PDF   Entry 
Q8:   

Simple clock angle

  
 Add to PDF   Entry 
Q9:   

Implement a Queue using two Stacks

 CSJSJavaPY Related To: Queues, Stacks, Java, C#
 Add to PDF   Junior 
Q10:   

Tree Level Order Print

  
 Add to PDF   Junior 
Q11:   

Stock maximum profit

  
 Add to PDF   Junior 
Q12:   

Make this work

  
 Add to PDF   Junior 
Q13:   

Two sum problem

  
 Add to PDF   Junior 
Q14:   

Given a string, reverse each word in the sentence

  
 Add to PDF   Junior 
Q15:   

How to empty an array in JavaScript?

  
 Add to PDF   Junior 
Q16:   

Explain what a callback function is and provide a simple example

  
 Add to PDF   Junior 
Q17:   

Determine overlapping numbers in ranges

  
 Add to PDF   Junior 
Q18:   

Write a "mul" function which will properly when invoked as below syntax

  
 Add to PDF   Junior 
Q19:   

Implement enqueue and dequeue using only two stacks

  
 Add to PDF   Junior 
Q20:   

How to check if an object is an array or not? Provide some code.

  
 Add to PDF   Junior 
Q21:   

Write a function that would allow you to do this?

  
 Add to PDF   Junior 
Q22:   

Find the missing number in O(n) time

  
 Add to PDF   Junior 
Q23:   

Step-by-step solution for step counting using recursion

  
 Add to PDF   Junior 
Q24:   

How would you check if a number is an integer?

  
 Add to PDF   Junior 
Q25:   

Return the N-th value of the Fibonacci sequence. Solve in O(n) time

 JSJavaPY Related To: Fibonacci Series, Data Structures, Python
 Add to PDF   Junior 
Q26:   

Implement Bubble Sort

  
 Add to PDF   Junior 
Q27:   

Return the N-th value of the Fibonacci sequence Recursively

 JSJavaPY Related To: Fibonacci Series, Data Structures, Java
 Add to PDF   Junior 
Q28:   

Remove duplicates of an array and return an array of only unique elements

  
 Add to PDF   Junior 
Q29:   

Explain how Insertion Sort works

 JSJavaPY Related To: Sorting, Python
 Add to PDF   Junior 
Q30:   

FizzBuzz Challenge

  
  Add to PDF   Mid 
Q31:   

Check if a given string is a palindrome. Case sensitivity should be taken into account.

  
  Add to PDF   Mid 
Q32:   

Find all string combinations consisting only of 0, 1 and ?

  
  Add to PDF   Mid 
Q33:   

Generate all balanced bracket combinations

  
  Add to PDF   Mid 
Q34:   

Write a recursive function that returns the binary string of a given decimal number

  
  Add to PDF   Mid 
Q35:   

Find the intersection of two arrays

  
  Add to PDF   Mid 
Q36:   

How would you use a closure to create a private counter?

  
  Add to PDF   Mid 
Q37:   

Given two strings, return true if they are anagrams of one another

  
  Add to PDF   Mid 
Q38:   

All Permutations (Anagrams) of a String

  
  Add to PDF   Mid 
Q39:   

Given an array of integers, find the largest difference between two elements such that the element of lesser value must come before the greater element

  
  Add to PDF   Mid 
Q40:   

Implement a queue using a linked list

  
  Add to PDF   Mid 
Q41:   

Check if parentheses are balanced using Stack

 JSJavaPY Related To: Stacks, Java, Python
  Add to PDF   Mid 
Q42:   

Quickly calculate the cube root of 6 digit numbers

  
  Add to PDF   Mid 
Q43:   

Find all the Permutations of a String

 JSJavaPY Related To: Backtracking, Strings, Data Structures, Java, Python
  Add to PDF   Mid 
Q44:   

Implement pow(a,b) without multiplication or division

  
  Add to PDF   Mid 
Q45:   

Write a program for Recursive Binary Search

 JSJavaPY Related To: Searching, Java, Python
  Add to PDF   Mid 
Q46:   

Provide some examples of non-bulean value coercion to a boolean one

  
  Add to PDF   Mid 
Q47:   

How to merge two sorted Arrays into a Sorted Array?

 JSJavaPY Related To: Arrays, Data Structures, Java, Python
  Add to PDF   Mid 
Q48:   

How would you read files in sequence in Node.js? Provide a code example

  Related To: Node.js
  Add to PDF   Mid 
Q49:   

LIS: Find length of the longest increasing subsequence (LIS) in the array. Solve using DP.

 JSJavaPY Related To: Dynamic Programming, Data Structures, Python
  Add to PDF   Mid 
Q50:   

Explain how Heap Sort works

 JSPY Related To: Heaps and Maps, Sorting, Data Structures
  Add to PDF   Mid 
Q51:   

Explain how Merge Sort works

 JSPY Related To: Divide & Conquer, Sorting
  Add to PDF   Mid 
Q52:   

Get the N-th Fibonacci number with O(n) time and O(1) space complexity

 JSPY Related To: Fibonacci Series
  Add to PDF   Mid 
Q53:   

Fix this code. Explain the fix.

  Related To: Node.js
  Add to PDF   Mid 
Q54:   

Insert an interval into a list of sorted disjoint intervals

  
  Add to PDF   Mid 
Q55:   

Implement a queue using two stacks

  
  Add to PDF   Mid 
Q56:   

What will be the output of the following code?

  
  Add to PDF   Mid 
Q57:   

Throttle Function Implementation

  
  Add to PDF   Mid 
Q58:   

Given an array of integers, find the largest product yielded from three of the integers

  
  Add to PDF   Mid 
Q59:   

Find Word Positions in Text

  
  Add to PDF   Mid 
Q60:   

Write a function that would allow you to do this

  
  Add to PDF   Mid 
Q61:   

Dutch national flag sorting problem

  
  Add to PDF   Mid 
Q62:   

Merge two sorted linked lists

  
  Add to PDF   Mid 
Q63:   

What will the following code output?

  
  Add to PDF   Mid 
Q64:   

Given an integer, determine if it is a power of 2. If so, return that number, else return -1

  
  Add to PDF   Senior 
Q65:   

Transform Word

  
  Add to PDF   Senior 
Q66:   

What is Closure in JavaScript? Provide an example

  
  Add to PDF   Senior 
Q67:   

How would you create a private variable in JavaScript?

  
  Add to PDF   Senior 
Q68:   

Create a function that will evaluate if a given expression has balanced parentheses using stacks

  
  Add to PDF   Senior 
Q69:   

When would you use the bind function?

  
  Add to PDF   Senior 
Q70:   

Write a recursive function that performs a binary search

  
  Add to PDF   Senior 
Q71:   

Explain when and how to use Exponential (aka Doubling or Galloping) Search?

 JSPY Related To: Searching
  Add to PDF   Senior 
Q72:   

Explain what is Fibonacci Search technique?

 CSJSJavaPY Related To: Divide & Conquer, Fibonacci Series, Searching, Data Structures, C#
  Add to PDF   Senior 
Q73:   

Calculate n-th Fibonacci number using Tail Recursion

 JSJava Related To: Fibonacci Series
  Add to PDF   Senior 
Q74:   

Explain how QuickSort works

 JSPY Related To: Divide & Conquer, Sorting, Data Structures
  Add to PDF   Senior 
Q75:   

Binet's formula: How to calculate Fibonacci numbers without Recursion or Iteration?

 CSJSJavaPY Related To: Fibonacci Series, Data Structures, C#
  Add to PDF   Senior 
Q76:   

Explain how Radix Sort works

 JSPY Related To: Sorting, Python
  Add to PDF   Senior 
Q77:   

How to recursively reverse a Linked List?

 JSJavaPY Related To: Linked Lists, Recursion
  Add to PDF   Senior 
Q78:   

How to use Memoization for N-th Fibonacci number?

 JSJava Related To: Dynamic Programming, Fibonacci Series, Recursion
  Add to PDF   Senior 
Q79:   

Explain why the following doesn't work as an IIFE. What needs to be changed to properly make it an IIFE?

  
  Add to PDF   Senior 
Q80:   

What will be the output of the following code?

  
  Add to PDF   Senior 
Q81:   

What will the following code output?

  
  Add to PDF   Senior 
Q82:   

What will be the output of the following code?

  
  Add to PDF   Senior 
Q83:   

How does the this keyword work? Provide some code examples

  
  Add to PDF   Senior 
Q84:   

How would you add your own method to the Array object so the following code would work?

  
  Add to PDF   Senior 
Q85:   

Generating Fibonacci Sequence using ES6 generator functions

 JS Related To: Fibonacci Series
  Add to PDF   Expert 
Q86:   

Copy a Linked List with Random (Arbitrary) Pointer using O(1) Space

 JSJavaPY Related To: Linked Lists
  Add to PDF   Expert 
Q87:   

Describe the Revealing Module Pattern design pattern

  
  Add to PDF   Expert 
 

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...
More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...
Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...
Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...
At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...
Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...