Lesson 11 of 30
You don't need to own the API to know exactly what makes its responses painful to consume — and naming the specific problem is what turns a complaint into a fixable one.
12 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
An orders list endpoint returns each order with only a `customerId`, no customer name or details. What specific problem does this create for a frontend client that needs to show each customer's name in the list?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Most frontend developers don't design the API they call. But consuming one every day teaches you, very concretely, what makes a response shape easy versus painful to work with — and being able to name the specific problem (not just "this API is annoying") is what turns a frustration into an actionable conversation with whoever does own it. Three patterns show up constantly:
{ data, meta }), and every error response using the same shape too, means client code can parse the outer structure once instead of writing endpoint-specific unwrapping logic for every single call.null, for the exact same logical "no value" meaning, forces every consumer to defensively check both cases everywhere that field is read — a real, common source of bugs that a single consistent convention would have prevented outright.// Painful: no customer info, inconsistent null handling
{
"orders": [
{ "id": "o_1", "total": 42.5, "customerId": "c_9", "note": null },
{ "id": "o_2", "total": 18.0, "customerId": "c_4" }
]
}
The first order's note is explicitly null; the second order's note key is missing entirely. Both mean "no note," but a client reading order.note has to handle both undefined and null as the same case, forever, on every screen that touches this field. And neither order includes a customer name, so rendering a list of "Jane Doe — $42.50" requires one more request per order.
// Frontend-friendly: consistent envelope, no forced follow-up, consistent null
{
"data": {
"orders": [
{ "id": "o_1", "total": 42.5, "note": null, "customer": { "id": "c_9", "name": "Jane Doe" } },
{ "id": "o_2", "total": 18.0, "note": null, "customer": { "id": "c_4", "name": "Sam Lee" } }
]
},
"meta": { "count": 2 }
}
Same data, but note is always present (always null when empty, never dropped), and customer is embedded because a list of orders rendered for a human almost always needs to show who placed each one.
null field are not interchangeable to a client, even when they mean the same thing to the API author. Every place downstream code reads that field either has to check both, or the API has to commit to exactly one — the second option is strictly better for every consumer, forever."What makes an API response easy or hard to work with from the frontend?" is a real question that separates a candidate who can only say "good documentation" from one who names concrete, specific shape problems — inconsistent envelopes, forced follow-up requests, and null-vs-missing drift — from lived experience.