CAP theorem
~11 minTwo data centres hold the same data. The link between them breaks. Each must now answer from its own copy, or refuse. CAP is the proof that there is no third way.
Answer API design questions at interview depth: transport fundamentals, contract styles, auth, and distributed architecture. Covers data formats, API security, messaging, and compliance standards.
3098 of 3098 questions in your plan: 0 known, 0 in progress, 0 due, 0 skipped, 3098 new. 0 cut, outside your plan.
Interviewers seldom set aside a round for API design; they fold it into other rounds. It opens many system design interviews, where endpoints and payloads are expected before any boxes are drawn, and it runs through backend, full-stack and platform conversations, where an existing endpoint is put on the table and the question is what is wrong with it. Screens reach further down, to what happens between a typed URL and the first byte of the response. A typical thread starts from one endpoint, say the one that creates a payment, and keeps adding failure. The client timed out and sent the request again: how does the server avoid charging twice? An idempotency key answers it, and the follow-ups ask where the key is stored, for how long, and what comes back when the same key arrives with a different body. A list endpoint gets the same treatment: offset pagination skips or repeats rows when items are inserted or deleted between pages, and a cursor fixes that at the price of jumping to an arbitrary page. Then the contract changes, and the question is which edits an old client survives. Strong candidates raise the failure before the interviewer does and name what each choice costs, such as a self-contained token that stays valid until it expires unless the server keeps a denylist. Payments and health-care loops carry the thread into regulation: why a card's security code may not be stored once the payment is authorized, or how an erasure request reaches personal data already written to an event log nobody rewrites.
Nothing in the first two modules is an API yet. [HTTP](/topics/proto-http) and the [TLS channel](/topics/proto-tls) it travels in come first, then the layers beneath them: UDP, TCP's connection life from handshake to teardown, and the names and addresses a client resolves before it connects. Latency and timeout questions are answered here. A small request can wait on [Nagle's algorithm meeting delayed acknowledgements](/topics/proto-tcp-nagle-keepalive), and a failover is only as fast as the [TTL](/topics/proto-dns-caching-ttl) resolvers are still honouring. [Wire formats](/topics/found-serialization) come before any API style, because a style is partly a choice of encoding and of the rules for changing it: whether a reader ignores a field it does not know, whether a field number may ever be reused. [REST](/topics/proto-rest) leads the styles module, since GraphQL, gRPC and the push channels are easiest to explain by how they depart from HTTP semantics. The module closes on [overflow strategies](/topics/found-reactive-programming-backpressure-overflow-strategies), the question any streaming style eventually raises: when a producer outruns its consumer, what is buffered, dropped or refused. Next the plan asks who is calling. [OAuth2](/topics/proto-oauth2) and OpenID Connect come before [JWT validation](/topics/proto-jwt), so the token format is met once the flows that issue it are clear. [Application security](/topics/found-appsec) follows, because many API flaws need a caller who has already signed in: a missing ownership check on one object ID, input that reaches an interpreter. The architecture module widens the frame from one endpoint to services owned by different teams. [Microservices](/topics/found-microservices) price the network boundary, [event-driven design](/topics/found-eda) swaps some calls for events, and [resilience patterns](/topics/found-cloud-design-patterns-resilience) bring idempotency back, since a retry is only safe on an operation built to repeat. [Broker operations](/topics/cloud-messaging-concepts) follow as their own module: what a cluster keeps, and for how long, decides whether a consumer that fell behind can catch up. [Data-protection law](/topics/proto-gdpr) and the payment and health-care standards close the plan. Placing them after messaging is deliberate: their hard questions are about copies, and the earlier modules have already shown each place data gets serialized, logged, replicated and retained.
Backend engineers who ship endpoints weekly can treat the transport modules as review and begin at wire formats. Near the date, narrow frequency toward the questions asked most and level to the band in the posting; on a skill this wide, that cut matters more than the reading order. Frontend and mobile engineers moving to the server know CORS and token storage from the client side; what they lack is the server's half, retries made safe and authorization on every object. Those answers rest on HTTP semantics and on what TCP can and cannot tell a caller about a failed request, so do not let by frequency scatter the opening modules: by topics keeps HTTP ahead of everything that leans on it. From senior level up, the hours belong in architecture and messaging, and anyone headed for payments or health care should give compliance real time, not a last evening. The plan is language-neutral: no module shows how a framework routes, validates or serializes a request. For the full loop around this skill, with a language and its storage, the [Backend Developer roadmap](/roadmaps/backend) is the next step; the automated suites and load scripts that check an API from outside belong to the [API Testing roadmap](/roadmaps/api-testing).
Two data centres hold the same data. The link between them breaks. Each must now answer from its own copy, or refuse. CAP is the proof that there is no third way.
Interviewers seldom set aside a round for API design; they fold it into other rounds. It opens many system design interviews, where endpoints and payloads are expected before any boxes are drawn, and it runs through backend, full-stack and platform conversations, where an existing endpoint is put on the table and the question is what is wrong with it. Screens reach further down, to what happens between a typed URL and the first byte of the response.
A typical thread starts from one endpoint, say the one that creates a payment, and keeps adding failure. The client timed out and sent the request again: how does the server avoid charging twice? An idempotency key answers it, and the follow-ups ask where the key is stored, for how long, and what comes back when the same key arrives with a different body. A list endpoint gets the same treatment: offset pagination skips or repeats rows when items are inserted or deleted between pages, and a cursor fixes that at the price of jumping to an arbitrary page. Then the contract changes, and the question is which edits an old client survives. Strong candidates raise the failure before the interviewer does and name what each choice costs, such as a self-contained token that stays valid until it expires unless the server keeps a denylist.
Payments and health-care loops carry the thread into regulation: why a card's security code may not be stored once the payment is authorized, or how an erasure request reaches personal data already written to an event log nobody rewrites.
Nothing in the first two modules is an API yet. HTTP and the TLS channel it travels in come first, then the layers beneath them: UDP, TCP's connection life from handshake to teardown, and the names and addresses a client resolves before it connects. Latency and timeout questions are answered here. A small request can wait on Nagle's algorithm meeting delayed acknowledgements, and a failover is only as fast as the TTL resolvers are still honouring.
Wire formats come before any API style, because a style is partly a choice of encoding and of the rules for changing it: whether a reader ignores a field it does not know, whether a field number may ever be reused. REST leads the styles module, since GraphQL, gRPC and the push channels are easiest to explain by how they depart from HTTP semantics. The module closes on overflow strategies, the question any streaming style eventually raises: when a producer outruns its consumer, what is buffered, dropped or refused.
Next the plan asks who is calling. OAuth2 and OpenID Connect come before JWT validation, so the token format is met once the flows that issue it are clear. Application security follows, because many API flaws need a caller who has already signed in: a missing ownership check on one object ID, input that reaches an interpreter.
The architecture module widens the frame from one endpoint to services owned by different teams. Microservices price the network boundary, event-driven design swaps some calls for events, and resilience patterns bring idempotency back, since a retry is only safe on an operation built to repeat. Broker operations follow as their own module: what a cluster keeps, and for how long, decides whether a consumer that fell behind can catch up. Data-protection law and the payment and health-care standards close the plan. Placing them after messaging is deliberate: their hard questions are about copies, and the earlier modules have already shown each place data gets serialized, logged, replicated and retained.
Backend engineers who ship endpoints weekly can treat the transport modules as review and begin at wire formats. Near the date, narrow frequency toward the questions asked most and level to the band in the posting; on a skill this wide, that cut matters more than the reading order.
Frontend and mobile engineers moving to the server know CORS and token storage from the client side; what they lack is the server's half, retries made safe and authorization on every object. Those answers rest on HTTP semantics and on what TCP can and cannot tell a caller about a failed request, so do not let by frequency scatter the opening modules: by topics keeps HTTP ahead of everything that leans on it. From senior level up, the hours belong in architecture and messaging, and anyone headed for payments or health care should give compliance real time, not a last evening.
The plan is language-neutral: no module shows how a framework routes, validates or serializes a request. For the full loop around this skill, with a language and its storage, the Backend Developer roadmap is the next step; the automated suites and load scripts that check an API from outside belong to the API Testing roadmap.