API Fundamentals
/Advanced
API Design Questions
Definition
Questions evaluating your ability to build API infrastructure that is secure, highly available, and scalable to millions of requests.
Explain Like I'm New
Can you design an architecture that survives going viral?
Real World Example
Designing the API layer for an Uber clone, discussing load balancers, rate limiting, geospatial database indexing, and WebSockets for live driver tracking.
Common Use Cases
- •Staff Engineer Interviews
Terminal Output
bash / terminal
/*
System Design Scenario:
"Design a Rate Limiter for a public API."
Answer:
I would use a Token Bucket algorithm backed by Redis.
1. Every user gets a 'bucket' in Redis with 100 tokens, identified by their API Key.
2. When a request hits the API Gateway, it instantly checks Redis.
3. If tokens > 0, decrement by 1, and route the request to the backend.
4. If tokens == 0, the API Gateway immediately drops the request and returns a 429 Status Code, completely protecting the backend servers from doing any work.
5. A background process refills the bucket to 100 tokens every minute.
*/
Interview Questions
basic
- Why should you put a Reverse Proxy / API Gateway (like NGINX or Cloudflare) in front of your Node.js API servers?
intermediate
- How do you handle a sudden 10,000x spike in traffic to a Read-Heavy API endpoint?