The solution will be evaluated on following parameters.
Object Oriented Design aspects of the solution.
Overall coding practices.
Working test cases of the solution.
You can use Ant/Maven as build tools for the solution, Junit, Mockito or other testing frameworks.
You may also include a brief explanation of your design and assumptions along with your code.
Problem Statement: In a Formula-1 challenge, there are n teams numbered 1 to n. Each team has a car and a driver. Car’s specification are as follows:
– Top speed: (150 + 10 * i) km per hour
– Acceleration: (2 * i) meter per second square.
– Handling factor (hf) = 0.8
– Nitro : Increases the speed to double or top speed, whichever is less. Can be used only once.
Here i is the team number.
The cars line up for the race. The start line for (i + 1)th car is 200 * i meters behind the ith car.
All of them start at the same time and try to attain their top speed. A re-assessment of the positions is done every 2 seconds(So even if the car has crossed the finish line in between, you’ll get to know after 2 seconds). During this assessment, each driver checks if there is any car within 10 meters of his car, his speed reduces to: hf * (speed at that moment). Also, if the driver notices that he is the last one on the race, he uses ‘nitro’.
Taking the number of teams and length of track as the input, Calculate the final speeds and the corresponding completion times.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
- Software Engineer Interview at Google, Bangalore
- Google Interview Experience | Set 7 (For Software Engineering Intern)
- Google Interview Experience | Set 6
- Amazon Interview Experience | Set 317 (SDE-1 Off - Campus)
- 10 Most asked Questions from Java Programmers
- BankBazaar Interview Experience | Set 3
- Bloomberg Interview | Set 2 (Video Conference)
- Top 25 Interview Questions
- [TopTalent.in] Exclusive Rapid Fire Interview with Deepali Who Got Into Facebook
- [TopTalent.in] Interview With Divanshu Who Got Into Google, Mountain View
- Google Interview Experience | Set 4
- [TopTalent.in] “It’s the best feeling of my life” says Krunal after cracking Google, Mountain View
- Google Interview Experience | Set 3 (Mountain View)
- Google Interview Experience | Set 2 (Placement Questions)
- Google Interview Experience | Set 1 (for Technical Operations Specialist [Tools Team] Adwords, Hyderabad, India)