JavaScript
23 questions · 5 output questions · 7 challenges · 3 mocks
Fundamentals
Type coercion
What is type coercion in JavaScript and when does it happen?
Equality: == vs ===
What is the difference between `==` and `===`?
null vs undefined
What is the difference between `null` and `undefined`?
Data types
What are the data types in JavaScript and how are they classified?
var, let and const
What is the difference between `var`, `let` and `const`?
Scope & Hoisting
Functions
Arrays & Objects
Destructuring
What is destructuring and how is it used with arrays and objects?
map, filter, and reduce
What is the difference between `map`, `filter`, and `reduce`?
Object methods
How do you iterate over an object's properties and which methods would you use? Explain `Object.keys`, `Object.values`, and `Object.entries`.
Shallow copy vs Deep copy
What is the difference between a shallow copy and a deep copy?
Spread and Rest
What is the difference between the spread operator and the rest operator? Both use `...`.
Asynchrony
async / await
What are `async` and `await`, and what advantage do they have over promises with `.then()`?
Event Loop
What is the event loop and how does JavaScript handle asynchronous code with a single thread?
Promises
What is a Promise and what are its states?
setTimeout
How does `setTimeout` work and why isn't the delay you pass it exact?
Synchronous vs Asynchronous
What is the difference between synchronous and asynchronous code in JavaScript?
Coding challenges
count how many times each character appears in a string.
javascript
FizzBuzz (the interview classic).
javascript
flatten a nested array (turn the nested levels into a single level).
javascript
find the largest number in an array.
javascript
determine whether a string is a palindrome.
javascript
remove duplicate numbers from an array.
javascript
reverse a string (flip the text around).
javascript
What does this code print?
What does it print? #001
typeof null, == vs ===, coercion.
What does it print? #002
var inside setTimeout, closures, scope.
What does it print? #003
hoisting of var and functions.
What does it print? #004
Promises vs setTimeout, event loop, microtasks vs macrotasks.
What does it print? #005
arrays and references, objects and mutability, copy by reference.