C Software Engineer Interview Questions

3,494 c software engineer interview questions shared by candidates

At an airport, you have a timetable for arrivals and departures. You need to determine the minimum number of gates you’d need to provide so that all the planes can be placed at a gate as per their schedule. The arrival and departure times for each plane are presented in two arrays, sorted by arrival time, and you’re told the total number of flights for the day. Assume that no planes remain overnight at the airport; all fly in and back out on the same day. Assume that if a plane departs in the same minute as another plane arrives, the arriving plane takes priority (i.e. you'll still need the gate for the departing plane); Write a function that returns the minimum number of gates needed for the schedules you're given. Example: arr = {900, 940, 950, 1100, 1500, 1800} dep = {910, 1200, 1120, 1130, 1900, 2000} flights = 6 In this example the return value should be 3 since the schedules for at most 3 planes overlap. Arrive 9:00 ; 1 gate Depart 9:10 ; 0 gates Arrive 9:40 ; 1 gate Arrive 9:50 ; 2 gates Arrive 11:00 ; 3 gates Depart 11:20; 2 gates Depart 11:30 ; 1 gate Depart 12:00 ; 0 gates Arrive 15:00 ; 1 gate Arrive 18:00 ; 2 gates Depart 19:00 ; 1 gate Depart 20:00 ; 0 gates
avatar

C++ Developer

Interviewed at Fidessa

3.8
Jul 5, 2017

At an airport, you have a timetable for arrivals and departures. You need to determine the minimum number of gates you’d need to provide so that all the planes can be placed at a gate as per their schedule. The arrival and departure times for each plane are presented in two arrays, sorted by arrival time, and you’re told the total number of flights for the day. Assume that no planes remain overnight at the airport; all fly in and back out on the same day. Assume that if a plane departs in the same minute as another plane arrives, the arriving plane takes priority (i.e. you'll still need the gate for the departing plane); Write a function that returns the minimum number of gates needed for the schedules you're given. Example: arr = {900, 940, 950, 1100, 1500, 1800} dep = {910, 1200, 1120, 1130, 1900, 2000} flights = 6 In this example the return value should be 3 since the schedules for at most 3 planes overlap. Arrive 9:00 ; 1 gate Depart 9:10 ; 0 gates Arrive 9:40 ; 1 gate Arrive 9:50 ; 2 gates Arrive 11:00 ; 3 gates Depart 11:20; 2 gates Depart 11:30 ; 1 gate Depart 12:00 ; 0 gates Arrive 15:00 ; 1 gate Arrive 18:00 ; 2 gates Depart 19:00 ; 1 gate Depart 20:00 ; 0 gates

Viewing 1421 - 1430 interview questions

Glassdoor has 3,494 interview questions and reports from C software engineer interviews. Prepare for your interview. Get hired. Love your job.