Senior Software Developer Interview Questions

98,030 senior software developer interview questions shared by candidates

1. How can you manage thousands of requests at the same time? All the requests cannot be processed at the same time. How are you gonna keep them waiting? Explain the architecture. 2. A global variable `x` is initialized to `0`. A function `f()` has a loop which runs from i=0 to 5 and increments value of `x` at each iteration. If `f()` is called once, when `f()` completes, the value of `x` will be 5. Now in our `main()` function, we create another loop which runs from j=0 to 5 and create a new thread in each iteration, and each thread calls `f()`, what is the maximum and minimum possible value of `x` after this loop ends? 3. I had a project on my resume in which I had implemented traffic distribution to different servers using percentages. For ex. if I have 3 servers A,B and C and I need to distribute 20,50 and 30% of traffic to each respectively, I could configure my system to do that distribution approximately. It is possible that there may be fluctuation of 3-4% at the end of the day in the distribution. So instead of A getting 20%, it gets only 18% while C gets 32% of the traffic. So the interviewer asked me to implement a system that distributes traffic to my servers strictly as configured and not approximately. Then also added a use case that what happens if I introduce a server D and want to divert exactly 1000 requests to it per hour? Not percentage wise but request count wise this time. 4. A new user signs up and a new integer id is to be assigned to a newly created user. And this needs to happen in parallel. And needs to be replicated across 5 data centers. Design a system to do the same. 5. Design an elevator system. Draw class diagram for same. The elevator system of the office building was very high-tech. If you are at elevator labelled `G` and you press the up button, you won't necessarily get elevator `G` but you might end up getting elevator labelled `F` if `F` is nearer.
avatar

Senior Software Engineer

Interviewed at Agoda

3.9
Oct 28, 2019

1. How can you manage thousands of requests at the same time? All the requests cannot be processed at the same time. How are you gonna keep them waiting? Explain the architecture. 2. A global variable `x` is initialized to `0`. A function `f()` has a loop which runs from i=0 to 5 and increments value of `x` at each iteration. If `f()` is called once, when `f()` completes, the value of `x` will be 5. Now in our `main()` function, we create another loop which runs from j=0 to 5 and create a new thread in each iteration, and each thread calls `f()`, what is the maximum and minimum possible value of `x` after this loop ends? 3. I had a project on my resume in which I had implemented traffic distribution to different servers using percentages. For ex. if I have 3 servers A,B and C and I need to distribute 20,50 and 30% of traffic to each respectively, I could configure my system to do that distribution approximately. It is possible that there may be fluctuation of 3-4% at the end of the day in the distribution. So instead of A getting 20%, it gets only 18% while C gets 32% of the traffic. So the interviewer asked me to implement a system that distributes traffic to my servers strictly as configured and not approximately. Then also added a use case that what happens if I introduce a server D and want to divert exactly 1000 requests to it per hour? Not percentage wise but request count wise this time. 4. A new user signs up and a new integer id is to be assigned to a newly created user. And this needs to happen in parallel. And needs to be replicated across 5 data centers. Design a system to do the same. 5. Design an elevator system. Draw class diagram for same. The elevator system of the office building was very high-tech. If you are at elevator labelled `G` and you press the up button, you won't necessarily get elevator `G` but you might end up getting elevator labelled `F` if `F` is nearer.

Hackerrank coding question: You are given 2 arrays: one representing the time people arrive at a door and other representing the direction they want to go(in or out) You have to find at what time each person will use the door provided no 2 people can use the door at the same time. Constraints: the door starts with ‘in’ position, in case of a conflict(2 or more people trying to use the door at the same time), the direction previously used holds precedence. If there is no conflict whoever comes first uses the door. Also if no one uses the door, it reverts back to the starting ‘in’ position. Should be linear time complexity. If you solve this, please comment with how much time you think you would need to solve this in an interview and your yoe.. just wondering
avatar

Senior Software Engineer

Interviewed at Fivetran

3.6
Mar 27, 2020

Hackerrank coding question: You are given 2 arrays: one representing the time people arrive at a door and other representing the direction they want to go(in or out) You have to find at what time each person will use the door provided no 2 people can use the door at the same time. Constraints: the door starts with ‘in’ position, in case of a conflict(2 or more people trying to use the door at the same time), the direction previously used holds precedence. If there is no conflict whoever comes first uses the door. Also if no one uses the door, it reverts back to the starting ‘in’ position. Should be linear time complexity. If you solve this, please comment with how much time you think you would need to solve this in an interview and your yoe.. just wondering

Viewing 751 - 760 interview questions

Glassdoor has 98,030 interview questions and reports from Senior software developer interviews. Prepare for your interview. Get hired. Love your job.