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 email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
- [TopTalent.in] Interview With Divanshu Who Got Into Google, Mountain View
- Google Interview Experience | Set 4
- 10 Most asked Questions from Java Programmers
- Google Interview Experience | Set 3 (Mountain View)
- [TopTalent.in] “It’s the best feeling of my life” says Krunal after cracking Google, Mountain View
- Sprinklr Internship Interview Experience
- Visa Interview Experience | Internship (On-Campus)
- TCS On campus Interview Experience
- OYO rooms Interview Experience (On-campus) for software engineer
- Importance of getting an Internship in college