InterviewStack.io LogoInterviewStack.io

API and Interface Design for Distributed Services Questions

Designing the contracts between services and clients: REST, gRPC, and GraphQL tradeoffs, versioning and backward compatibility, pagination, rate limiting, and idempotent endpoints. Covers request/response modeling, error contracts, and API gateway responsibilities. Focuses on the interface layer that ties distributed components together, not internal data schemas.

EasyTechnical
60 practiced

Compare cursor-based pagination with offset-based pagination for APIs. For a frequently-updated feed with a high insert rate at the head, explain which approach you would pick and why. Provide a sample response shape for a cursor-based page and mention how you would encode and expire cursors.

MediumTechnical
55 practiced

Implement a cursor encoding and decoding utility in Python. The cursor should represent an ordering key composed of created_at (ISO8601 timestamp) and id (string) encoded as a URL-safe base64 string. Show how you would handle identical timestamps, invalid cursors, and backward compatibility with older cursor formats.

MediumSystem Design
61 practiced

Design the pagination contract for a feed API where new items are frequently inserted at the head while a client is mid-page or has filters and sorting applied. Explain how the cursor or page token stays valid across those inserts, how you avoid returning duplicate or skipped items, and what the response needs to signal so the client can handle the change smoothly.

MediumTechnical
49 practiced

You had to choose between REST and gRPC for internal service APIs in a polyglot environment. Walk through how you evaluated the two options, what you benchmarked, and how you validated the choice with the team before committing to it.

EasyTechnical
59 practiced

Compare RESTful HTTP APIs and gRPC for both public-facing and internal service-to-service communication. For an internal microservices platform, explain when you would prefer one over the other, and what would change about your answer if the API needed to be called directly from a browser.

That is every published API and Interface Design for Distributed Services question for Cloud Engineer so far. Browse the other topics in this category, or practice this one interactively.