Senior Software Interview Questions

75,489 senior software interview questions shared by candidates

1. You have n doors in a row that are all initially closed. You make n passes by the doors starting with the first door every time. The first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6. third pass you toggle 3rd, 6th, 9th door. What state are the doors in after the last pass? which doors are open ?
avatar

Senior Software Engineer

Interviewed at LinkedIn

3.8
Apr 5, 2017

1. You have n doors in a row that are all initially closed. You make n passes by the doors starting with the first door every time. The first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the second time you only visit every 2nd door (door #2, #4, #6. third pass you toggle 3rd, 6th, 9th door. What state are the doors in after the last pass? which doors are open ?

Debugging + System design: We wrote a simple (single-threaded) web crawler. Given a starting URL, it visits every reachable page. For each page, it determines the URLs of every static asset (images, javascript, stylesheets) on that page. The crawler returns a list with an entry for each crawled page and a listing of URLs for the assets found in that page.
avatar

Senior Software Engineer

Interviewed at GoCardless

3.7
Feb 2, 2021

Debugging + System design: We wrote a simple (single-threaded) web crawler. Given a starting URL, it visits every reachable page. For each page, it determines the URLs of every static asset (images, javascript, stylesheets) on that page. The crawler returns a list with an entry for each crawled page and a listing of URLs for the assets found in that page.

Given a list of integers A and an integer k, return the number of unique pairs of integers in A that sum to k. For example, if A=[1 2 5 5 10 8 2] and k=10, the answer is 2, arrived as 5+5 or 2+8. There were 15 tests for this question, with at least the last two timing out, given that the implementation was not as efficient as possible.
avatar

Senior Software Developer

Interviewed at Bloomberg

4
Aug 7, 2016

Given a list of integers A and an integer k, return the number of unique pairs of integers in A that sum to k. For example, if A=[1 2 5 5 10 8 2] and k=10, the answer is 2, arrived as 5+5 or 2+8. There were 15 tests for this question, with at least the last two timing out, given that the implementation was not as efficient as possible.

Asked to write a method were it's passed an array of numbers and a single number. I needed to return true if there was two numbers in the array that if added totaled the single number. I was then asked to rewrite it to make it run faster.
avatar

Senior Software Engineer

Interviewed at Amazon

3.5
Mar 4, 2014

Asked to write a method were it's passed an array of numbers and a single number. I needed to return true if there was two numbers in the array that if added totaled the single number. I was then asked to rewrite it to make it run faster.

One bridge, 4 people. A, B, C, D. A takes 2 mins to cross the bridge, B 4 mins, C 8 mins, D 16mins. It is dark and 1 torch. So, 2 people need to cross the bridge at the same time, so that one person can bring back the torch for the next group to cross the bridge. The 2 pepole group walks at the pace of the slower walker. How to cross the bridge in the fasted way?
avatar

Senior Software Engineer

Interviewed at Roblox

3.7
Aug 20, 2011

One bridge, 4 people. A, B, C, D. A takes 2 mins to cross the bridge, B 4 mins, C 8 mins, D 16mins. It is dark and 1 torch. So, 2 people need to cross the bridge at the same time, so that one person can bring back the torch for the next group to cross the bridge. The 2 pepole group walks at the pace of the slower walker. How to cross the bridge in the fasted way?

# a list of strings. Each string is a management / report relationship. # # EXAMPLE INPUT: # # [ # 'B,E,F', # 'A,B,C,D', # 'D,G,I', # 'G,H' # ] So, write some code (pseudo or language of your choice, including SQL) for the following: A is the manager of B, C, D. B is the manager of E and F, and so forth. # EXAMPLE OUTPUT: # # A # ....B # ........E # ........F # ....C # ....D # ........G # ............H # ........I
avatar

Senior Software Engineer

Interviewed at Reddit

3.9
May 22, 2019

# a list of strings. Each string is a management / report relationship. # # EXAMPLE INPUT: # # [ # 'B,E,F', # 'A,B,C,D', # 'D,G,I', # 'G,H' # ] So, write some code (pseudo or language of your choice, including SQL) for the following: A is the manager of B, C, D. B is the manager of E and F, and so forth. # EXAMPLE OUTPUT: # # A # ....B # ........E # ........F # ....C # ....D # ........G # ............H # ........I

Viewing 71 - 80 interview questions

Glassdoor has 75,489 interview questions and reports from Senior software interviews. Prepare for your interview. Get hired. Love your job.