LLD: Design Cricbuzz / ESPN Cricinfo
Requirements: Design a low-level system like Cricbuzz/ESPNcricinfo: model live matches, ball-by-ball scoring updates, player/team statistics, and support real-time score queries.
Design: Core classes: Match (teams, current innings, status), Innings (overs, current score, wickets), Ball/Delivery (runs, extras, wicket info) appended to an over, Player and Team with aggregated stats, and a ScoreUpdateService that appends new deliveries and recomputes derived state (current run rate, required run rate, batsman/bowler figures). Use the Observer pattern so subscribers (a live-scorecard view, push-notification service) get notified on each ball update without polling. Discuss how to keep ball-by-ball updates append-only (an event-sourced log of deliveries) so the current score/stats can always be recomputed/audited, and how concurrent updates during a live match are serialized safely (single writer per match, or an ordered event queue per match).