Frontend Interview: 15 In-Depth Questions

Every question dissected into three layers: Plain Answer → Follow-up Logic → Quantified High-Score Sample.

How AI interview works
15 real questions·3 categories·Interviewer follow-up logic per question

Questions reflect common real-world prompts. The three answer layers are illustrative examples, not real interview transcripts.

15 questionsClick a question to expand the 3 layers

① Common plain answer

"JS is single-threaded. Synchronous code runs first, async tasks are queued, and they execute once synchronous tasks finish."

Why it falls short: Textbook definition without microtask vs macrotask execution order or real engineering edge cases. The interviewer cannot judge whether you have handled real concurrency issues.

② Interviewer follow-up logic

Which runs first: setTimeout with 0ms delay or Promise.then?Does the browser render before the microtask queue is fully cleared?Tell me about an Event Loop pitfall you hit in a production app.

③ Quantified high-score answer

Mechanistically, JavaScript's Event Loop orchestrates single-threaded concurrency across three strict phases: executing the current synchronous stack, fully draining the microtask queue (Promise callbacks and queueMicrotask), and dequeuing exactly one macrotask from the task queue (setTimeout, setInterval, or I/O) before evaluating browser rendering pipelines. Consequently, Promise.then microtasks always execute before any 0ms setTimeout macrotask. In our enterprise dashboard, a bulk status update across 250 data records was triggering synchronous layout thrashing, locking the main thread for 3.4 seconds and causing noticeable frame drops. By refactoring the pipeline to partition records into 25-item chunks scheduled via queueMicrotask and synchronizing state flushes with requestAnimationFrame, we reduced main-thread blocking down to 320 milliseconds—a 90.6% reduction in Total Blocking Time (TBT). Because uncontrolled microtasks starve the rendering engine, we enforced a strict recursion limit of 4 iterations before deliberately yielding execution back to the macrotask queue.

Finished the breakdown? Try a realistic mock interview

Start a round without signing up. Experience in-depth follow-up questions and surface your real project highlights.

Create free account

No credit card required · Free 600 credits on signup