Page 1 of 1

Train station Puzzle Interview Question

Posted: Fri Aug 31, 2018 7:17 am UTC
by bunny9
Hi,

I need help in solving the train station puzzle asked in technical interview.

Every day, Joe arrives at the train station from work at 6pm.
His wife leaves home in her car and meets him there at exactly 6pm, and drives him home. One day, Joe gets to the station an hour early, and starts walking home, until his wife meets him on the road. They get home 20 minutes earlier than usual.
How long was he walking?
Distances are unspecified. Speeds are unspecified, but constant.
Output a number which represents the answer in minutes.

Case 1 : Answer is a integer. Just put the number without any decimal places if its an integer. If the answer is Infinity, output Infinity.
Case 2 : Floating point number. Round it off to 2 decimal places and output it as I.xx where I is the integer part of the answer, and xx are 2 decimal digits after rounding off.


Source - InterviewBit

Thanks in advance!

Re: Train station Puzzle Interview Question

Posted: Fri Aug 31, 2018 8:51 am UTC
by jaap
It's easy once you see it.

Spoiler:
His wife is obviously also home twenty minutes early.
This means she saved 10 minutes drive both ways to/from the station.
So she met him when she had still 10 minutes to go to the station, i.e. at 5:50pm.
He was walking from 5 till 5:50, so 50 minutes.

Re: Train station Puzzle Interview Question

Posted: Sun Sep 02, 2018 5:53 am UTC
by Bloopy
Spoiler:
The 20 minutes saved is the time his wife would've spent driving from the spot they met on the road to the station, and back to that spot again. So, 10 minutes in each direction, meaning they met at 5:50pm after he'd been walking for 50 minutes.
Sometimes I literally have to see these ones. I scribbled a distance/time graph to make sense of it.

Re: Train station Puzzle Interview Question

Posted: Sun Sep 02, 2018 9:04 am UTC
by Sableagle
I didn't actually solve this properly. I thought of a "what if" and it worked:

Spoiler:
What if the point where she met him on the road was outside their house, as she was about to get into the car?