Scope & Closures interview questions

18 real Scope & Closures questions from the JavaScript bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is Closure?

Mid
  1. A.var declarations are moved to the top of their function scope and initialized to undefined
  2. B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.the region a let or const binding is visible in — the nearest enclosing curly-brace block
  4. D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Reveal the answer + AI explanation — free account

2. Which term means: "a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned"?

Mid
  1. A.Temporal dead zone
  2. B.Closure
  3. C.Lexical scoping
  4. D.Block scope
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Mid
  1. A.Closure — the region a let or const binding is visible in — the nearest enclosing curly-brace block
  2. B.Closure — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.Closure — an immediately invoked function expression used to create a private scope without leaking globals
  4. D.Closure — var declarations are moved to the top of their function scope and initialized to undefined
Reveal the answer + AI explanation — free account

4. What is Lexical scoping?

Mid
  1. A.an immediately invoked function expression used to create a private scope without leaking globals
  2. B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.the region a let or const binding is visible in — the nearest enclosing curly-brace block
  4. D.scope determined by where code is written in the source, not by where a function is called from
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.Lexical scoping — the span in which a let/const binding exists but throws if accessed before its declaration runs
  2. B.Lexical scoping — an immediately invoked function expression used to create a private scope without leaking globals
  3. C.Lexical scoping — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  4. D.Lexical scoping — scope determined by where code is written in the source, not by where a function is called from
Reveal the answer + AI explanation — free account

7. What is var hoisting?

Junior
  1. A.scope determined by where code is written in the source, not by where a function is called from
  2. B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.an immediately invoked function expression used to create a private scope without leaking globals
  4. D.var declarations are moved to the top of their function scope and initialized to undefined
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.var hoisting — the span in which a let/const binding exists but throws if accessed before its declaration runs
  2. B.var hoisting — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.var hoisting — var declarations are moved to the top of their function scope and initialized to undefined
  4. D.var hoisting — the region a let or const binding is visible in — the nearest enclosing curly-brace block
Reveal the answer + AI explanation — free account

10. What is Temporal dead zone?

Mid
  1. A.the region a let or const binding is visible in — the nearest enclosing curly-brace block
  2. B.an immediately invoked function expression used to create a private scope without leaking globals
  3. C.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  4. D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.Temporal dead zone — the span in which a let/const binding exists but throws if accessed before its declaration runs
  2. B.Temporal dead zone — var declarations are moved to the top of their function scope and initialized to undefined
  3. C.Temporal dead zone — the region a let or const binding is visible in — the nearest enclosing curly-brace block
  4. D.Temporal dead zone — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
Reveal the answer + AI explanation — free account

13. What is Block scope?

Junior
  1. A.the region a let or const binding is visible in — the nearest enclosing curly-brace block
  2. B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
  3. C.var declarations are moved to the top of their function scope and initialized to undefined
  4. D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Junior
  1. A.Block scope — var declarations are moved to the top of their function scope and initialized to undefined
  2. B.Block scope — the region a let or const binding is visible in — the nearest enclosing curly-brace block
  3. C.Block scope — an immediately invoked function expression used to create a private scope without leaking globals
  4. D.Block scope — scope determined by where code is written in the source, not by where a function is called from
Reveal the answer + AI explanation — free account

16. What is IIFE?

Mid
  1. A.an immediately invoked function expression used to create a private scope without leaking globals
  2. B.scope determined by where code is written in the source, not by where a function is called from
  3. C.var declarations are moved to the top of their function scope and initialized to undefined
  4. D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.IIFE — the span in which a let/const binding exists but throws if accessed before its declaration runs
  2. B.IIFE — an immediately invoked function expression used to create a private scope without leaking globals
  3. C.IIFE — scope determined by where code is written in the source, not by where a function is called from
  4. D.IIFE — var declarations are moved to the top of their function scope and initialized to undefined
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Scope & Closures free