Tip 1: Practice at least 250 data structure and algorithm questions to build strong problem-solving skills.
Tip 2: Build and deploy at least 2 real-world projects to showcase practical development experience.
Tip 3: Revise core CS subjects like Operating Systems, DBMS, and Computer Networks regularly for interview readiness.
Tip 1: Include 1–2 solid projects that demonstrate your skills and link them to GitHub or live demos.
Tip 2: Avoid adding anything you cannot explain confidently during the interview.
Tip 3: Tailor your resume for each job by including keywords from the job description.
There was 1 coding question.



Given schedule of trains and their stoppage time at a Railway Station, find minimum number of platforms needed.
Note –
If Train A’s departure time is x and Train B’s arrival time is x, then we can’t accommodate Train B on the same platform as Train A.
Constraints
1 <= N <= 10^5
0 <= a <= 86400
0 < b <= 86400
Number of platforms > 0
Input
First line contains N denoting number of trains.
Next N line contain 2 integers, a and b, denoting the arrival time and stoppage time of train.
Output
Single integer denoting the minimum numbers of platforms needed to accommodate every train.
Example 1
Input
3
10 2
5 10
13 5
Output
2
Explanation
The earliest arriving train at time t = 5 will arrive at platform# 1. Since it will stay there till t = 15, train arriving at time t = 10 will arrive at platform# 2. Since it will depart at time t = 12, train arriving at time t = 13 will arrive at platform# 2.
Example 2
Input
2
2 4
6 2
Output
2
Explanation
Platform #1 can accommodate train 1.
Platform #2 can accommodate train 2.
Note that the departure of train 1 is same as arrival of train 2, i.e. 6, and thus we need a separate platform to accommodate train 2.
Step 1:
I first calculated the departure time for each train as departure = arrival + stoppage.
This gives the full time window the platform is occupied for each train.
Step 2:
Initially, I thought of using a brute force approach, checking overlaps by comparing each train's time window with every other — but this took O(N²) time, which is not efficient for large N.
Step 3:
To optimize, I separated arrival and departure times into two different arrays, then sorted both arrays independently.
Step 4:
I used a two-pointer approach:
One pointer (i) for arrival times and one (j) for departure times.
As I moved through the timeline:
If the current arrival was before the current departure, it meant a new platform was needed.
If the current arrival was equal to or after the current departure, it meant one platform was freed.
I kept track of the maximum number of platforms used at any time, which gave the final result.
Step 5:
I tested with sample inputs, and the optimized approach handled large inputs (up to 10⁵) efficiently with a time complexity of O(N log N) due to sorting.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Providing input/output examples in your prompt is a technique called: