Loading LLD design...
Design an object-oriented cricket scoring and information system (CricInfo) that supports player and team management, match scheduling (T20/ODI/Test), ball-by-ball score recording, real-time scorecard generation, and aggregated player statistics.
Each delivery (Ball) captures runs, extras (wide, no-ball, bye, leg-bye), dismissal type (bowled, caught, LBW, run-out, etc.), and involved players. Overs track legal deliveries (6 per over, extras don't count). Innings end on all-out or overs exhausted. Batting and bowling scorecards are maintained per innings with strike rate, economy, and other derived metrics.
Manage players
Register players with role, batting style, bowling style
Create teams
Create teams, add squad, set Playing XI and captain
Schedule match
Schedule a match (T20/ODI/Test) between two teams at a venue
Record toss
Record toss winner and BAT/BOWL decision
Record ball-by-ball
Core operation: record each delivery with runs, extras, wickets, dismissal type
Live scorecard
View current score, batting/bowling scorecards in real-time
Innings management
Start/end innings, track overs, detect all-out / overs-complete
Player statistics
Aggregate batting and bowling stats across matches
Match result
Determine and record match result (win by runs / wickets)
Before diving into code, clarify the use cases and edge cases. Understanding the problem deeply leads to better class design.
Identify the primary actions users will perform. For a parking lot: park vehicle, exit vehicle, check availability. Each becomes a method.
Who interacts with the system? Customers, admins, automated systems? Each actor type may need different interfaces.
What are the limits? Max vehicles, supported vehicle types, payment methods. Constraints drive your data structures.
What happens on overflow? Concurrent access? Payment failures? Thinking about edge cases reveals hidden complexity.