Design a Cricket Scoreboard Application
Problem Statement
Design the Low-Level Design (LLD) of a Cricket Scoreboard System — similar to what is used in live matches to track and display scores, overs, wickets, player statistics, and match results.
The system should handle the real-time update of match data, track player performance, and display current match status (like total score, overs, wickets, and run rate).
The goal is to model the core object-oriented classes and interactions, not the UI or database layer.
🎯 Goal
Design a modular, object-oriented Cricket Scoreboard Application that can:
✅ Functional Requirements
1. Match Setup
2. Innings Management
3. Ball-by-Ball Updates
4. Scoreboard Display
5. End of Match Summary
⚙️ Non-Functional Requirements
🧱 Key Classes to Design
ClassResponsibility
Match
Represents the entire match — teams, innings, format, and result.
Team
Holds team name, players, and current score.
Player
Represents a player with stats (runs, wickets, etc.).
BatsmanStats
Tracks a batsman’s individual performance.
BowlerStats
Tracks a bowler’s overs, runs conceded, and wickets.
Innings
Represents a single innings — tracks overs, runs, wickets, and batsmen.
Over
Holds details of six balls.
Ball
Represents one ball event (runs, extras, wicket).
Scoreboard
Responsible for displaying or returning match summary.
MatchController
Handles game flow, like starting match, updating score, and ending innings.
🧩 Suggested Class Relationships
1
2Match
3 ├── Team teamA
4 ├── Team teamB
5 ├── List<Innings> inningsList
6 ├── MatchType type (T20, ODI, TEST)
7 ├── MatchStatus status (ONGOING, COMPLETED)
8
9Team
10 ├── String name
11 ├── List<Player> players
12 ├── int totalRuns
13 ├── int wickets
14 ├── double oversPlayed
15
16Player
17 ├── String name
18 ├── Role role (BATSMAN, BOWLER, ALL_ROUNDER)
19 ├── BatsmanStats battingStats
20 ├── BowlerStats bowlingStats
21
22BatsmanStats
23 ├── runsScored
24 ├── ballsFaced
25 ├── fours
26 ├── sixes
27 ├── isOut
28
29BowlerStats
30 ├── oversBowled
31 ├── runsConceded
32 ├── wicketsTaken
33 ├── economyRate
34
35Innings
36 ├── Team battingTeam
37 ├── Team bowlingTeam
38 ├── List<Over> overs
39 ├── int totalRuns
40 ├── int wickets
41 ├── int extras
42
43Over
44 ├── List<Ball> balls
45 ├── Bowler bowler
46
47Ball
48 ├── int runs
49 ├── boolean isWicket
50 ├── ExtraType (NONE, WIDE, NO_BALL, LEG_BYE, BYE)
51 ├── Batsman striker
52 ├── Bowler bowler🔄 Example Flow
🧾 Scenario:
Ball 1: 1 run
Ball 2: 4 runs
Ball 3: Wicket
Ball 4: 0 run
Ball 5: 6 runs
Ball 6: 2 runs
Over Summary:
Runs = 13, Wickets = 1
Scoreboard:
India: 13/1 (1.0 overs)
🧮 Example Output
1
2{
3 "battingTeam": "India",
4 "score": "13/1",
5 "overs": "1.0",
6 "striker": "Rohit Sharma - 7(3)",
7 "nonStriker": "Virat Kohli - 6(3)",
8 "bowler": "Starc - 1.0-13-1",
9 "runRate": 13.0
10}🧠 Design Patterns to Use
⚡ Possible Extensions
✅ Final Summary:
Design a Cricket Scoreboard Application (LLD) that: