coding-exercises
coding-exercises copied to clipboard
Incorrect schedule time for taking Jacket Potato out of microwave
As per req for Sandwich
I can make a sandwich in one minute and then I need 30 seconds to serve the sandwich and take money from the customer.
tasks are
4:00 serve sandwich 3
4:30 make sandwich 4 <<< make as soon as previous one is served (30 secs from start of serving)
5:30 serve sandwich 4 <<< serve as soon as it is made (1 min)
16:00 take a well earned break! << break as soon as served (30 secs)
As per requirement for Jacket potatoes(JP)
Jacket potatoes are pre-baked but need to be heated in a microwave for 2 and half minutes. I then need 30 seconds to top them and 30 seconds to serve them.
0:00 Put jacket potato in microwave
0:01 Make sandwich 1
<truncated>
2:31 Serve sandwich 2
3:01 take jacket potato out of microwave << as soon as SW 2 is served
3:31 top jacket potato << as soon as JP is taken out of MW (30 secs ???)
4:01 serve jacket potato << as soon as topping is done i.e 30 secs
4:31 take a break! << as soon as serving is done i.e 30 secs
Looks like putting JP into MW takes only 1 sec but taking JP out takes 30 secs which is not mentioned in the requirement either? Is it deliberate ?
Looks like you're correct, 3:01 should be remove and top jacket potato and then all subsequent timings should be shifted back by 30s. Have you submitted a correction PR?
In an actual interview you would be able to discuss ambiguities in the statement with the interviewer but I realise that sometimes these problems get used for other things.