What makes a good REST API?
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn What makes a good REST API?
Definition:
A REST-oriented API exposes resources through consistent HTTP operations and representations. A useful API contract explains identifiers, input rules, outcomes, errors and pagination so clients do not need to guess. The goal is predictable behavior and evolvable interfaces, not forcing every business operation into a simplistic CRUD shape.
Key points:
-
Use clear resources, consistent methods and meaningful status codes.
-
Validate input; support bounded pagination, filtering and stable sorting.
-
Return a consistent error code/message/request ID, without internal stack traces.
-
Use explicit action endpoints when they honestly represent a domain transition, such as submitting an order for approval.
Interview point:
- Walk through a successful request, a validation error and a forbidden request using the same clear contract.
Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “What makes a good REST API?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.