Senior Software Engineer Interview Questions in Bangalore, India | Glassdoor.co.in

# Senior Software Engineer Interview Questions in Bangalore

3,408

Senior software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Senior Software Engineer at Goldman Sachs was asked...

8 Sep 2009
 Classix 2 eggs problem . * You are given 2 eggs. * You have access to a 100-storey building. * Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical. * You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking. * Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process6 AnswersThis is a BS question to begin with bc gravity will max the egg's speed out at 9.8m per second, whether it be the 1st or 100th floor. BUT, I know what they are intending to ask... The answer is 14. n(n+1)/29.8m/sec^2 is the acceleration due to gravity, not velocity. No falling object can ever achieve terminal velocity, as you incorrectly stated. Secondly, although your answer is correct, your formula is wrong. The general form is ceiling[ (sqrt(8n+1)-1) / 2], with n = # of stories.use first egg to reduce the problem half size and then use second egg progressively to find answer. 100/2 then 50/2 then 25/2 then 13/2 then 7/2 then 4/2 then2/2 but while you start start dropping in reverse order from first, second...Show more responsesuse first egg to reduce the problem half size and then use second egg progressively to find answer. 100/2 then 50/2 then 25/2 then 13/2 then 7/2 then 4/2 then2/2 but while you start start dropping in reverse order from first, second... Otherwise simple mathematical inequality eqn q(q+1)/2>=100 will solve the problem.Lets assume you divide the floors into y partitions of size x each. The least value of y gives the best solution: here, x^y +x-1 =99 for the worst case best satisfactory ans.The problem is harder as you are only allowed to throw 2 eggs. Thus, the second throw operation is a linear operation. Thus, the problem is reduced to finding a solution which requires minimum number for 2nd linear throw. Let's say that x is the optimal number of throws required. And, for time being let's say x=20. Then, You would do the first throw from 20th floor and if egg breaks you would do a linear operation of throws from 1st to 20th floor to find which floor the egg breaks. However, if the egg doesn't break then you will throw from 39th floor, as you are now one throw less. Following this logic 20 39 57 73 88 102 but you only have 100 floors thus this is not the right answer. x + (x-1) + (x-2) + ... + 1 = 100 x(x+1)/2=100 which gives x=14 which is the optimal number of throws required.

### Senior Software Engineer at Amazon was asked...

2 May 2012
 Given the daily stock prices of a share during last 30 days, write a program to find out best buying and selling dates for maximum gain. The program should run with O(n) complexity.4 Answersfind the difference of price change on everyday and store it in an array. i.e., something like: [2,0,-3,6,-1] Now find the sub array which has the more sum. http://en.wikipedia.org/wiki/Maximum_subarray_problem@devsathish, I do not think so! Consider : {1,-4,5,6,-3,9,1,7} Maximum_subarray_problem would select {5,6,-3,9,1,7} where as the logical index for buying should be 1 and 5 respectively.Much much simpler in O(n) Just make a new array which contains the "lookahead" view, where we can see, which potential highest value we can gaini in future. Another array just contains the lowest value so far. When the difference between the two arrays is max, there is the buying point. Selling point is, when the falling edge of the max array is reached. public void highestGain(int[] prices) { int[] maxPrices = new int[prices.length]; int[] minPrices = new int[prices.length]; maxPrices[maxPrices.length-1] = prices[prices.length-1]; minPrices[0] = prices[0]; for(int i = 1; i maxPrices[sellPos]) { sellPos --; break; } } System.out.println("Ideal to buy/sell: " + maxDifferencePos + ":" + sellPos); }Show more responsessdgdfsh

### Senior Software Engineer at Intuit was asked...

10 Aug 2013
 After Round 2 I Asked Interviewer How he would Solution for Above mentioned Q1 & Q2 questions of the Round 2 Technical Interview. Very Smartly Interviewer Did not take any effort to answer and also told me find it out by myself :)6 AnswersI Have to Mention that HR's are so cool here. They were so friendly and nice with the candidates. In Organizing interviews, facilitating, arranging food for the candidates. I MUST appreciate their AWESOME efforts..!! GREAT JOB KEEP THE GOOD WORK GOING. CHEERS to you guys!!Regarding "( I Guess Interviewer also Not aware What he was asking ;) :P When he told sender is not aware of receiver hehehehe )" Have you heard about Middleware or ActiveMQ etc? Using message queues/ topics, sender and and receiver can communicate without knowing about each other, they need to know only about the destination. It is loose coupling of applications. Another way is to use DB tables for integration/communtication. Even here sender will not know about the receiver and vice versa. Don't make fun of people when you feel the question is stupid, because it is not the one who asked it, it is the one who don't know about it is the real stupid. Thanks.Have you seen implementation of Broadcast (receiver and sender) in Android platform that is an example of loosely coupled such system and it will be working like [Sender] [Middleware platform] [Receiver] here middleware ie android frame work is aware of both sender and receiver but not these two component know about each other (receiver and sender are two component here)Show more responsesThe simple such kind of implementation is a broadcast communication over port, like twitter facebook or any share trading exchange works, that is port broadcasting (Twitter, facebook use the similar concept but not the port broadcasting), this can also be refer as observable pattern, I am also agree with the above answers specially with Srikanth'sIf you Factory Design Pattern then Sender will not know the receiver other than creating object for the Factory method ... like that we can use Buisiness delegate pattern and service pattern....The command design pattern to some extent is also a example of this kind of behavior where invoker and implementer are decoupled. So this is a very common scenario for loosely coupled architecture. I think that you should be aware that designs and patterns are evolving at a rapid rate and there would be various technologies to support this kind of behaviour

### Senior Software Engineer at Oracle was asked...

10 Feb 2011
 Find 2 or more missing numbers in a set of 100 natural numbers6 AnswersLook at the numbers and pick the highest one. That will be your salary.Sort numbers lowest number = salary print "your salary is" salaryC = U + Rr / Y Where C = natural number U = the universal constant Rr = local variable Y = years of serviceShow more responsesCreate code that sorts the numbers and then write an algoirthm to check to see if the increments between each number is equal to 1. If not, then add 1 to the previous number to get the missing number. Birdie num num.Since its 100 natural numbers the sorting can be done using an array/counting sort in constant time O(100). Now iterate and find the missing elements.Sort the array..create two subarrays with =50 and check count of each array..the one which is sorted..pass it to method which divides it to 1/2 again..

### Senior Software Engineer at Akamai was asked...

6 Sep 2010
 How to remove a element from a single linked list a 3rd element when only the reference of it is given.2 AnswersAs you cant traversce in linked list back so we have to copy the content of next value in list to the current node(node to be removed)void removeElement(node n) { n.data = n.next.data; n.next=n.next.next; }

### Senior Software Engineer at Accenture was asked...

28 Jun 2010
 How did you deal with handling various ppl within the team2 Answers1:1 meetings, activities etcLet me just say how much I missed my full capacity iPhone while dealing with fellow employees overseas.. In the war of "Internet in my pocket", blackberry loses big..

### Senior Software Engineer at Curam Software was asked...

8 Sep 2010
 How many design patterns you know and list them2 AnswersLater tells me i am looking for few specific wordsThere are 5 Design Patterns: 1. The Factory Method - provides a simple decision making class that returns one of several possible subclasses of an abstract base class depending on the data that are provided. 2. The Abstract Factory Method - provides an interface to create and return one of several families of related objects. 3. The Builder Pattern - separates the construction of a complex object from its representation, so that several different representations can be created depending on the needs of the program. 4. The Prototype Pattern - starts with an initialized and instantiated class and copies or clones it to make new instances rather than creating new instances. 5. The Singleton Pattern - is a class of which there can be no more than one instance. It provides a single global point of access to that instance.

### Senior Software Engineer at Intuit was asked...

25 Oct 2013
 What is the test process followed by you? Write pseudo code for fibanocci series? Not much technical questions. 2 AnswersFirst round is to analyze, whether candidate is match for openingWhat kind of questions were asked in telephonic interview?

### Senior Software Engineer at EMC was asked...

27 Oct 2012
 In third technical round the interviewer asked me to write an algorithm to sort an array of integers which has only tow values 0 and 1 without using second loop and with best possible time complexity.2 AnswersI was able to write the algorithm.Your solution is really very helpful "I was able to write the algorithm" - congratulations, you got an "A+". However, were you afraid to divulge the solution because it may be proprietary or patentable? I, on the other hand have no such problems and following is my solution: void sort_01_arr(int *pArr, size) { int front = 0; //Sort array in ascending order, 0's first followed by 1's // Scan from the beginning looking for 1, when found scan from the end // looking for 0. If both found before crossing, swap the contents. // Continue until respective array indices (front and size) are equal or cross while(front< size) { if(pArr[front]) { // 1 if(pArr[size] == 0) { // 0 pArr[front++] = 0; pArr[size--] = 1; } else { --size; } } else { ++front; } } // elihw return; } Of course unarguably the simplest solution would be to have 2 passes through the array. In the first pass count how many 0's are present, and in the second pass just write that many 0' from the beginning of the array and then starting with the next element write 1's into the remaining elements.

### Senior Software Engineer at Cerrid Solutions was asked...

2 Jun 2014
 They were not sure what to ask actually. I found the interviewers like school kids. Hardly 1-2 yrs experienced people.2 AnswersMade a mistake to appear for the interview. Came out in the middle of the process.We will look into it and make sure senior guys are interviewing the experience resources. It was miss from our side as many interviews going in parallel. But if you are really interested and want to see the knowledge of our senior resources then I will request you to come once and interact with our senior technical guys.
110 of 3,408 Interview Questions