0% completed
How API Design Shows Up in Interviews
On This Page
- The Four Formats
- Format One: The Dedicated API Design Round
Your opening
The failure specific to this format
- Format Two: API Design Inside a System Design Round
Your opening
Reuse the architecture without exposing it
The failure specific to this format
- Format Three: The API Critique Round
Your opening
Critique in the right order
The failure specific to this format
- Format Four: Interface Design Inside a Coding Round
Your opening
The failure specific to this format
- Which Companies Use Which Formats?
- A Real Contract in Ten Minutes
Minute 0 to 1: Name the caller and job
Minute 1 to 2: Name the resource and operations
Minute 2 to 7: Design creation completely
Minute 7 to 9: Address the hard parts
Minute 9 to 10: State the trade-off
Why two operations beat ten names
Key Takeaways
You may never receive an interview invitation titled API Design.
The skill appears inside a system design round, a product architecture discussion, an API critique, or a coding exercise. Candidates miss it because they prepare for the title of the round instead of the decision the interviewer is actually asking them to make. What matters is the moment the interviewer asks you to define a contract:
- "What would the client-facing API look like?"
- "Which operations would you expose?"
- "Review this API and tell me what you would change."
- "Design the interface first, and then implement one method."
All four test the same ability: can you decide what one program should promise to another?
The time available and the expected output change from format to format, so your first move must change with them. A good 60-minute answer is too large for a 10-minute segment.
1. The Four Formats
The diagram below shows the time you actually get for the design, not the length of the session. Two of these formats put your design work inside a longer round, so the session length and the design time are different numbers.
Two of the four formats give you the same short window. A segment inside a system design round and the interface part of a coding round each leave 10 to 15 minutes inside a session of 45 to 60. The long session is not design time.
The six-step method previewed in Lesson 1, and designed in full in Lesson 5, supports all four. What changes is how far you compress it, and which risk deserves attention first.
The four sections that follow add two things the diagram cannot show: the sentence you actually say to open, and the mistake specific to each format.
2. Format One: The Dedicated API Design Round
The entire session is about the contract. The question is broad, such as "Design a public API for a file-conversion service." The interviewer gives a short product description and then waits, expecting you to build structure out of an incomplete question.
The round may also be called product architecture or product design. Then expect the interviewer to also ask for the data model and the client call flow.
You have time for the complete six-step framework, but not for every operation in equal detail. Spend 25 minutes gathering requirements and you will never reach errors, compatibility, or trade-offs.
Your opening
Do not begin with GET, POST, or a database table. Begin with the caller:
"Before I define the operations, I want to identify the consumers and the two or three jobs the API must make easy. Is this mainly a public partner API, an internal service API, or a first-party application API?"
That sentence establishes that the caller drives the design, narrows the scope, and lets the interviewer reveal the intended direction. Then state your plan:
"I'll model the resources, list the core operations, design the most important write operation in detail, and then cover retries, authentication, and evolution."
Now the interviewer knows where the answer is going. This helps most when English is not your first language, because a declared structure removes the pressure to invent transitions while speaking.
The failure specific to this format
Because the session is long, candidates fill it with breadth: every endpoint they can imagine, plus REST, GraphQL, and gRPC. Then no time is left to define a single request or a single error.
3. Format Two: API Design Inside a System Design Round
This is the most common format. You spend most of the interview on services, databases, queues, and scaling. In the last ten to fifteen minutes, the interviewer points at the architecture:
"What does the API exposed to the client look like?"
The question tests whether the architecture you designed can be expressed as a usable product contract. The words endpoint and API are obvious signals. A request to trace one user action step by step is the same signal, without either word.
Your opening
Do not restart the interview by redrawing the architecture. Use the decisions already made as constraints:
"I'll focus on the contract between the mobile client and the service. The main flow is creating an order, so I'll list the few operations needed for that flow and then define order creation completely."
If the caller is unclear, ask one narrow question:
"Should I design this for the first-party mobile client or for public restaurant partners?"
A first-party client can evolve with the server. A public partner API needs stronger compatibility guarantees, more explicit errors, stricter limits, and better onboarding.
Reuse the architecture without exposing it
The architecture should influence the contract, but it should not be visible in it.
Suppose your design uses a queue because video processing takes several minutes. The API should reflect asynchronous work through a job resource and a status operation. It should not expose the queue's name or require the caller to understand worker partitions. The contract communicates observable behavior; internal component names remain internal.
The failure specific to this format
The common mistake is treating the final question as a vocabulary test: "We would have create, read, update, and delete endpoints." That says nothing about the product. Most user jobs do not map to CRUD; a caller publishes, reserves, cancels, approves, or acknowledges. The operation model should express the job, not the database verbs.
4. Format Three: The API Critique Round
The contract already exists. Your job is to evaluate it, explain the consequences of its problems, and propose improvements. That is harder than designing a clean API from nothing, because this one already has callers.
You may receive a specification, documentation page, or code sample:
POST /api/doUserThing Content-Type: application/json { "action": "get", "userId": 42 }
{ "success": false, "message": "User not found" }
The failure is returned with status 200 OK. The operation is vague, the action field may choose between several unrelated behaviors, and the message is not stable enough for code to depend on. A strong critique still does not begin by rewriting everything.
Your opening
Before proposing changes, ask who calls this API today and whether you are allowed to make a breaking change. Then clarify the intended job: is the caller retrieving one user, searching for users, or performing several actions through one operation?
Those two questions prevent a common failure: proposing a better replacement that the company cannot deploy. If breaking changes are not allowed, you might add an operation, introduce a version, or improve the response additively. The same flaw can need a different repair, depending on what compatibility allows.
Critique in the right order
Review from highest impact to lowest:
- Caller and job: is the intended task possible without unnecessary work?
- Semantics: is it clear what the operation does and guarantees?
- Failures: can programs distinguish validation, authorization, absence, conflict, throttling, and server failure?
- Consistency: do names, shapes, pagination, and errors follow predictable patterns?
- Evolution: can fields and behavior change without breaking callers?
- Surface polish: are names and documentation clear?
This order keeps the critique connected to consequences. "I dislike this name" is an opinion. "This operation performs five unrelated actions, so permissions, retries, and errors change according to a string field" is a design argument.
Alongside the problems, give a revised design for the most important ones and a migration approach for current callers.
The failure specific to this format
Weak candidates search for violations of memorized rules: every noun plural, every update a PUT, no actions in URLs. Rules help consistency, but they are not the scorecard. Returning 200 OK for every outcome breaks retry logic and monitoring; singular against plural paths rarely matters. Treating both as equal shows you are checking style rather than caller impact.
5. Format Four: Interface Design Inside a Coding Round
API design does not always involve HTTP. The API may be a class, library, or typed interface used by another programmer, and you are asked to define it and then implement one part. You might hear "Design an interface for an in-memory cache, then implement put."
The interface is still a published contract: callers depend on method names, types, errors, and edge-case behavior. Do not spend the whole session designing. Leave time to write and explain working code.
interface Cache<K, V> { Optional<V> get(K key) void put(K key, V value, Duration ttl) boolean delete(K key) }
The signatures look simple, but the contract is still open. Does put replace an existing value, and does replacement reset the expiration? What does a non-positive ttl mean? Does get remove an expired entry or only behave as if it is absent? Is the cache safe for concurrent callers?
Your opening
State the observable behavior before choosing the data structure:
"Before I implement
put, I want to define replacement and expiration semantics because callers and tests will depend on them."
Then make a small set of explicit assumptions:
"I'll allow replacement, replacement will reset the TTL, a non-positive TTL will be rejected, and the first version will not promise thread safety unless that is required."
The interface leads; the data structure follows.
The failure specific to this format
Weak candidates immediately build a hash map, tree, or queue, then discover halfway through that they do not know what a duplicate, timeout, or missing value should do. This is the coding-round version of exposing the database schema as an HTTP API: the implementation is allowed to choose the contract. Strong candidates reverse that direction.
6. Which Companies Use Which Formats?
There is no universal rule, but the product and team predict the format better than the interview title.
Treat this as a preparation guide, not a guarantee. If a recruiter's guide uses phrases such as product architecture, API modeling, interface design, or developer experience, it is describing this skill without calling it API design.
7. A Real Contract in Ten Minutes
A short segment is not permission to list vague operation names. It is a reason to reduce scope.
You have designed the architecture for a notification service. Ten minutes remain, and the interviewer asks:
"What API do application teams use to send notifications?"
Minute 0 to 1: Name the caller and job
"The caller is another internal product service. Its main jobs are to request one notification and check whether it was delivered. I'll focus on those two jobs."
Minute 1 to 2: Name the resource and operations
The main resource is a Notification, with two operations: POST /v1/notifications to create one and GET /v1/notifications/{notification_id} to read its state. Cancellation, bulk sends, and template management can be discussed if the interviewer asks.
Minute 2 to 7: Design creation completely
POST /v1/notifications Content-Type: application/json Idempotency-Key: 64d9b7a2-3b1c-4d62-9f44-a49e1e816610
{ "recipient_id": "usr_123", "template_id": "order_shipped", "channel": "push", "variables": { "order_id": "ord_456" }, "send_at": "<RFC 3339 UTC timestamp>" }
send_at is optional; if omitted, the notification is queued immediately.
HTTP/1.1 201 Created Location: /v1/notifications/ntf_789
{ "id": "ntf_789", "status": "queued", "created_at": "<RFC 3339 UTC timestamp>", "send_at": "<RFC 3339 UTC timestamp>" }
The server created the resource, so 201 Created is right even though delivery is asynchronous. The queued status tells the caller that creation is complete but delivery is not.
Name the main failures rather than saying "return an error":
| Status | Stable error code | Meaning |
|---|---|---|
400 Bad Request | invalid_template_variables | The variables cannot render the selected template. |
400 Bad Request | idempotency_key_reused | The caller reused the key with a different body. |
429 Too Many Requests | rate_limit_exceeded | The caller exceeded its creation rate. |
Every failure uses one machine-readable shape carrying a stable code, a human message, and the field at fault. Chapter 2 defines that shape in full.
Minute 7 to 9: Address the hard parts
Delivery is asynchronous, so GET /v1/notifications/{id} returns queued, sending, delivered, or failed.
The caller may time out without knowing whether the server accepted the request. The Idempotency-Key lets it retry without creating a duplicate, because the server returns the original result for the same key and body. Rate-limit responses include a Retry-After header.
Minute 9 to 10: State the trade-off
"I chose a template-based API instead of accepting an arbitrary title and body. Templates make localization, branding, and validation consistent, but they give application teams less freedom. If ad hoc messages are a requirement, I would add them as a separately permissioned operation rather than weakening the default contract."
That statement exposes a real decision, its benefit, and its cost.
Why two operations beat ten names
The wide version sounds like this: "We need endpoints to create, read, update, delete, list, send, schedule, cancel, retry, and report notifications." That is many nouns and few decisions. It never says what creation requires, whether delivery is synchronous, or how a failure appears. Names carry almost no decisions; inputs, outputs, status codes, error bodies, and retry behavior do.
A few operations designed completely show more than many operation names.
If time remains after one operation is complete, expand outward. Do not begin wide and hope to return to the details later. That time usually does not exist.
Key Takeaways
- API design appears in four formats: a dedicated round, a segment inside system design, an API critique, and interface design inside a coding round.
- Two of the four give you only 10 to 15 minutes of design time inside a much longer session.
- Begin a dedicated round with consumers and jobs; in a system design segment, reuse the architecture and select one caller flow.
- In a critique round, ask who already uses the API and whether breaking changes are allowed before proposing a replacement.
- In a coding round, define observable interface behavior before choosing data structures.
- A ten-minute segment can still include a real request, response, failure model, retry decision, and trade-off, and that beats listing many endpoint names.
You can now recognize the round even when the calendar invitation uses a different name. The next lesson opens the interviewer's scorecard. It covers the five signals that separate a plausible contract from a strong answer, what weak and strong evidence sound like, and why exposing a database schema is the most common way candidates lose the round.
On This Page
- The Four Formats
- Format One: The Dedicated API Design Round
Your opening
The failure specific to this format
- Format Two: API Design Inside a System Design Round
Your opening
Reuse the architecture without exposing it
The failure specific to this format
- Format Three: The API Critique Round
Your opening
Critique in the right order
The failure specific to this format
- Format Four: Interface Design Inside a Coding Round
Your opening
The failure specific to this format
- Which Companies Use Which Formats?
- A Real Contract in Ten Minutes
Minute 0 to 1: Name the caller and job
Minute 1 to 2: Name the resource and operations
Minute 2 to 7: Design creation completely
Minute 7 to 9: Address the hard parts
Minute 9 to 10: State the trade-off
Why two operations beat ten names
Key Takeaways