← Atlassian Interview Insights
Start by clarifying requirements: define engagement signals, time windows, and what 'top' means (e.g., weighted score). Then propose a scalable architecture that ingests events, computes scores in near real-time or batch, and serves top-N efficiently, discussing trade-offs between freshness, cost, and complexity.
Pro tip: Emphasize the need for a configurable scoring function and pre-aggregation to avoid recomputing from raw events on every query; mention using a lambda architecture or a streaming pipeline with a serving layer like Redis for low-latency reads.
Ask questions to understand expected scale (number of posts, events per second), latency requirements (real-time vs. hourly), and how engagement signals should be weighted. Define configurable time windows (e.g., last 24 hours, last 7 days).
Model events (view, like, comment) with timestamps and post IDs. Propose an ingestion pipeline using a message queue (e.g., Kafka) to handle high throughput and decouple producers from consumers.
Design a scoring function (e.g., weighted sum) and compute scores either in batch (e.g., Spark) for historical windows or in stream (e.g., Flink) for real-time updates. Use pre-aggregation to reduce computation.
Store computed scores in a fast lookup store (e.g., Redis sorted sets) and maintain top-N per time window. Serve queries with low latency, possibly using a cache and periodic refresh.
Discuss trade-offs: batch vs. stream (freshness vs. cost), exact vs. approximate top-N (e.g., using count-min sketch), and how to handle hot posts and skewed data. Mention partitioning and sharding for scalability.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.