2 Design (data and architecture) and 1 Coding round. This text box is asking me to enter a minimum of 30 words, but I don't have that much, hence writing this. Please ignore.
We want to be able to give the user a breakdown of how much time, over the duration of the workout, they spent in each heart rate zone.
I.e., we want to be able to display the user a report like:
Great job on your 30-minute HIIT class! Here's a breakdown of how much time you spent in each of your heart rate zones:
To do so, we need to write a function to calculate how much time over the workout duration was spent in each heart rate zone.
We'll use 4 standard heart rate zones, which we can represent as a list of pairs:
If a user's heart rate falls on the border of the upper and lower range of a zone, we'll bucket them into the upper zone. For example, if we end up with a set of zones [(157, 185), (139, 157), (111, 139), (0, 111)], a heart rate of 157 will be considered in the (157, 185) heart rate zone.
Write a function "timeInHeartRateZonesForWorkout" given:
The function should return an array of seconds the exerciser spent in each heart rate zone, sorted from PEAK to WARM UP. If the exerciser did not spend any time in one of the four zones, return 0 for that zone.
For example, given an array of times and beats per minute:
[(49, 170), (50, 90), (60, 120), (70, 135), (100, 150), (300, 180), (400, 75)], a maximum heart rate of 185, and a workout duration of 500, the function should return [100, 200, 40, 160]. The exerciser spent 100 seconds in PEAK, 200 in CARDIO, 40 in FAT BURN, and 160 in WARM UP.
Interviewer Notes:
The following metrics were computed from 3 interview experiences for the Peloton Senior Software Engineer role in New York, New York.
Peloton's interview process for their Senior Software Engineer roles in New York, New York is extremely selective, failing the vast majority of engineers.
Candidates reported having very negative feelings for Peloton's Senior Software Engineer interview process in New York, New York.