← Booking.com Interview Insights
The 'define it yourself' part is where I lost time.
Start by clarifying the problem: define keyword detection (e.g., exact match, stemming, or NLP), assign weights (e.g., +1 for positive, -1 for negative), and aggregate scores per hotel. Then discuss efficient algorithms for top-K selection, such as using a min-heap of size K, and analyze trade-offs between preprocessing and query-time computation.
Pro tip: Mention that in a real system, you'd likely precompute and cache hotel scores, and use a streaming approach for reviews to handle large-scale data. Also, consider normalizing scores by review count to avoid bias toward hotels with many reviews.
Ask about data size, keyword list, review format, and whether scores should be normalized. Define positive/negative keywords and weights explicitly.
Choose a detection method (e.g., tokenization, stemming, or regex) and assign weights (e.g., +1 for positive, -1 for negative). Consider handling negations or context.
Iterate through reviews, update a hash map of hotel scores. For large data, consider parallel processing or streaming aggregation.
Use a min-heap of size K to find top-K in O(N log K) time, or sort all hotels if K is large. Discuss trade-offs.
Mention precomputation, caching, normalization, and handling ties. Consider scalability and real-time updates.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.