System Design

APIs

February 14, 20262 min read

Why You Need to Understand APIs

The client or frontend needs to talk to the server. In essentially every case, the server exposes a set of functions it can perform via an API—that's the interface between them. You need to understand what an API is and how these are built, because APIs expose what functionality the server can offer to the client.

REST API Fundamentals

The most basic API you'll use in system design interviews is REST APIs. Master these first—they're what you'll rely on most of the time.

Make sure you understand:

  • HTTP verbs — GET, POST, PUT, PATCH, DELETE and when to use each
  • Routes — How to design clean, logical URLs for your resources
  • Headers — Request and response metadata (Content-Type, Authorization, etc.)
  • Body — Payload structure for requests (usually JSON)
  • Responses — What you return and in what format

Status Codes

Know the common status code ranges:

RangeMeaningExamples
2xxSuccess200 OK
3xxRedirect301, 302
4xxClient/user error400 Bad Request, 404 Not Found
5xxServer error500 Internal Server Error

Understand what each signals and when to use them in your design.

Other Protocols

There are other ways to interact with the server:

  • GraphQL — Flexible querying, often for complex or variable data needs
  • RPC / gRPC — Remote procedure calls, common for service-to-service communication
  • WebSockets — Persistent, bidirectional connections for real-time data

These are more niche and depend on the company or use case. REST APIs are the foundation. Use REST 70–80% of the time; reach for the others when the problem demands it.