Member-only story

7 JavaScript Concepts for Interview Preparation

Revision Notes

XQ
The Research Nest
11 min readNov 14, 2024

--

Image created by me using Flux.1-dev

These are some of the most common topics appearing in various interview experiences for front-end engineering jobs. Let’s dissect them, one by one.

1. Event Loop & Asynchronous JavaScript

JavaScript runs on a single thread, meaning it can execute only one piece of code at a time. This can be limiting because if one task takes too long (like a large computation or file I/O), it blocks other code from running.

To avoid the same, asynchronous operations are used to keep the main thread responsive. Instead of waiting, async operations are handed off to the environment (browser or Node.js) to be processed in the background.

  1. When JavaScript code executes, it runs in the call stack — an internal structure that keeps track of what function is currently being executed.
  2. When an async operation (such as setTimeout, a network request, or file I/O) is called, it's handed off to the Web APIs (in the browser) or the Node APIs (in Node.js) to handle outside the main thread.
  3. Once these async tasks are handed off, JavaScript doesn’t wait. It continues executing other code.
  4. When the async task finishes, the Web API or Node API moves its callback (basically

--

--

XQ
XQ

Written by XQ

Exploring tech, life, and careers through content.

Responses (1)