InterviewStack.io LogoInterviewStack.io

API Contracts and Schema Design Questions

Defining the interface contract between producers and consumers: request/response payload shapes, data models, field-level validation, nullability, and enum/typing decisions (including safely evolving an enum's allowed values without breaking clients). Covers contract-first design with OpenAPI and JSON Schema (authoring specs, generating SDKs and mock servers, catching breaking changes in CI), mapping internal domain models to external DTOs as both evolve independently, and designing a stable error-response contract (structured error codes, correlation IDs, retryable classification). Also covers the leadership and behavioral practice of establishing and governing contract standards across teams. The contract is the durable artifact clients depend on.

EasyTechnical
50 practiced

What fields does a good JSON error response need so both a machine caller and a human developer can act on a failure? Design that shape for a REST API consumed by mobile and web clients: an error code, a user-facing message, a developer-facing trace or correlation ID, and how you would map these to HTTP status codes. Provide one example error JSON a client could parse programmatically.

That is every published API Contracts and Schema Design question for Frontend Developer so far. Browse the other topics in this category, or practice this one interactively.