100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

How to Solve Trains Crossing Each Other Problems

Solve trains-crossing-each-other aptitude problems using relative speed rules and combined train lengths, with a worked example and practice questions.

mediumQ27 of 225 in Aptitude Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

When two trains cross each other, the relevant speed is their relative speed β€” the sum of both speeds if moving in opposite directions, or the difference if moving in the same direction β€” and the distance covered is the sum of both train lengths.

Two trains β€œcross” each other from the moment their fronts meet to the moment their rears separate, so the combined distance covered is always the sum of the two train lengths, regardless of direction. The critical variable is relative speed: opposite directions mean the trains close the gap faster, so relative speed = speed1 + speed2, while same-direction motion means the faster train only gains ground at the difference, so relative speed = speed1 βˆ’ speed2. Time to cross = (sum of lengths) / relative speed. As with all speed problems, ensure both speeds are converted to the same unit before combining them.

  • The sum-of-lengths rule applies regardless of direction
  • Choosing sum vs difference of speeds is the single decision point
  • Generalizes directly to two-body relative-motion problems beyond trains

AI Mentor Explanation

Two fielders running toward each other to field a ball close the gap at the combined sum of their speeds, reaching each other far faster than either could alone β€” that is opposite-direction relative speed. If instead one fielder is chasing another running the same way, the gap closes only at the difference of their speeds, since the trailing fielder gains ground slowly. Trains crossing each other work identically: opposite directions add speeds, same direction subtracts them, and the β€œcrossing” distance is the sum of both trains' lengths.

Worked example (opposite directions)

Step-by-Step Explanation

  1. Step 1

    Determine direction

    Opposite directions β†’ add speeds; same direction β†’ subtract speeds.

  2. Step 2

    Compute relative speed

    Convert both speeds to the same unit before combining.

  3. Step 3

    Sum both lengths

    Total distance to cross = length of train A + length of train B.

  4. Step 4

    Divide

    Time = total length / relative speed.

What Interviewer Expects

  • Correctly choosing sum vs difference of speeds based on direction
  • Adding both train lengths for the total crossing distance
  • Consistent unit conversion before combining speeds
  • Recognizing this generalizes to any two-body relative-motion problem

Common Mistakes

  • Adding speeds when trains move in the same direction (should subtract)
  • Using only one train's length instead of the sum of both
  • Converting only one speed to m/s and leaving the other in km/h
  • Confusing relative speed with average speed

Best Answer (HR Friendly)

β€œI first check the direction: if the trains move toward each other I add their speeds, and if they move the same way I subtract them, since that gives the relative speed at which the gap closes. Then I add both train lengths together because crossing only finishes once the two trains fully separate. Dividing the combined length by the relative speed gives the time to cross.”

Follow-up Questions

  • How does the formula change if the trains are moving in the same direction?
  • How would you find one train's speed if the other's speed, both lengths, and crossing time are known?
  • How does this generalize to two people walking toward or away from each other?
  • What happens to relative speed if one train is stationary?

MCQ Practice

1. Two trains, 150m and 250m long, move toward each other at 50 km/h and 70 km/h. Time to cross each other is approximately?

Relative speed = 120 km/h β‰ˆ 33.33 m/s. Total length = 400m. Time = 400/33.33 = 12s.

2. Two trains 100m each, moving in the same direction at 45 km/h and 36 km/h, take how long for the faster to completely pass the slower?

Relative speed = 45βˆ’36 = 9 km/h = 2.5 m/s. Total length = 200m. Time = 200/2.5 = 80s.

3. When two trains cross each other, the total distance covered equals?

Crossing ends only when the two trains fully separate, so total distance = length1 + length2.

Flash Cards

Relative speed, opposite directions? β€” Sum of both speeds.

Relative speed, same direction? β€” Difference of both speeds.

Crossing distance for two trains? β€” Sum of both train lengths.

Formula for time to cross? β€” Time = (length1 + length2) / relative speed.

1 / 4

Continue Learning