← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a tennis game scoring system that tracks points and determines the winner.
This is Reddit's most frequently asked question - appears in almost every phone screen!
Background: Tennis scoring has unique rules:
Part 1 - Basic Scoring:
Implement addScore(player), getScore(), and getResult().
Part 2 - Human Readable Score: Convert numeric scores to tennis terminology:
Part 3 - Best of 5 Sets: Extend to track sets. A match is won by winning 3 out of 5 sets.
Part 4 - Set Class: Create a separate Set class to encapsulate set logic.
Note: Interviewer typically says you don't need to complete all parts.
Constraints: