InterviewStack.io LogoInterviewStack.io

Api and Data Structure Design Questions

Focuses on designing efficient data models and public interfaces that back real world backend features, and selecting or inventing data structures to meet functional and non functional requirements. Candidates should be able to design data structures and classes to support use cases such as rate limiters, leaderboards, session managers, cache layers, analytics counters, and queueing or aggregation services. Topics include mapping operations to data structure choices for latency and throughput goals, persistence and eviction strategies for cached state, concurrency control and atomic operations, synchronization or lock free designs, partitioning and sharding implications, and tradeoffs between in memory, persisted, and distributed storage. Also cover API design considerations such as endpoint and payload design, versioning, pagination, idempotency, error handling, security and authentication, monitoring and observability, and how API shape influences internal data models and query patterns. Interviewers may ask candidates to produce class or interface sketches, data schemas, and rationale for chosen approaches and complexity characteristics.

MediumTechnical
0 practiced
Design the API contract and server-side behavior for a batch ingestion endpoint that accepts up to N events in a single HTTP request where partial failures are possible. How do you structure the request/response to report per-item success/failure, support retries and idempotency, and avoid excessive client-side complexity?
HardTechnical
0 practiced
Implement a lock-free sharded counter in Go supporting Increment(userID string) and Snapshot() that returns aggregated counts. Use multiple shards (buckets) of atomic counters with a consistent hashing scheme to map userIDs to shards. Provide a code sketch or pseudocode highlighting the concurrency primitives used and reason about correctness and potential contention points.
HardTechnical
0 practiced
A leaderboard needs to support atomic score updates and low-latency reads of top-K globally. Propose a data structure and algorithm that supports concurrent updates and consistent top-K reads, considering sharding per score-range or per-user, merging strategies, replication, and how to handle failover. Provide complexity characteristics and failure recovery steps.
EasyTechnical
0 practiced
Compare REST and gRPC for internal SRE-facing services. Discuss differences in performance (latency, payload size), backward compatibility and versioning, tooling for observability/tracing, ease of debugging, and scenarios where you would choose one over the other for service-to-service calls.
EasyTechnical
0 practiced
Implement a simple LRU cache in Python with methods get(key) -> value or None and put(key, value). The implementation should provide O(1) average time for get and put and support a fixed maximum capacity with evictions. Provide code or a clear class sketch and explain eviction behavior.

Unlock Full Question Bank

Get access to hundreds of Api and Data Structure Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.