Senior Software Engineer Java Interview Questions

95,558 senior software engineer java interview questions shared by candidates

Imagine you have only two eggs and a 100 story building in front of you. Describe an algorithm (or technique) to minimize the number of throws (or tries) to determine where the egg will start to break when thrown off the building. If the egg breaks when thrown from that floor, it will always break from that floor or higher (i.e. all eggs have the same results per floor; they break or they don't).
avatar

Senior Software Engineer

Interviewed at Adobe

4.1
Mar 9, 2017

Imagine you have only two eggs and a 100 story building in front of you. Describe an algorithm (or technique) to minimize the number of throws (or tries) to determine where the egg will start to break when thrown off the building. If the egg breaks when thrown from that floor, it will always break from that floor or higher (i.e. all eggs have the same results per floor; they break or they don't).

We have m slots for ads and n ads, each ads will have different revenue on differnet slot, design an algorithm to find out the best fit (find m ads in n ads and order them so that they can make max money, white board coding) .
avatar

Senior Software Engineer

Interviewed at Google

4.4
Jan 15, 2011

We have m slots for ads and n ads, each ads will have different revenue on differnet slot, design an algorithm to find out the best fit (find m ads in n ads and order them so that they can make max money, white board coding) .

What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example
avatar

Senior UI Developer

Interviewed at ValueLabs

4
Feb 16, 2018

What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example

Viewing 151 - 160 interview questions

Glassdoor has 95,558 interview questions and reports from Senior software engineer java interviews. Prepare for your interview. Get hired. Love your job.