Bird
Raised Fist0

Design a Job Portal - Search, Candidate Matching, Application Tracking

HLDhardInterview freq: high
Choose your preparation mode4 modes available
🎯
Design a Job Portal - Search, Candidate Matching, Application Tracking
45 min · senior
senior

Design a job portal system serving 50 million daily active users (DAU) with features including job search, candidate-job matching, and application tracking. The system must handle high query volumes with P99 latency under 200ms, ensure end-to-end encryption of sensitive user data, and support offline notifications for application status updates. The business requires real-time matching updates and auditability of application events.

  • Support 50M DAU with peak 10K QPS for search and matching APIs
  • P99 latency under 200ms for search and application tracking queries
  • End-to-end encryption of candidate and employer data at rest and in transit
  • Offline delivery of application status updates via push notifications
  • Audit logs for all application events with immutable storage
📋
Guided Steps
1/5
Step 1
Data Storage for Jobs and Candidates
How would you store and index job postings and candidate profiles to support low-latency search and matching at scale?
💡 Hint
Consider a search engine optimized for full-text and faceted search with horizontal scalability.
Use Elasticsearch clusters for indexing jobs and candidate profiles with custom analyzers and filters for faceted search and relevance scoring.
Mid: Names Elasticsearch for search. Senior: Explains inverted index, shard strategy, and why relational DBs like PostgreSQL fail at 10K QPS with complex text queries.
⚠️Common Wrong Answer
Using a relational database with LIKE queries for search - leads to high latency and poor scalability at 50M DAU.
Step 2
Candidate-Job Matching Architecture
How would you design the candidate-job matching system to provide real-time, personalized recommendations at scale?
💡 Hint
Think about streaming data pipelines and feature stores for real-time scoring.
Implement a real-time matching pipeline using Apache Kafka for event streaming, Apache Flink for feature computation, and Redis for low-latency feature store and caching.
Mid: Mentions Kafka for event streaming. Senior: Details Kafka partitioning by candidate_id, Flink stateful processing for feature updates, and Redis TTL caching to meet 200ms P99 latency.
⚠️Common Wrong Answer
Batch processing matching once per day - fails to provide real-time recommendations and degrades user experience.
Step 3
Application Tracking and Audit Logging
How would you design the application tracking system to provide real-time status updates and immutable audit logs?
💡 Hint
Consider event sourcing and append-only storage for auditability.
Use Apache Cassandra with time-series partition keys for application events and Apache Kafka for event sourcing; application status updates are pushed via WebSocket and offline via Firebase Cloud Messaging.
Mid: Names Cassandra for storage. Senior: Explains time-series partition keys for efficient range queries, Kafka for event sourcing, and how immutable logs support audit compliance.
⚠️Common Wrong Answer
Storing application status in a relational DB with frequent updates - causes write contention and no immutable audit trail.
Step 4
Security and Encryption
How would you ensure end-to-end encryption of sensitive candidate and employer data both at rest and in transit?
💡 Hint
Think about TLS, field-level encryption, and key management services.
Enforce TLS 1.3 for all client-server and inter-service communication; use AWS KMS for envelope encryption of sensitive fields in Elasticsearch and Cassandra; implement field-level encryption in the application layer.
Mid: Mentions TLS and encryption at rest. Senior: Details envelope encryption with KMS, field-level encryption trade-offs, and key rotation policies to meet compliance.
⚠️Common Wrong Answer
Relying only on network encryption without encrypting data at rest - exposes data if storage is compromised.
Step 5
API Design for Core Features
Design three core RESTful API endpoints for job search, candidate matching, and application tracking. What are the request and response formats?
💡 Hint
Focus on pagination, filtering, and real-time status updates in the API design.
Define /jobs/search with filters and cursor-based pagination; /candidates/{id}/matches returning scored job lists; /applications/{id}/status streaming status updates with WebSocket fallback.
Mid: Defines basic endpoints with query params. Senior: Explains cursor-based pagination for consistency, real-time streaming for status, and error handling strategies.
⚠️Common Wrong Answer
Using offset-based pagination causing inconsistent results under concurrent updates.
🔌
API Design Challenge
Sketch 3 core RESTful API endpoints for the job portal: job search, candidate-job matching, and application tracking. Define request and response structures.
  • How does the client specify search filters and pagination?
  • How does the matching API handle real-time updates and scoring?
  • How does the application tracking API provide status updates and history?
📊
Scoring Rubric
▼ Show
Must Have - 60%
  • Use Elasticsearch for scalable job and candidate search with inverted indexes
  • Implement real-time matching pipeline with Kafka and Flink for low latency
  • Store application events in Cassandra with time-series partition keys for audit logs
  • Enforce TLS and field-level encryption with AWS KMS for data security
  • Design APIs with cursor-based pagination and real-time status streaming
Good to Have - 30%
  • Use Redis as a feature store cache to reduce backend load
  • Implement offline notifications via Firebase Cloud Messaging
  • Use event sourcing with Kafka for immutable audit trails
  • Explain shard and partition key choices for scalability and consistency
Bonus - 10%
  • Discuss key rotation and encryption key lifecycle management
  • Describe fallback mechanisms for real-time APIs under failure
  • Explain trade-offs between batch and streaming matching pipelines
Using relational databases for full-text search causes high latency and poor scalability at 50M DAU, leading to slow response times and system overload.
Batch-only matching pipelines lead to stale recommendations and poor user experience because updates are delayed and not real-time.
Storing mutable application status without event sourcing causes auditability loss and write contention, making it hard to track changes and comply with regulations.
Relying solely on network encryption without encrypting data at rest risks data exposure if storage is compromised, violating security compliance.
✅
Model Answer
▼ Reveal

This design outlines a scalable job portal system supporting 50M DAU with low latency, real-time candidate-job matching, secure data handling, and auditability. It leverages Elasticsearch for search, Kafka and Flink for streaming matching, Cassandra for immutable event storage, and robust encryption strategies.

  • Use Elasticsearch with shard keys on job_id and candidate_id to support scalable, low-latency full-text and faceted search.
  • Implement real-time matching pipeline using Kafka partitioned by candidate_id for ordered event streaming and Flink for stateful feature computation to meet 200ms P99 latency.
  • Store application events in Cassandra using time-series partition keys to enable efficient range queries and immutable audit logs.
  • Enforce TLS 1.3 for all client-server and inter-service communication to secure data in transit.
  • Use AWS KMS for envelope encryption of sensitive fields in Elasticsearch and Cassandra, with field-level encryption implemented in the application layer.
  • Design RESTful APIs with cursor-based pagination for consistent data retrieval and WebSocket streaming with fallback to Firebase Cloud Messaging for real-time and offline application status updates.
  • Elasticsearch with shard key on job_id and candidate_id for scalable, low-latency search
  • Apache Kafka partitioned by candidate_id for ordered event streaming in matching pipeline
  • Apache Flink for real-time feature computation enabling sub-200ms P99 latency
  • Redis as a feature store and cache with TTL to reduce load on backend systems
  • Apache Cassandra with time-series partition keys for immutable application event storage
  • TLS 1.3 enforced for all network communication ensuring data in transit encryption
  • AWS KMS envelope encryption for field-level encryption of sensitive data at rest
  • WebSocket API with fallback to Firebase Cloud Messaging for offline application status updates
  • Cursor-based pagination in APIs to ensure consistent and efficient data retrieval
  • Event sourcing pattern using Kafka for auditability and replayability of application events

Practice

(1/5)
1. A high-traffic e-commerce platform expects sudden spikes of 1 million orders per minute. Which component best handles decoupling order intake from downstream inventory updates to maintain responsiveness?
easy
A. An in-memory cache with TTL eviction to buffer incoming orders
B. A relational database with strong ACID transactions for immediate consistency
C. A distributed message queue with partitioning and durable storage
D. A REST API gateway that throttles requests to downstream services

Solution

  1. Step 1: Identify decoupling need

    Immediate consistency via relational DB (A relational database with strong ACID transactions for immediate consistency) blocks on writes, causing latency spikes. In-memory cache (An in-memory cache with TTL eviction to buffer incoming orders) lacks durability and ordering guarantees. API gateway throttling (A REST API gateway that throttles requests to downstream services) limits throughput but doesn't decouple processing.
  2. Step 2: Durable queue with partitioning

    A distributed message queue (A distributed message queue with partitioning and durable storage) buffers spikes, partitions workload, and guarantees durability, enabling asynchronous downstream processing.
  3. Final Answer:

    Option C -> Option C
  4. Quick Check:

    Distributed queue partitions spikes, ensures durability, decouples processing [check]
Hint: Use durable queues to buffer spikes and decouple processing [OK]
Common Mistakes:
2. If the message queue (e.g., Kafka) between the upload service and transcoding pipeline fails, what exactly breaks in the video processing flow?
medium
A. Uploaded videos are accepted but never reach transcoding, so no processed versions are generated
B. Upload service blocks until transcoding completes, causing upload timeouts
C. Videos are transcoded multiple times causing duplicate outputs
D. View counts increment incorrectly due to missing transcoding metadata

Solution

  1. Step 1: Trace failure impact of message queue outage

    The queue decouples upload and transcoding. Without it, upload service cannot enqueue transcoding jobs. Uploads succeed but transcoding workers receive no tasks, so no processed videos are generated. Blocking upload (B) is incorrect because upload is asynchronous. Duplicate transcoding (A) is unrelated. View count errors (D) happen downstream, not due to queue failure.
  2. Step 2: Confirm exact failure mode

    Uploads accepted but stuck before transcoding is the precise failure.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Queue failure causes transcoding jobs to be lost, no processed videos [check]
Hint: Queue failure means no transcoding jobs dispatched [check]
Common Mistakes:
3. During a global network outage caused by BGP misconfiguration, which recovery approach balances speed and safety best for restoring connectivity without causing routing loops?
medium
A. Gradually reintroduce routes with route flap damping to prevent instability
B. Immediately re-advertise all withdrawn routes globally to restore traffic
C. Use static routing entries temporarily to bypass BGP until full recovery
D. Rely on client-side retries and exponential backoff to handle transient failures

Solution

  1. Step 1: Understand recovery trade-offs

    Immediate re-advertisement (A) risks routing loops and instability; static routes (C) don't scale globally; client retries (D) don't fix routing issues.
  2. Step 2: Evaluate gradual reintroduction

    Route flap damping (B) prevents rapid route changes causing instability, balancing speed and safety during recovery.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Route flap damping prevents loops during gradual route restoration [check]
Hint: Gradual route reintroduction with damping avoids loops [check]
Common Mistakes:
4. For a system requiring extremely low false negatives and exact key existence checks at scale, which approach is best?
medium
A. Use a counting Bloom filter to track exact key counts and avoid backend queries
B. Use only a Bloom filter for all key existence checks to minimize latency
C. Use a distributed cache storing all keys for exact lookups without Bloom filters
D. Combine a Bloom filter for negative filtering with a backend exact lookup for positives

Solution

  1. Step 1: Analyze false negative tolerance

    Bloom filters have zero false negatives but allow false positives, so exact checks need backend confirmation.
  2. Step 2: Evaluate approaches

    Only Bloom filter (A) risks false positives causing incorrect hits. Distributed cache (C) is costly at scale. Counting Bloom filters (D) track counts but still have false positives and complexity.
  3. Final Answer:

    Option D -> Option D
  4. Quick Check:

    Bloom filter filters negatives; backend confirms positives for exactness [check]
Hint: Bloom filter filters negatives; backend confirms positives [check]
Common Mistakes:
5. At 10x scale, which component in a sharded CRDT distributed counter system is most likely to fail first and why?
hard
A. The shard replicas, because network partitions cause permanent state divergence without reconciliation
B. The replication layer, because increased shard count causes exponential message overhead saturating network bandwidth
C. The global aggregator node, because it becomes a bottleneck merging all shard states synchronously
D. The client-side counters, because local state grows unbounded without periodic compaction

Solution

  1. Step 1: Analyze scale impact on components

    Global aggregator (A) merges asynchronously, so less likely bottleneck. Replication overhead (C) grows but can be optimized. Client counters (D) can compact state.
  2. Step 2: Identify shard replicas failure mode

    At 10x scale, network partitions increase, causing shards to diverge permanently without reconciliation, breaking eventual consistency.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Network partitions cause shard divergence first at scale [check]
Hint: Network partitions cause shard divergence before aggregator bottlenecks [check]
Common Mistakes:
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard