Design a Real-Time AI Search Answer Engine
Last updated: September 4, 2025
Quick Overview
Build a system that answers questions about events that happened 30 minutes ago. Cover real-time web crawling, event detection, source prioritization, cache invalidation, and LLM integration.
Perplexity
September 4, 202512
4
3,567 solved
Build a system that answers questions about events that happened 30 minutes ago. Cover real-time web crawling, event detection, source prioritization, cache invalidation, and LLM integration.
This is the canonical Perplexity system design question. It tests the full stack of AI-powered search from crawling to generation.
What the Interviewer Expects
- Design a real-time web crawling pipeline with freshness guarantees
- Implement hybrid retrieval combining BM25 and dense embeddings
- Address the freshness versus quality trade-off with concrete strategies
- Design the LLM integration layer with streaming token delivery
- Discuss cache invalidation for time-sensitive queries
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 detect when a cached answer is stale?
- What is your strategy for sources that are paywalled?
- How do you handle contradictory sources?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
High-Level Architecture
The system has three main layers: a real-time crawling and indexing layer, a retrieval and ranking layer, and an LLM synthesis layer. The crawling la...
Freshness vs Quality Trade-off
For time-sensitive queries (detected via temporal intent classification), prioritize freshness: weight recently-crawled sources higher in reranking an...