PUBLIC QUESTION PREVIEW
JavaScript / TypeScript interview questions
Closures, promises, prototypes, event loop, TypeScript — JS inside-out.
Showing 12 of 50 source questions. Sample answers are study material, not employer-specific hiring guidance.
How to work through this preview
Attempt each question before reading its answer. For a concept, give a definition and a concrete example. For code, state constraints, walk through a small input, and check complexity. For design, separate requirements from assumptions and explain failure handling. Use real situations for behavioral answers.
QUESTION 1 / easy / conceptual
What is a closure in JavaScript? Give a practical use case.
Sample answer
Hints to guide your next attempt
- A function that "remembers" its outer scope even after that scope has finished executing
Source tags: closure / scope / javascript
QUESTION 2 / medium / conceptual
Explain the JavaScript event loop. What is the call stack, task queue, and microtask queue?
Sample answer
Hints to guide your next attempt
- Microtasks (Promises) run before macrotasks (setTimeout)
- Event loop processes queues when the call stack is empty
Source tags: event-loop / promises / async / call-stack / javascript
QUESTION 3 / easy / conceptual
What is the difference between == and === in JavaScript? When does type coercion bite you?
Supplied choices
- true — both check value and type
- false — === checks value only, == checks value and type
- false — == does type coercion first, === checks value AND type strictly
- true — they are identical except == is faster
Source answer choice: C. false — == does type coercion first, === checks value AND type strictly
Sample answer
Hints to guide your next attempt
- == does type coercion, === does not
- null == undefined is true with ==
Source tags: equality / type-coercion / javascript
QUESTION 4 / medium / conceptual
What is "this" in JavaScript? How does it behave in arrow functions vs regular functions?
Sample answer
Hints to guide your next attempt
- Regular function: this is determined at call time
- Arrow function: this is lexically bound at definition time
Source tags: this / arrow-function / context / javascript
QUESTION 5 / medium / conceptual
What is Promise.all vs Promise.allSettled vs Promise.race?
Sample answer
Hints to guide your next attempt
- Think about what happens when one promise rejects
- Race vs all — which resolves first wins vs all must resolve
Source tags: promises / async / javascript / concurrency
QUESTION 6 / easy / conceptual
What is the difference between var, let, and const? Explain hoisting.
Sample answer
Hints to guide your next attempt
- var is function-scoped, let/const are block-scoped
- Hoisting moves declarations to the top — but not initializations
Source tags: var / let / const / hoisting / scope / javascript
QUESTION 7 / medium / conceptual
How does the JavaScript prototype chain work? What happens when you access a property on an object?
Sample answer
Hints to guide your next attempt
- Every object has a [[Prototype]] internal slot
- Property lookup walks up the chain until null
Source tags: prototype / prototype-chain / inheritance / javascript
QUESTION 8 / medium / conceptual
Explain Object.create(). How do you implement inheritance without using the class keyword?
Sample answer
Hints to guide your next attempt
- Object.create(proto) creates a new object whose [[Prototype]] is proto
- Useful for pure prototype-based inheritance
Source tags: object-create / prototype / inheritance / javascript
QUESTION 9 / medium / conceptual
Explain ES6 class syntax. Is it true syntactic sugar over prototypes? What are static methods and private fields?
Sample answer
Hints to guide your next attempt
- class is syntactic sugar but with some new semantics (like TDZ for class declarations)
- static methods live on the constructor, not the prototype
Source tags: class / extends / static / private-fields / javascript
QUESTION 10 / medium / conceptual
What is the difference between call(), apply(), and bind()? When would you use each?
Sample answer
Hints to guide your next attempt
- All three let you control what "this" is
- bind returns a new function; call and apply invoke immediately
Source tags: call / apply / bind / this / javascript
QUESTION 11 / easy / conceptual
What is an IIFE? Why was it used and when is it still relevant?
Sample answer
Hints to guide your next attempt
- Immediately Invoked Function Expression
- Creates a private scope in pre-ES6 code
Source tags: iife / scope / module-pattern / javascript
QUESTION 12 / hard / coding
What is currying in JavaScript? Implement a curry() function.
Sample answer
Hints to guide your next attempt
- Currying transforms f(a, b, c) into f(a)(b)(c)
- Use function.length to know how many args are expected
Source tags: currying / partial-application / functional / javascript
Check understanding, not recognition
- Can you explain the answer without reading it?
- Can you show when the approach fails or needs a different assumption?
- Can you connect the concept to a real project, task, or decision you have made?
- Can you distinguish a simplified interview example from a production requirement?
A LITTLE MORE CLARITY
Frequently asked questions
How many JavaScript / TypeScript questions are shown here?
This public preview shows 12 questions with the supplied answers from the app's 50-question JavaScript / TypeScript bank. Full interactive practice requires signing in.
Should I memorize the sample answers?
Use them as reference explanations, not a script or a guarantee of technical correctness for every environment. Explain your assumptions, validate code against your language and version, and discuss trade-offs. Behavioral answers should be built from your own experience.
What do hints and solution steps mean?
Hints identify ideas to consider before reading the answer. When the source question includes steps, they are shown as a separate walkthrough. Example capacities and design targets in a solution are assumptions for that exercise, not real system statistics.
BUILD YOUR NEXT OPPORTUNITY
Practice JavaScript / TypeScript actively.
Sign in to use the full topic bank and interactive practice workspace.