Interview questions

APIs & Backend interview questions

API design, caching, queues and traffic control.

APIs & Backend

What caching strategies should you know for interviews?

The most common is cache-aside: read from the cache, and on a miss read the database and populate the cache. Write-through updates cache and database together; write-behind writes to the cache and persists asynchronously. Every strategy needs an invalidation plan — TTLs, explicit deletes on writes, or versioned keys — and an eviction policy such as LRU.

APIs & Backend

How would you design a rate limiter?

A rate limiter caps how many requests a client can make in a period. Common algorithms are token bucket (allows bursts up to a capacity, refills at a steady rate), leaky bucket (smooths output), fixed window counters and sliding window logs or counters. In distributed systems the counters usually live in a shared store such as Redis, updated atomically.

APIs & Backend

What is the difference between REST and GraphQL?

REST exposes resources at URLs and uses HTTP methods and status codes, which makes caching and tooling straightforward. GraphQL exposes one endpoint with a typed schema where clients ask for exactly the fields they need, reducing over- and under-fetching. The trade-off is added server complexity: query cost control, N+1 resolution and less natural HTTP caching.

APIs & Backend

Why and when would you use a message queue?

A message queue decouples producers from consumers: producers publish work and move on, and consumers process it at their own pace. Queues absorb traffic spikes, allow retries and enable asynchronous workflows such as emails, video processing or order fulfilment. The trade-offs are eventual consistency, duplicate delivery and the need for idempotent consumers.

Walk into your next interview prepared

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

APIs & Backend Interview Questions & Answers | Ask Agents