Flipkart Interview Question
SDE-2sCountry: India
Interview Type: In-Person
classes
global list of players.
User - list<players>
updatescore(player ply);
Players - map <matches, score>
list <user>
updateplayerscore(match m , score);
Notifyalluser()
Matches - map <players, score >
Notifyallplayers()
user will observe players
Players will observe matches.
matches will send notfiication to all players with score whoever
played matches.
player update their score and notify all the user to update their scoe
Design:
Tournament to Match [one to many]
Match to Player [Many to Many]
-A tournament class contains Arraylist<Match>
-Match class contains Arraylist<Player>, ArrayList<PlayerScore> and a event method.
-Player class contains Arraylist<Match>, totalPointForAllMatches and a event method to calculate scores
create a globalplayer as set.
- vikas May 22, 2014create a team class which is observer of player , player is observer for match
team has composite relation with players, player maintains reference to team to act as observable.
finally , match has list of current observable players to send update.