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
Implement a deduplicating queue in Java with API enqueue(itemId, payload) that drops items with the same itemId within a sliding time window W. The queue should support concurrent producers and consumers and survive restarts (i.e., deduplication info must be persisted or reconstructable). Sketch classes or pseudocode and discuss storage/compaction of seen IDs.
EasyTechnical
0 practiced
You are designing pagination for an internal events API that returns time-ordered audit events and must support up to 1 billion events. Compare offset pagination and cursor-based pagination for this use case. Propose an endpoint shape for cursor pagination, list response fields, and explain how you would handle concurrent appends and deletions during pagination.
HardTechnical
0 practiced
Design a partitioning and live rebalancing strategy for a large key-value store that needs to reshard without downtime. Include partitioning scheme (hash vs range), metadata service design, migration protocol (streaming copies, cutover), client routing updates, and safety mechanisms to throttle or rollback migrations. Describe how to validate correctness during migration.
MediumTechnical
0 practiced
You must design an analytics counter system that ingests 1M events/second and produces per-user daily aggregates for dashboards with near-real-time updates. Describe the data structures and write path (edge aggregation, batching), batching/flush strategy, how to ensure idempotency or handle duplicates, and choices for storage and low-latency reads.
HardTechnical
0 practiced
Design a cache eviction and persistence strategy for a large stateful in-memory cache that must restart quickly and minimize cold-start impact. The cache should respect memory limits, support a durable backing store, and provide a warm-up plan (hot/warm/cold tiers). Describe data structures to track recency/frequency, write-through vs write-back policy, and how to persist metadata to speed restart.

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.