Review cards · 17 cards

API design

Endpoints, pagination, idempotency keys and the contracts between services.

Train api design in daily review

Cards

  1. Which change to a JSON API breaks existing clients? easy Multiple choice
  2. Which HTTP method is not idempotent by definition, so retrying it can create a second resource? easy Multiple choice
  3. An API call starts a video transcode that takes 10 minutes. How should the API respond? easy Flashcard
  4. What is the difference between PUT and PATCH, and which is safe to retry? easy Flashcard
  5. A client over its rate limit should get HTTP status _____, ideally with a _____ header saying when to try again. easy Fill in the blank
  6. Which response should a client retry automatically, after a delay? easy Multiple choice
  7. What belongs in an API gateway, and what should stay out of it? medium Flashcard
  8. Why do feeds use cursor pagination instead of ?page=N (offset)? medium Flashcard
  9. Old versions of your mobile app stay installed for years. How do you change the API without breaking them? medium Flashcard
  10. What is a common cost of GraphQL compared with a REST API? medium Multiple choice
  11. How should a server implement idempotency keys for a "create payment" endpoint? medium Flashcard
  12. When would you pick gRPC over REST with JSON? medium Flashcard
  13. What should a webhook receiver do so forged, replayed or repeated deliveries cannot hurt it? medium Flashcard
  14. A webhook sender retries failed deliveries up to 10 times, waiting 1 minute before the first retry and doubling the wait each time. How long after the first attempt does it give up? medium Estimate
  15. Two retries with the same idempotency key reach two servers at the same moment. What stops both from charging the card? hard Multiple choice
  16. To stop two clients from overwriting each other's edits, the server returns an _____ with the resource, and the client sends it back in an _____ header when updating. A stale value gets _____. hard Fill in the blank
  17. A feed is paged with a cursor on created_at. Why should the cursor also include the post id? hard Multiple choice

More topics