24. APIs and Idempotency
Interview questions
Interview questions (with the counter-questions you'll get)
Q1. What makes a good API?
They're testing: design taste.
Think about your answer first, then open it.
Q2. REST vs gRPC vs GraphQL: when would you use each?
They're testing: trade-offs.
Think about your answer first, then open it.
Q3. What does idempotent mean, and which HTTP methods are idempotent?
They're testing: precise definitions.
Think about your answer first, then open it.
Q4. How do you prevent double charges when clients retry?
They're testing: the core idempotency design.
Think about your answer first, then open it.
Q5. Offset vs cursor pagination?
They're testing: practical API design.
Think about your answer first, then open it.
Q6. How do you version an API without breaking clients?
They're testing: evolution.
Think about your answer first, then open it.
Q7. Which errors should a client retry?
They're testing: reliability judgement.
Think about your answer first, then open it.
Q8. How do you secure a webhook endpoint?
They're testing: security in practice.
Think about your answer first, then open it.
Q9. What's the difference between authentication and authorisation in an API?
They're testing: security basics.
Think about your answer first, then open it.
Q10. Design an API for a payment provider (like Stripe).
They're testing: putting the chapter together.
Think about your answer first, then open it.