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
54 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?
MediumSystem Design
43 practiced
Design a leaderboard service for a multiplayer game. Requirements: ~1k updates/sec, ~100k reads/sec, regional top-K queries, global rank queries, and soft real-time rank propagation (~1s). Provide API endpoints (submitScore, getTopK, getRank), data model choices (sorted sets, DB schema), caching strategy, sharding approach, and how you'll handle hot players and reconciliation between regional and global views.
EasyTechnical
50 practiced
Design a small, consistent JSON error response schema for public SRE-facing REST APIs that helps clients and observability. Include fields you would include (e.g., code, message, retryable, correlation_id, details), example response, and explain how this format helps client error handling and monitoring while avoiding leaking internal details.
EasyTechnical
39 practiced
Implement a thread-safe in-memory counter class in Go with methods: Increment(key string), Get(key string) int64, and Reset(key string). The implementation must be safe for concurrent goroutines. Sketch code or an interface, explain time complexity of operations, and discuss race conditions and a scaling approach for high cardinality.
EasyTechnical
47 practiced
Explain compare-and-swap (CAS) at a high level: what it does, how retry loops work around it, and when you would choose CAS-based lock-free approaches versus traditional locks. Describe the ABA problem and one common mitigation technique.

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.