Skip to main content
Abstract Algorithms Logo
Abstract Algorithms
🧩 Problem Workspace

Engineering Problems

Canonical system design, coding, and architecture problems with staged solutions. Attempt before revealing the reference answer β€” each problem connects back to the concepts it teaches.

How problem workspaces work

1Understand requirements & constraints
2Sketch your approach
3Compare with staged reference solution
4Explore trade-offs & failure modes
5Answer a follow-up or changed constraint
System Designmedium~35 min

Design a URL Shortener

Design a URL shortening service similar to bit.ly or TinyURL. Users submit a long URL and receive a short alias (e.g., https://short.ly/aB3xY). When a user visits the short URL, the service redirects them to the original. The service must handle high read traffic, provide low-latency redirects, and allow optional analytics per short URL.

cachingdatabase shardingconsistent hashing+2 more
Solve this problem→
System Designmedium~30 min

Design a Distributed Rate Limiter

Design a rate limiter for a public API that enforces per-user and per-IP request limits at scale. The service must handle high throughput, be deployable across multiple data center regions, and gracefully degrade when the rate-limiting backend is unavailable.

rate limitingcachingconsistent hashing
Solve this problem→
System Designmedium~30 min

Design a Notification Service

Design a notification service for a social media platform. The service must deliver notifications to users via push (mobile), email, and in-app channels. Notifications are triggered by user events (likes, comments, follows, mentions). The system must be reliable, handle notification preferences, and avoid spamming users.

event driven architecturecachingdatabase sharding+1 more
Solve this problem→
Low-Level Designmedium~25 min

Implement an LRU Cache

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement get(key) and put(key, value) operations in O(1) average time complexity. When the cache reaches its capacity, it should invalidate and evict the least recently used key before inserting a new item.

cachingdatabase indexing
Solve this problem→
Coding / Algorithmmedium~20 min

Top K Frequent Elements

Given an integer array nums and an integer k, return the k most frequent elements. The algorithm's time complexity must be better than O(N log N), where N is the array's size.

database indexingcaching
Solve this problem→
System Designmedium~30 min

Design a Distributed Unique ID Generator

Design a globally distributed unique ID generation service (similar to Twitter Snowflake). Generated IDs must be 64-bit integers, globally unique, roughly time-sortable, and generated at high scale without cross-node network coordination.

database shardingconsistency replication
Solve this problem→
Low-Level Designmedium~25 min

Design a Thread-Safe Bounded Blocking Queue

Design and implement a thread-safe Bounded Blocking Queue with put(element) and get() methods. When the queue is full, producer threads calling put() must block until space becomes available. When the queue is empty, consumer threads calling get() must block until an element is added.

event driven architecturecaching
Solve this problem→
System Designhard~40 min

Design a Distributed Key-Value Store

Design a distributed, highly available key-value store similar to DynamoDB or Cassandra. The system must support put(key, value) and get(key) across multiple storage nodes with configurable consistency, automatic data partitioning, and failure recovery.

consistent hashingdatabase shardingconsistency replication
Solve this problem→
Design Patternmedium~25 min

Design a Circuit Breaker for Microservices

Design a resilient Circuit Breaker pattern to protect distributed microservices from cascading failures when downstream dependencies degrade or fail. The breaker must support Closed, Open, and Half-Open states with automatic recovery testing.

circuit breakerrate limiting
Solve this problem→
Coding / Algorithmmedium~20 min

Course Schedule & Cycle Detection

There are numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [a, b] indicates that you must take course b before course a. Determine if you can finish all courses (i.e. check if the prerequisite graph is a Directed Acyclic Graph / DAG).

database indexingcaching
Solve this problem→

All problems are human-reviewed canonical content. Revealing a reference solution records activity only β€” demonstrated competence requires a submitted attempt evaluated against the problem criteria. Browse concepts β†’