Interviewers are asking this type of question to really test your knowledge of important JavaScript concepts. By answering this question correctly, you can display your understanding of block scope, closures, anon functions, and Immediately Invoked Function Expressions (IIFE).
Full article