explaingit

rohan-paul/javascript-tricky-interview-questions

Analysis updated 2026-07-11 · repo last pushed 2020-10-08

7JavaScriptAudience · developerComplexity · 1/5DormantSetup · easy

TLDR

A collection of JavaScript interview questions and worked solutions, focusing on tricky concepts like closures and setTimeout so you understand the underlying ideas rather than just memorizing answers.

Mindmap

mindmap
  root((repo))
    What it does
      Interview question drills
      Closures explained
      setTimeout pitfalls
      Private variables
    Tech stack
      JavaScript
      Markdown
    Use cases
      Prep for interviews
      Learn closures
      Practice tricky problems
    Audience
      Job seekers
      Beginners
      Self learners
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Drill common JavaScript interview questions before a job interview.

USE CASE 2

Understand how closures and setTimeout interact through worked code examples.

USE CASE 3

Learn how to create private variables in JavaScript without using classes.

USE CASE 4

Review concise study notes on specific tricky JavaScript concepts.

What is it built with?

JavaScriptMarkdown

How does it compare?

rohan-paul/javascript-tricky-interview-questionsboneskull/promwrapjoshuakgoldberg/github-username-to-emails-site
Stars777
LanguageJavaScriptJavaScriptJavaScript
Last pushed2020-10-082020-07-212026-07-03
MaintenanceDormantDormantActive
Setup difficultyeasyeasyeasy
Complexity1/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

No setup needed, just read the markdown and JavaScript files directly in the repo.

In plain English

This repository is a study guide for JavaScript developer interviews. It collects tricky interview questions and walks through how to solve them, with a focus on making sure you actually understand the underlying concepts rather than just memorizing the right answer. The content is organized around specific JavaScript topics, with each file covering a particular question or concept. Based on what's included, the current focus is on closures, which are one of the more confusing parts of JavaScript. Each file contains either code examples with explanations or markdown notes breaking down how a concept works. For instance, there are multiple files addressing the classic interview question about how setTimeout interacts with closures, since that combination trips a lot of people up. This is designed for job seekers preparing for full-stack JavaScript interviews, particularly those going through the process for the first time. If you've ever been in an interview and gotten a question about why a loop with setTimeout doesn't behave the way you'd expect, or how to create private variables in JavaScript without classes, this kind of resource helps you work through those specific scenarios ahead of time. The project was built as a personal preparation tool, so it reads more like someone's study notes than a polished tutorial. It's a smaller collection at this point, but the tradeoff is that each example goes straight into a specific, commonly asked question rather than giving you broad theoretical background. You'd use it alongside other resources if you want deeper coverage, but it's useful for drilling the exact types of problems that tend to come up in interviews.

Copy-paste prompts

Prompt 1
Walk me through why a for loop with setTimeout doesn't print the expected numbers, using closures to explain the behavior step by step.
Prompt 2
Show me how to create private variables in JavaScript without classes, and explain why this pattern works using closures.
Prompt 3
Give me three tricky JavaScript closure interview questions similar to the setTimeout-in-a-loop problem and walk me through each solution.
Prompt 4
Explain the difference between how setTimeout captures variables in a loop versus using let, and show code examples of both.

Frequently asked questions

What is javascript-tricky-interview-questions?

A collection of JavaScript interview questions and worked solutions, focusing on tricky concepts like closures and setTimeout so you understand the underlying ideas rather than just memorizing answers.

What language is javascript-tricky-interview-questions written in?

Mainly JavaScript. The stack also includes JavaScript, Markdown.

Is javascript-tricky-interview-questions actively maintained?

Dormant — no commits in 2+ years (last push 2020-10-08).

How hard is javascript-tricky-interview-questions to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is javascript-tricky-interview-questions for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.