Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction 
2.
Problem Statement
3.
Solution
4.
Frequently Asked Questions
4.1.
What are logical skills from the perspective of puzzles? 
4.2.
Why do we do puzzles in interviews?
4.3.
What is a puzzle interview?
4.4.
What are some of the most typical puzzles posed during an interview?
4.5.
Will puzzles be asked in interviews all the time?
5.
Conclusion
Last Updated: Mar 27, 2024

Train Station

Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @
Interview Puzzles

Introduction 

Puzzles develop memory skills and an ability to plan, test ideas, and solve problems. While completing a puzzle, we need to remember the shapes, colors, positions, and strategies to achieve them. 

Train Station is a very famous riddle that requires the person to think outside the box critically. The answer to this type of result may be evident to many, but most could not come up with it on their first try. Let's give it a go and see how to solve this problem.

Problem Statement

Every day, Peter arrives at the train station from college at 6 pm.

His dad leaves home in his car, meets him there at exactly 6 pm, and drives him home. One day, Peter gets to the station an hour early and walks home until his dad met him on the road. They get home 20 minutes earlier than usual.

How long was Peter walking?

Distances are unspecified. Speeds are unspecified but constant.  

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Solution

There are no specific distances mentioned in the problem between any two points which also includes the distance between the Train Station and Peter's House. We will have to solely rely on possible scenarios and make assumptions to try to come up with the best possible solution to this problem. So let's try examining different cases: 

  • Peter lives at the train station. But this doesn't make much sense because his dad's round trip can't decrease by 20 minutes if it is already zero.
  • Let us assume that Peter's Dad takes ‘X’ minutes to get to the station from his house so the round trip time would be 2X minutes. Peter arrives at the station at 5:00 PM and starts to walk home and reaches his home 20 Minutes earlier than usual. If we assume that Peter reached his house just about the time his Dad was leaving to pick him up, that would imply that the Dad's round trip time which was 2X minutes be equal to 20 Minutes which would mean that Peter arrives at his house at 5:50 implying Peter walked from 5:00 PM to 5:50 PM

Therefore Peter is walking for 50 minutes. 

Check out this problem - 8 Queens Problem

Frequently Asked Questions

What are logical skills from the perspective of puzzles? 

Analyzing a situation and coming up with a reasonable solution is also known as logical thinking. It's a lot like critical thinking. Logical thinking employs reasoning abilities to objectively examine any issue, allowing for a sensible decision on how to continue. For example, if you're dealing with a problem at work, you'll utilize the information at hand and your logical thinking abilities to solve it.

Why do we do puzzles in interviews?

Usually, interviewers ask for puzzles to see how you go about solving a tricky problem. Most companies avoid asking it because most puzzles hinge on a single trick that a person can easily miss when he is having a bad or nervous day.

What is a puzzle interview?

Microsoft popularized the puzzle interview in the 1990s. Puzzle interviews ask the applicant to solve puzzles like "Why are manhole covers round?" or unusual problems like, "How would you weigh an airplane without a scale?".

What are some of the most typical puzzles posed during an interview?

Some of the most popular interview puzzles are:

  1. Crossing the Bridge Puzzle
  2. The Man in the Elevator Puzzle
  3. Heaven or Hell Puzzle
  4. Three Mislabeled Jars
  5. Gold Bar Cut Puzzle
  6. Man Fell in Well Puzzle
  7. Horses on a Race Track Puzzle
  8. Train Station

Will puzzles be asked in interviews all the time?

While most interviewers do not usually ask for puzzles, they are relatively frequent, and some interviews may even include specialized puzzle-solving parts. It's always a good idea to be prepared in case something happens.

Conclusion

This article discussed train stations with their solution. We understand how obvious the answer is, which requires some out-of-the-box thinking. 

Recommended Readings:


Also check out some of the Guided Paths on topics such as Interview Puzzles, Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Happy Learning!

Previous article
Fastest Horses
Next article
Measure Liquid by Cans
Live masterclass