Senior software developer Interview Questions in Bangalore, India | Glassdoor

# Senior software developer Interview Questions in Bangalore, India

5,219

senior software developer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

Aug 10, 2013

### 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..

Oct 24, 2018

Sep 8, 2009

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

Nov 18, 2018
 Design a log4j style logging library for a high throughput multi threaded application.4 AnswersThere is no good solution unless you read log4j's source code.Can you please post the questions you have been asked in machine coding and problem solving rounds??log4j implementation was the machine coding roundShow More ResponsesWhat are the questions asked in problem solving and design rounds??

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

Aug 26, 2017
 Knapsack problem with a twist that you can take any number of sacks of a given weight.4 AnswersInitially tried classic knapsack, but that didn't work, then had to write custom program.What was the 2nd question in online round?Did they reply after your submission?Show More ResponsesWhat was the cutoff for online test?

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

Aug 25, 2016
 puzzle : there is a island and the resident are either blue or black eyed. The residents are trapped in the island and want to leave. One day a foreigner comes and says there are few blue eyed people. He will be sending a steamer to the island every day and blue eyed people can leave. But if a black eyed person approaches the steamer, he will be killed. Constraint: No body knows their eye colour and can't even ask or say the colour to any other person. even cant see their reflection. So how many days is required for all the blue eyed person to leave the island.4 Answersdata insufficient: in entire question no one has talked about number of people with blue or black eye. Possible answer will be 0 days or Never.data is not insufficient, this is where ppl stop thinking... why dat you assume a number?If there are n number of blue eyed people, They all will leave together at nth day as they all will realize simultaneously that their color of the eye is blue. For instance, if there are two blue eyed people, on the 1st day both will think the other person should go from the island hence none would leave. However on the second day, they both will realise the reason and leave together.Show More ResponsesSupposing there are x Blue eyed people and y black eyed people then it will take them (x+y)/z days to leave the island provided z is the capacity of the boat. Point to be noted here is that nobody will 'realize' anything since nobody can communicate or know there eye color so everyone is going to try their luck at it.Consider a MaxNoOfDays and a MinNoOfDays scenario : Max - Through some wild luck only all the Black eyed people go each day , get killed , then only all blue eyed go on remaining days and get transported , days = y/z + x/z Min - Again through some wild luck only all Blue eyed people go first get transported and since no one knows their eye color all black eyed people will start going and get killed. So the minimum days scenario becomes equal to the max days scenario i.e. x/z+y/z

### 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

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

Oct 14, 2017
 We have VMs of sizes 6, 9, 20. How do we determine whether we can provide VM's clients requirement. Ex 35 (20+9+6) or 18(6+6+6 or 9+9)3 AnswersCouldn't solve completely, but attempted using some divide by concept on numbers.This is classic problem of given sum in arrayAt first look I thought that this is max sum problem in array but i am certain now that solution is min coin change problem.

### Senior Software Engineer at Time Inc. was asked...

Oct 4, 2015
 Given a map of integer as key and String as a value, how to efficiently get all the keys whose value consists of certain given input string as a sub-string.3 Answersoverride equals functions , put your substring logic into it.A prefix tree(with each node as character and leaf node if the string exists containing the key) would be a very good solution in this case. You can store all strings in the prefix tree. Your input(sub-string) will take you to one particular branch. So from that branch traverse to all leaf nodes. You have all your keys.What Soham is suggesting is right, that is we can use a trie. A trie may be efficient in searching the string but it compromises on the space complexity. I think we can traverse all the values in the map and instead of doing a substring search on each value using String class's contains() method, we can use the KMP or Boyer Moore pattern search algorithm to find all the keys.
110 of 5,219 Interview Questions