Interview Question for Java Developers
- 0of 0 votes
AnswersIn our game there is a carousel with 8 seats in the center of the screen. On the left side of the carousel, there is an
- emcho.coh March 05, 2015 in United States
additional seat labeled ‘Start’ and to its right, a seat labeled ‘Finish’. There are 4 kids on the carousel at random
seats. You have an avatar who is initially found in the ‘Start’ seat
Your goal is to move your avatar to the ‘Finish’ seat. You move your avatar using the ‘Jump’ button. When clicking
the button the nearest seat to the current seat of your avatar is considered: if this seat is vacant, your avatar will
move to this vacant seat and you get 10 points, if the seat is taken you lose a life point.
The challenge is that the carousel is constantly rotating clockwise. To be clear, the carousel rotation is smooth (not in
steps of a seat).
If your lives go to 0, the game ends. When you reach the ‘Finish’ seat, you get 50 points and the carousel increase its
rotation speed, now your goal is to go back to the ‘Start’ seat, and on it goes.
Tips & comments:
• The tricky part of the exercise is the spinning carousel. Of course the seat and people that are on the
carousel are moving in circles. There are two ways that you can implement this:
1. By thinking of the table as standing still and the seats as moving in circles.
2. Using affine transforms.
We suggest that you use the first approach as it will be simpler. The second approach has some advantages,
but use it only if you are familiar with it.| Report Duplicate | Flag | PURGE
Java Developer