KatInterview

Real-Time Task Assignment Engine for Developer Marketplace

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsmatching-algorithmsscalability

Last updated

Build a system that routes skill-tagged work items to qualified engineers in under 500ms while maintaining fair load distribution across 200k workers.

Context

You're building a job dispatch platform for a freelance developer marketplace. Work requests arrive continuously with skill requirements (like rust, databases, mobile-ios), and your system must route them to available engineers whose verified competencies match those requirements.

The Challenge

Design an architecture that:

  • Receives work items annotated with 1–5 required skill tags from a vocabulary of 1,000 skills
  • Maintains live state for engineers including their verified skills (5–30 tags each) and availability
  • Routes work to qualified engineers (an engineer must possess all required tags for a work item)
  • Respects capacity constraints: each engineer handles at most 2 concurrent assignments
  • Operates with assignment latency under 500ms at the 99th percentile
  • Distributes work fairly, avoiding both engineer overload and task starvation

Scale Parameters

  • 200,000 engineers online simultaneously
  • 350 work requests arriving per second at peak
  • Each assignment goes through an offer phase: the engineer has 60 seconds to accept or decline
  • Account for ~30% rejection rate, requiring rematching

What to Address

  1. Data modeling: How you represent skills, availability, and capacity; indexing approaches for rapid candidate lookup
  2. Matching strategy: Algorithm choice (greedy online vs. batch optimization), and how you balance speed with assignment quality
  3. Coordination: Preventing double-booking of work items or exceeding engineer capacity when multiple matcher instances run concurrently
  4. Fairness mechanisms: Ensuring varied work distribution and preventing low-priority items from indefinite waiting
  5. Resilience: Handling offer rejections, engineer disconnections, and component failures

Provide architectural diagrams, API contracts, and concrete algorithmic choices with their trade-offs.

Hints

Hint 1

The entire skill index can fit in memory on each matcher instance—focus your design on coordination rather than data volume

Hint 2

Batching requests for 100–200ms windows enables better global optimization than pure greedy assignment

Hint 3

Use atomic operations on capacity counters to prevent over-assignment when multiple matchers compete for the same engineer