I interviewed for a Software Engineer role at ServiceNow in . The HR representative was very polite and explained the interview process, which would consist of two technical rounds focused on Data Structures and Algorithms (DSA) followed by an HR/Managerial round. I only completed the first technical round.
The two questions asked were not very specific to DSA. The interviewer was primarily assessing my design and implementation skills in real-world scenarios.
When I began explaining the time complexity, the interviewer mentioned that it was not about optimization but rather about understanding the fundamental formula D = T/S.
The second question involved allocating seats in a train compartment where a group of family members wanted to book seats facing each other. The seating arrangement was as follows:
1,2,3 - 4
5,6,7 - 8
For example, if six seats needed to be allocated together, the eligible seats would be 1, 2, 3 and 5, 6, 7 since they face each other. Seats 4 and 8 would not be eligible in this case. We could not utilize them, but if only two people needed to book seats, then only the 4, 8 pair would be eligible. The seating arrangement represents a section, and we cannot allocate partial seats between two different sections (at a time, six seats can be booked). We can have up to 72 seats, like in a train compartment.
I provided a solution in a single function, using mathematical calculations to map the number of people, such as using %8 for section check, %4 for side lower and side upper seats, and +4 increments. I iterated over the seats linearly.
During feedback, the interviewer suggested that instead of using mathematical calculations, I could have implemented sections and compartments as classes to represent real-world entities.
Verdict: I was not selected.
Learning: Even though you are solving DSA problems, try representing things as classes to model real-world entities. You do not need to revise all the physics formulas for technical rounds. I do not think this would make sense for a Software Engineer role.