Design a Multi-Tenant Async Job Queue With Fair Scheduling
Last updated: November 29, 2026
Quick Overview
Design a shared asynchronous job queue used by thousands of Meta product teams for background work (sending emails, recomputing aggregates, deleting data) that guarantees durability, supports priorities and delays, and keeps one tenant's flood from starving everyone else.
Meta
November 29, 20260
0
0 solved
Design a shared asynchronous job queue used by thousands of Meta product teams for background work (sending emails, recomputing aggregates, deleting data) that guarantees durability, supports priorities and delays, and keeps one tenant's flood from starving everyone else.
Meta built shared queueing infrastructure (in the spirit of its FOQS system) because every product needs background work and per-team queues do not scale operationally. The interviewer probes durable storage design for a priority queue, at-least-once leasing semantics, and multi-tenant fairness under extreme skew.
What the Interviewer Expects
- Design a durable store that supports enqueue, dequeue by priority and delay, ack and nack
- Use leases with visibility timeouts for at-least-once delivery
- Isolate tenants with per-tenant quotas and weighted fair dequeue
- Handle hot tenants and topic sharding
- Plan capacity for billions of items per day
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you dequeue the highest priority ready item efficiently from a sharded store?
- What if a tenant enqueues 1 billion items in an hour?
- How do you support FIFO ordering for a subset of tenants?
- How would you migrate a topic between shards with no downtime?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: tenants create topics. Producers enqueue items with payload, priority, and optional deliver-after time. Consumers dequeue a batch, receive a lease (visibility timeout), then ack (delet...
High-Level Design
Front-end tier (stateless) handles API, auth and quotas. Storage shards: each is a MySQL-style primary with replicas; a topic is split across several shards. Within a shard, items are in a tab...