Senior Software Engineer Interview Questions in India | Glassdoor

# Senior Software Engineer Interview Questions in India

"Senior software engineers are the most experienced member of a software team and usually carry the most responsibility and authority of that team. Because of this, interviews will be designed to find candidates who have expert knowledge of the field and years of experience as a software engineer. Expect to be asked tough technical questions and to give examples of previous projects that you have worked on."

## Top Interview Questions

Sort: RelevancePopular Date

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

Oct 13, 2012
 You are given a fixed number of 5 rupee, 10 rupee, 20 rupee and 50 rupee stamps. Now given an amount for sending a parcel, you should design an algorithm to come out with the minimum number of stamps that should be used for attaining that amount. For example, if the parcel costed 30 rupees, it could be attained using one 20 rupee stamp and one 10 rupee stamp OR using three 10 rupee stamps OR using one 20 rupee stamp and two 5 rupee stamps OR using one 10 rupee stamp and four 5 rupee stamps OR using two 10 rupee stamps and two 5 rupee stamps. However, the minimum number of stamps is the case of one 20 rupee stamp and one 10 rupee stamp where only two stamps are used. The case where no solution is possible should also be handled, for example, a parcel amount of exactly 33 rupees cannot be attained.9 AnswersThe solution is attained using dynamic programming. The basic idea is that the minimum number of stamps used for attaining an amount x, is 1+minimum of (minimum number of stamps for attaining x-5, minimum number of stamps for attaining x-10, minimum number of stamps for attaining x-20,minimum number of stamps for attaining x-50). You can try to solve this first by assuming that an unlimited number of 5 rupee, 10 rupee, 20 rupee and 50 rupee stamps are available. And then you can take into account that only a fixed number of these stamps are available.And what is the time involved to get this done? I really liked the question.Simple to read but involves good amount of logic. I ve written down the algorithm but i believe i took more time than i initially thought i would take.I understand what the interviewer is trying to test and I know how to solve it, but what about more realistic scenario where parcel postage cost would be beyond given values like 3 units of currency or 37 units of currency.Show More ResponsesIn this specific case, dynamic programming is overkill. There's a better optimal substructure here: The stamp with greatest value less than parcel cost minus stamp values already committed minimize the total of stamps.1. find the stamp <= cost from highest stamp cost 2. num of found_stamp = found_stamp/cost, rem_stamp = found_stamp % cost 3. Do 1, then 2 until rem_stamp ==0 (done) or rem_stamp < least stamp available (not possible case)In the previous ans, after step 3 if rem_stamp !=0, go back to step 1, find next_stamp < cost (but smaller than value of found_stamp in previous iteration)i=0; boolean solPossible = false; do { if(cost % notes[i] == 0) solPossible = true; else i++; } while(!solPossible && (ivoid sendParsal(int cost) { int[] avlstm={50,20,10,5}; int i=0; while(cost>=5) { while(cost>=avlstm[i]) { System.out.println(avlstm[i]); cost=cost-avlstm[i]; } i++; } if(cost!=0) { System.out.println("Solution not possible."); } }void Foo(int cost) { if (cost % 5 != 0) Console.WriteLine("Not possible"); else if (cost stampCosts = new List() { 50, 20, 10, 5 }; int count = 0; while (cost > 0) foreach (int stampCost in stamptCosts) if (cost >= stampCpst) { cost -= stampCost; Console.WriteLine("Stamp: " + stampCost); count++; break; } } Console.WriteLine("Count: " + count); }

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

Sep 19, 2010
 if there are 6 people in a team, how many handshakes will be there7 Answers15There will be 30 hand shakes. In total we have 6 people, so it will be 6 * (6-1) (i.e 1 person will shake hands with 5 people)15 A | B | C| D | E | F | A will perform 5 B will perform 4 C will perform 3 D will perform 2 E will perform 1 F ultimately hand shakes with everyoneShow More Responses6c2==6!/(2!*4!)=15lets consider A,B,c,d,e,f so a shakes hand with the other 5 ..b with oter 4 and so on so at last 5+4+3+2+1=1515 people handshakes at a time you have given 6 person first of all the peoples is arranged in row 6 number people have an 5 option for handshakes after that 6 number person out then total number of people 5 again....again....same procedure apply.......Each one will shake hand 5 times, 6x5 -> 30 times

Sep 8, 2009

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

May 2, 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

Jun 8, 2012

### Senior Software Development Engineer at Microsoft was asked...

Feb 20, 2012
 Probability of a knight making a valid move on NxN matrix in m steps.4 AnswersGiven in the description above.Guess what , I got almost the same question on my first interview with Google , and I was applying as a new college grad ....i also can up with a DP solution with O(64m) .... btw can you provide the link to the solution you came across ...??@mohan: I don't have a link to solution, its something I worked out on a piece of paper.Show More ResponsesBuddy, I think you thinking a bit too complicatedly. A knight on a chess board only has 8 legal moves. and if it is anywhere closer than being atleast 2 boxes from the border it will be less than 8. just take a input of all the pieces on the NxN matrix. check these 8 positions and calculate the probability

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

Feb 10, 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..

Aug 10, 2013

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

Jun 28, 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 Intuit was asked...

Oct 25, 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?
110 of 7,899 Interview Questions