FastPrepMinimum Railway Platforms
Problems/Minimum Railway Platforms

Minimum Railway Platforms

MakeMyTrip.com logoMakeMyTrip.com● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a MakeMyTrip.com onsite interview. The report names the well-known task of finding the fewest platforms. We made clear how to order events at the same time and added limits. Our version is about 95% the same as the reported question.

Given equal-length arrays of train arrival and departure times, return the minimum number of station platforms required so that no train waits.

Each pair at the same index describes one train. Time values are comparable integers on one day. If one train arrives at the exact time another departs, both occupy a platform at that instant, so the arrival is processed first.

Function

minimumPlatforms(arrivals: int[], departures: int[]) → int

Examples

Example 1

arrivals = [900,940,950,1100,1500,1800]departures = [910,1200,1120,1130,1900,2000]return = 3

Three trains overlap around time 1100.

Example 2

arrivals = [900,1100,1235]departures = [1000,1200,1240]return = 1

No two train intervals overlap.

Constraints

  • 1 <= arrivals.length == departures.length <= 200000
  • 0 <= arrivals[i] <= departures[i] <= 10^9
  • All times belong to one comparable timeline.

Source note: Interview prompt excerpt preserved as source evidence.

More MakeMyTrip.com Onsite Interview questions

  • Bounded Producer–Consumer QueueONSITE INTERVIEW · Seen Sep 2026
  • Count Subarrays with Sum KONSITE INTERVIEW · Seen Sep 2026
  • Detect a Cycle in a Directed GraphONSITE INTERVIEW · Seen Sep 2026
  • Parallel Workers with a Per-Phase BarrierONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Maximum Non-Overlapping IntervalsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Minimum Removals for Non-Overlapping IntervalsByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Minimum Workers with Job AssignmentsLyft · ONSITE INTERVIEWLyft interview questions
  • Minimum Points Hitting Every Closed IntervalGoogle · ONSITE INTERVIEWGoogle interview questions
  • Minimum Removals for Non-Overlapping IntervalsBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
  • Maximum Compatible Time WindowsIBM · OAIBM interview questions
  • Task SchedulingJP Morgan Chase · OAJP Morgan Chase interview questions
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions
  • Minimum Appointment Cancellations with a Required BreakMaven Clinic · PHONE SCREENMaven Clinic interview questions
  • Minimum Markers to Clear Line SegmentsHSBC · OAHSBC interview questions
All MakeMyTrip.com interview questionsSee MakeMyTrip.com hiring insights
Saved
class Solution {
    public int minimumPlatforms(int[] arrivals, int[] departures) {
        // Write your code here.
    }

}
Checking account…