Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to find the minimum number of platforms required at a train station given arrival and departure times of trains

Hard

Problem Statement

Write a function to find the minimum number of platforms required at a train station given arrival and departure times of trains

Sample Input

arr = [900, 940, 950, 1100, 1500, 1800], dep = [910, 1200, 1120, 1130, 1900, 2000]

Sample Output

3

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import java.util.*; public class Main { public static int findPlatform() { int[] arr = {900, 940, 950, 1100, 1500, 1800}; int[] dep = {910, 1200, 1120, 1130, 1900, 2000}; // Your code here return 0; } }
Log in or sign up to run or submit your code.Log inSign up
Input
arr = [900, 940, 950, 1100, 1500, 1800], dep = [910, 1200, 1120, 1130, 1900, 2000]
Expected Output
3