Interview questions

Technical questions, answered clearly

Clear, interview-ready answers to common technical questions on JavaScript, React, SQL, system design, APIs, security, Docker and Kubernetes.

JavaScript

How does the JavaScript event loop work?

JavaScript runs your code on a single call stack. Asynchronous work such as timers, network requests and I/O is handled by the host environment, and its callbacks wait in queues. The event loop moves a callback onto the stack only when the stack is empty, always draining the microtask queue (promises) before taking the next macrotask (timers, events).

React

What are React hooks and what are the rules of hooks?

Hooks are functions that let function components use React features such as state (useState), side effects (useEffect), context (useContext) and refs (useRef). There are two rules: call hooks only at the top level of a component or custom hook — never inside loops, conditions or nested functions — and call them only from React function components or other hooks.

Databases & SQL

What are the different types of SQL joins?

An INNER JOIN returns rows with matches in both tables. A LEFT JOIN returns every row from the left table and matching rows from the right, filling gaps with NULL; a RIGHT JOIN is the mirror image. A FULL OUTER JOIN keeps unmatched rows from both sides, and a CROSS JOIN returns every combination of rows.

Databases & SQL

How do database indexes work and when should you add one?

An index is a separate data structure — usually a B-tree — that keeps selected column values sorted with pointers to rows, so the database can find matches without scanning the whole table. Indexes speed up reads, filters, joins and sorting, but they use storage and slow down inserts and updates because every index must be maintained.

System Design

What is the CAP theorem?

The CAP theorem says that when a network partition occurs, a distributed data store must choose between consistency — every read sees the latest write — and availability — every request gets a non-error response. Partition tolerance is not optional in real networks, so the practical choice is CP or AP behaviour during a partition.

System Design

Microservices vs monolith: how do you choose?

A monolith deploys the application as one unit: simple to build, test and run, and usually the right start. Microservices split it into independently deployable services owned by separate teams, which helps scaling organisations and uneven workloads but adds network calls, distributed data, observability and operational complexity. Choose based on team structure and scaling pain, not trends.

Walk into your next interview prepared

Start free, install the Windows app and run a practice session today.

Technical Interview Questions & Answers | Ask Agents