Senior software engineer Interview Questions in India | Glassdoor.co.in

# Senior software engineer Interview Questions in India

16,502

senior software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

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

13 Oct 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.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); } One or more comments have been removed. Please see our Community Guidelines or Terms of Service for more information.

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

19 Sep 2010
 if there are 6 people in a team, how many handshakes will be there8 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 times6c2= 15

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

27 Aug 2015
 Swap LSB with MSB of an short integer without temp6 Answers#include int main() { printf("Hello, World!\n"); // your code goes here unsigned char num=0xf7; num = (num > 4); printf("%0x\n", num); return 0; }#include int main() { printf("Hello, World!\n"); // your code goes here unsigned char num=0xf7; num = (num > 4); printf("%0x\n", num); return 0; }#include int main() { // your code goes here unsigned char num=0xf7; num = (num > 4); printf("%0x\n", num); return 0; } Sorry lines got truncatedShow more responses#include int main() { // your code goes here unsigned char num=0xf7; num = (num >4); printf("%0x\n",num); return 0; }uint16_t swapShort(uint16_t x) { return (x>8); }uint16_t swapShort(uint16_t x) { return (x > 8); }

### 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 Intelizign was asked...

20 Nov 2016
 1) If Child class has parameterized constructor and parent class has default constructor . will it work6 AnswersMy answer is yes as java automatically provides a super call on first line of constructor . Interviewer who was almost 35-37 years old so at least have 10-15 years of experience dont know this concept and we argued on this after which i was told to work on my technical skills and I was like common manNope the old man is correct and u were wrong, the answer is it will not workIt will work. As constructor cannot be overriden. It can be just override in same class.Show more responsesThat will work, compiler writes super call in first line of constructor.Yes it will work.It will work, because super() call from child constructor will call no arg constructor of parent which is by default provided by compiler. But if parent also have parameterized constructor then it will not work, because super() call from child constructor will not find no argument constructor in parent

### Senior Java Developer at Morgan Stanley was asked...

22 Apr 2020
 Core Java questions & this person was also not aware about the immutability concept properly except what is given on internet. I had to teach him the immutability of class & object, else for this person both are same.6 AnswersI had exactly same experience on 20th. Interview went well and then not shortlisted. They are wasting candidate's time. It was 4th level video call where interviewer wasn't interested to show his face.Many companies are doing the same either companies are just giving illusion to people that they are hiring or the incompetent interviewers are not selecting any worthy candidate for the safety of their own job. In short, all seems to be a kind of fraud going on in name of hiring.I had the same experience. I was supposed to be interviewed by some Morgan Stanley person on 16th April 2020, then this Morgan Stanley person called me to reschedule the call. Then in evening, this person never showed his face in video conference & he also didn't seem to have proper technical understanding. I think his name was 'Dhaval' & I don't feel that he will select any person more capable.Show more responsesI also had the similar experience, I think either stupid people work here or stupid people come to take the interviews.This also happened to me, the guy who was taking an interview (Bharat Bhagat) told me that he will not use video since he is having poor internet connection. Initially I thought he is genuine, but when my interview started with basic java stuff and I answered him with granular level details he fainted and he started googling the questions. He was not capable and not having enough knowledge which I came to know on his cross questioning. He asked me question on data structure and he was not aware about Heap data structure. He never came back with the feedback. Later on, I checked his profile on LinkedIn and found he kept on changing firm every year.Thats the reality, many such junk heads are having the jobs & even taking the interviews. Obviously such junk heads will try to avoid their faces & do google to ask the questions. If they find you better than them then high chances that you will not be selected. Infact, it also happened to me while giving interview with Pubmatic, Pune where initially interviewer was sharing the screen for the question but she was looking on GeeksForGeeks also for the questions/answers & those screen got shared momentarily, so she asked me to note the question & share my screen rather. So that she can check the answers freely on internet.

### 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 BA Continuum India was asked...

22 Sep 2015
 First three technicals were difficult,LOB also ok/ok.5 AnswersI tried to answer all the questions and got appreciation from Business people round of interview.BOA is a good organization - they also pay more .. .Just that you profile wasn't selected because of project or business requirement .. sometimes it happens .. approval to hire takes more time .. good luck..What is exactly they are asking in LOB round?Show more responsesplease let me know what they ask in LOB round.please helpplease let me know what they ask in Lob round

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

24 Oct 2018
 Why Accenture?5 Answersi am a fresher my career start with a good company that's why i am selecting Accenture companyI have ever seen such a worst interview in my career without asking any question they are rejected......whoever wanted to attend interview in Accenture don't go and waste your time. They will take whole day to comeplet the one round... They will tell us to wait wait till the end of the day they will reject the candidate.....hellllllllllllMy dream company....i have heard lot of good things about this companyShow more responsesBecoz this is gud company in gurgoanHere I just giving a brief answer but it was clearly explained in (Ok:Overall Knowledge) youtube channel. This is just the summary of the video length is just 3 mins I guess but it clearly explained the question why Accenture? Why do you prefer Accenture? 1)Opportunities for learning and growing. 2) Work Environment 3)Opportunities for Network and meeting new people. How ‘One Global Network’ Connect and helps.

### 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. One or more comments have been removed. Please see our Community Guidelines or Terms of Service for more information.
110 of 16,502 Interview Questions