Scope & Closures interview questions

18 Scope & Closures questions from the JavaScript bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Sign up free to see every answer with its explanation and ask the AI tutor.

Practice Scope & Closures free

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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

5. Which term means: "scope determined by where code is written in the source, not by where a function is called from"?

Mid
  1. A.Lexical scoping
  2. B.Block scope
  3. C.var hoisting
  4. D.Temporal dead zone

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

8. Which term means: "var declarations are moved to the top of their function scope and initialized to undefined"?

Junior
  1. A.Temporal dead zone
  2. B.IIFE
  3. C.Block scope
  4. D.var hoisting

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

11. Which term means: "the span in which a let/const binding exists but throws if accessed before its declaration runs"?

Mid
  1. A.Temporal dead zone
  2. B.var hoisting
  3. C.Block scope
  4. D.Closure

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

14. Which term means: "the region a let or const binding is visible in — the nearest enclosing curly-brace block"?

Junior
  1. A.Block scope
  2. B.var hoisting
  3. C.Closure
  4. D.Temporal dead zone

Answer + AI explanation with a 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

Answer + AI explanation with a 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

Answer + AI explanation with a free account

17. Which term means: "an immediately invoked function expression used to create a private scope without leaking globals"?

Mid
  1. A.Temporal dead zone
  2. B.IIFE
  3. C.var hoisting
  4. D.Lexical scoping

Answer + AI explanation with a 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

Answer + AI explanation with a free account

Free to start

Answers, AI explanations, and a free readiness check

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take the free 2-minute readiness check for a scored result. One full AI mock interview, scored like a real panel, is free when you sign up.

Practice Scope & Closures free
24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers