#79 Crawling/Deduplication/Ranking
Travel Deals Aggregator
Collect travel deals from partners and the web, remove duplicates and expired offers, and show the best ones first.
What is being asked
Design a deals aggregator: a page of "Goa flights from ₹2,499" and "40% off Jaipur hotels" collected from airline sales, hotel promotions and partner feeds. Deals expire quickly and the same deal often appears in several sources.
Requirements
Functional
- Ingest deals from partner feeds, APIs and approved crawled pages.
- Remove duplicates and verify prices before showing them.
- Rank and personalise by the user's home city and interests; email digests.
Non-functional
- Expired or wrong deals disappear within minutes.
- Thousands of sources with different formats and reliability.
- Respect partners' rate limits and robots.txt.
Design
- Normalise every deal into one schema: route or hotel, dates, price, currency, source, expiry.
- Deduplicate by a fingerprint (route + dates + supplier + price band); keep the most reliable source and merge the rest.
- A verifier re-checks prices on a schedule (and before featuring a deal) using the live search service; deals that no longer exist are hidden.
- Ranking scores deals by discount versus the usual price for that route, freshness, source reliability and the user's location.
Key decisions and trade-offs
- "Deal" needs a baseline. ₹4,000 is only a deal if the route usually costs ₹6,000; keep price history per route to judge it.
- Source reliability scores. Track how often each source's deals fail verification and rank or drop them accordingly.
- Freshness vs cost. Verifying every deal every minute is expensive; verify popular and featured deals more often.
- Crawling is fragile. Prefer partner feeds and APIs; treat crawlers as best-effort with per-site parsers and monitoring.
Follow-up questions
- A partner feed suddenly sends prices in the wrong currency. How do you catch it?
- How would you build the weekly "deals from your city" email?
- How do you avoid showing the same deal three times under different titles?
- How do you handle deals that require a coupon code?