Senior Software Developer Interview Questions

71,758 senior software developer interview questions shared by candidates

Imagine you are given 10,000 files each containing 1 Million integers. I would you sum all of them and give the final result? ---> Interviewer wanted to test scalability, distributed concepts. He has written the basic code and wanted to improve upon that. Here's the basic code. public getSum(String[] file_names) { int sum = 0; for(String f: file_names) { sum = sum + sumOfFile(f); } return sum; } Questions: What's wrong with above code? Ans: Integer overflow How would you implement sumOfFile? What if 'sumOfFile' takes lot of time to finish computing? How do you fasten the program?
avatar

Senior Software Engineer

Interviewed at Google

4.4
Mar 30, 2017

Imagine you are given 10,000 files each containing 1 Million integers. I would you sum all of them and give the final result? ---> Interviewer wanted to test scalability, distributed concepts. He has written the basic code and wanted to improve upon that. Here's the basic code. public getSum(String[] file_names) { int sum = 0; for(String f: file_names) { sum = sum + sumOfFile(f); } return sum; } Questions: What's wrong with above code? Ans: Integer overflow How would you implement sumOfFile? What if 'sumOfFile' takes lot of time to finish computing? How do you fasten the program?

Viewing 2241 - 2250 interview questions

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