InterviewStack.io LogoInterviewStack.io

RESTful API Design Questions

Focuses on designing resource oriented web APIs following Representational State Transfer principles and proper use of the Hypertext Transfer Protocol. Core skills include resource modeling and endpoint naming, use of correct Hypertext Transfer Protocol methods and semantics, status code selection and error response structure, idempotency and stateless design, request and response formats such as JavaScript Object Notation, pagination, filtering and sorting strategies, versioning and backward compatibility, authentication and authorization patterns, rate limiting and abuse prevention, caching and performance considerations, API contract testing and documentation, common anti patterns, and designing APIs that balance client usability with backend implementation concerns.

EasyTechnical
66 practiced
In Node.js using Express, implement a POST /users route handler that creates a new user with fields name and email. Validate email format, return 201 with Location header set to /users/{id} and a JSON body containing the new user id on success. On validation failure return 400 with a JSON error object. Focus on the route handler and validation; you may assume an in-memory store or a stubbed createUser function.
HardTechnical
58 practiced
Design an API endpoint for searching products with flexible filtering and sorting: support range filters for price, category inclusion, full-text matches on name and description, and multi-field sorting. Define the query parameter schema, how to map parameters to SQL or search engine queries efficiently, index strategies to support common filters, and safeguards to prevent expensive ad hoc queries from degrading production performance.
MediumTechnical
58 practiced
Design an OAuth2 authorization code flow for third-party clients accessing user resources. Describe the endpoints, parameters, redirects, scopes, exchanging code for tokens, use of refresh tokens, securing client secrets for public clients, and endpoints for token revocation and introspection. Highlight common security pitfalls and mitigations.
HardTechnical
71 practiced
You are responsible for shipping official SDKs for your REST API in Node.js, Python, and Java. Explain how to design SDKs for ergonomics and resilience: map HTTP errors to language-native exceptions, provide helpers for pagination and retries with exponential backoff, integrate auth token refresh, surface API rate limit headers to clients, and coordinate SDK versioning and deprecation with API changes.
MediumTechnical
81 practiced
Discuss API versioning strategies: URI versioning, header-based versioning, content negotiation, and semantic versioning practices. For a mobile client and a web SPA, recommend a versioning approach and explain your rationale. Include considerations for deprecation, client notification, and migration paths.

Unlock Full Question Bank

Get access to hundreds of RESTful API Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.