A Tricky JavaScript Interview Question Asked by Google and Amazon

Daniel Borowski
Oct 10, 2017 · 2 min read

Why is this question so popular?

A user on reddit mentioned that they were asked this question in an Amazon developer interview. I’ve also been asked this type of closure + loop question in interviews myself — even in a Google interview.

A solid understanding of functional/block scope, anonymous functions, closures, and IIFE’s will definitely make you a better JavaScript developer and help you out in future interviews.

Solutions

I’ve actually covered this question and some solutions in previous posts:


Tech x Talent

Insights at the intersection of tech and talent.

Daniel Borowski

Written by

Tech x Talent

Insights at the intersection of tech and talent.