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
A.var declarations are moved to the top of their function scope and initialized to undefined
B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.the region a let or const binding is visible in — the nearest enclosing curly-brace block
D.the span in which a let/const binding exists but throws if accessed before its declaration runs
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"?
A.Lexical scoping — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.Lexical scoping — an immediately invoked function expression used to create a private scope without leaking globals
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
D.Lexical scoping — scope determined by where code is written in the source, not by where a function is called from
A.var hoisting — the span in which a let/const binding exists but throws if accessed before its declaration runs
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
C.var hoisting — var declarations are moved to the top of their function scope and initialized to undefined
D.var hoisting — the region a let or const binding is visible in — the nearest enclosing curly-brace block
A.Temporal dead zone — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.Temporal dead zone — var declarations are moved to the top of their function scope and initialized to undefined
C.Temporal dead zone — the region a let or const binding is visible in — the nearest enclosing curly-brace block
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
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.