API Design interview questions
100 Backend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise API Design questionsBeginner
- A downstream service is down
- Accepting file uploads
- Adding a required field to an API
- Adding pagination to a list endpoint
- Adding rate limiting to your API
- API keys
- Authentication vs authorisation in APIs
- Building webhooks into your API
- Date bugs across time zones
- Design endpoints for a to-do app
- Documenting an API
- Filtering and sorting in REST APIs
- GraphQL from a backend developer's view
- Handling unexpected errors in APIs
- Health check endpoints
- Important HTTP headers for APIs
- Input validation in APIs
- JSON response conventions
- Kubernetes keeps restarting your service
- Long-running work in an API
- Naming REST resources
- Principles of a good REST API
- PUT vs PATCH
- Request IDs
- Response compression
- Returning validation errors
- Search endpoint returns too much
- Server-side request timeouts
- Soft deletes
- Users can see other users' orders
- What CORS is
- What DELETE should return
- What POST should return
- Why REST APIs should be stateless
Intermediate
- API for scheduling appointments across time zones
- API leaks sensitive fields
- API-first development
- Building a multi-tenant API
- Building services with gRPC
- Changing a field's type
- Choosing timeouts for an HTTP client
- Conditional GET requests
- Deprecating an endpoint
- Designing bulk endpoints
- Duplicate orders from mobile retries
- Endpoint is slow under load
- Endpoint makes hundreds of queries
- GraphQL resolvers hammer the database
- Header vs URL versioning
- Implementing idempotency keys
- Keeping implementation and docs in sync
- Link headers and pagination metadata
- Making GET endpoints cacheable
- Mass assignment vulnerability
- Modelling non-CRUD actions
- Optimistic concurrency in APIs
- Pagination returns duplicates
- Polling vs webhooks for job status
- Problem Details error format
- Processing incoming webhooks reliably
- Providing SDKs for an API
- Real-time updates from a REST backend
- Scopes in API authorisation
- Slow optional data in a response
- Sparse fieldsets
- Verifying JWTs in services
- What belongs in an API gateway vs the service
Experienced
- A deploy broke API clients
- API for a multi-step onboarding flow
- API serving users in different jurisdictions
- Backend change breaks old app versions
- Choosing an API style for internal services
- Consumer-driven contract testing
- Customers need to export millions of records
- Designing an API with an SLA
- Designing APIs for safe client retries
- Designing fair rate limits for an API product
- Evolving APIs and databases together
- Exposing events through an API
- First request after deploy is slow
- Hot endpoint overloads the database
- Idempotency edge cases
- IDs exposed in public URLs
- JSON serialisation is the bottleneck
- Localisation in APIs
- Migrating clients from REST to GraphQL
- Observability built into an API
- Paginating while data changes
- Partner sends malformed data
- Protecting a GraphQL server
- Protecting an API under overload
- Read-after-write in APIs backed by replicas
- Readiness checks with many dependencies
- Reviewing a teammate's API design
- Scrapers abusing a public API
- Search API returns irrelevant results
- Security best practices for public APIs
- Two endpoints, two truths
- Usage-based billing for an API
- Your API calls a non-idempotent external API