ADP Interview Question for abcs
- 0of 0 votes
There are N friends sitting in a circle, they are numbered clockwise 1 to N. Game starts with- sarath.chalasani46 March 28, 2016 in India
player 1 receiving the ball. A player needs to pass the ball to other player based on some
1. if he is receiving ball for pth time,he passes that ball to persion L places to left if P is even
or L places right if P is odd.
2. if any player receives the ball M times then game is over.
First player 1 gets tha ball. since he has held the ball 1 time , he passes the ball to player 4,
who is two places to his right. this is player 4 first time holding the ball, so he gives it to
player 2, who passes it to player 5. player 5 then passes the ball to player3. who passes it
back to player 1.since player 1 has now held the ball 2 times, hepasses it to player 3, who
passes it to player 5, who then passes the ball to player 2. finally, player 2 passes the ball to
player 4, who then passes it to player 1. player 1 has now held the ball 3 times, and the game
| Report Duplicate | Flag | PURGE
Interview Type: In-Person
Open Chat in New Window