Software Interview Questions | Glassdoor

# Software Interview Questions

101

interview questions shared by candidates

## Software Interview Questions

Sort: RelevancePopular Date

Apr 3, 2013
 How willingly are you to travel owing to the fact that I hadn't travelled much.1 AnswerYes I would try to make myself flexible for travelling

Mar 21, 2010
 You have a genealogy: 1) Describe a data structure to represent it. 2) Given any two people within the genealogy, describe an algorithm to determine if they share a common ancestor. You just need to return true/false, not all ancestors.6 Answers1) Each person is represented by an object, with two pointers: "mom" and "dad" that point to their respective parent. 2) Choose one of the two people arbitrarily. Perform depth-first traversal and create a set of ancestors reachable from that person. Perform depth-first traversal on the 2nd person and for each node visited check if they are in the set; if yes, return true. Use a hash-set for best performance.calculate the height of person 1 in the tree, calculate the height of person 2. Move them up to be the same height. Then keep going until they intersect.@user: Its not a tree. A genealogy is a graph due to the fact that you have maternal and paternal trees intersecting. Therefore there is no root from which to calculate height.Show More ResponsesIf you've optimizing for worst case, hash set is O(n) for search. You'd do better in worst case with a sorted structure. You'd do even better if you store a "visited" flag at each node. Alternately you can number each node and keep an array of visited flags. since depth first seach might find a longer link through dad before checking mom, you're better off with breadth first search. Anything reachable in one hop would be seen before anything reachable at best in 2 hopsYes. Good points. The second traversal should be breadth first. The first traversal it doesn't matter, as you need to visit all ancestors anyways. The use of a visited flag is a good optimization. Based upon the way the question was worded, it wasn't clear if you could design the data structure to optimize the algorithm or not.I belive both the first and second should be BFS traversals

### Computer Programming at Pyramid Solutions was asked...

Dec 16, 2010
 What is your favorite technical acronym?2 AnswersThis question just caught me very off-guard. I was not expecting a question like this at all, and thus had no semblance of an answer prepared.WYSIWYG

### Mobile Developer at Dew Software was asked...

Nov 25, 2014
 Why should I pay you salary? Yes, that will be the most unexpected question. Right after I joined the training, a friend who recommended me (working at a big s/w company, I cannot disclose because he is under the threat from this company) was not paid his routine salary - it was promised he will be paid a bonus. But the bonus was 3,000 first year and last year he didn't get paid. He went and asked the owner, the owner's question was "why should I pay you? You are doing a crappy job there". My friend asked me to leave if possible. I did! 2 AnswersAsk and learn what training they are providing, how they will "market" you, prior to enrolling even for training. It wouldn't be a bad idea to see how they will pay you and if it is a straight cut or will they pay in in "bonus" methods. Don't bait into it, no matter how desperate you are, there are ethical companies out there.This is total lie. we have a record paying salary in time and accurate. One can always check even with our past employees. Moreover, we are getting 90% of employees thru referral only. These are the comments written by our adversaries and they have the campaign to malign our company.

### Apple Genius at Apple was asked...

Aug 30, 2011
 There is no sound coming out of the speakers. How do you troubleshoot the issue.4 AnswersI first answered to eliminate software issue. Then I broke it down from a hardware perspective.This is more than likely a software issue, specifically a failed sound driver. An obvious sign would be the user noting the sound disappearing suddenly, such as between standby/hibernation states. Restarting the computer provides an opportunity for the OS to retry hooking the driver correctly. There's also the possibility that the sound driver preferences have been adjusted, so it would also serve well to ensure sound output is correctly set to the intended source, built-in audio. If neither option works, I would attempt to rule out speaker damage. Plugging the computer to an outside sound source i.e. an Apple Display and/or headphones, enables me to determine if the Mac is output sound in general. If sound is present, then there appears to be some failure to link the internal speakers to the OS. In this event, a repair should then be scheduled.Does the device say headphone mode? If so try to use a Qtip and put it in the port where you would plug in the headphones, there may be some dirt in there and the Qtip will safely get it out and it should start working again, if not I would suggest to take it to an authorized apple center to have them further troubleshoot.Show More ResponsesCheck to see where the Bluetooth output is going, turn up volume, make sure phone is not on silent mode.

### Senior Process Engineer at Intel Corporation was asked...

Apr 26, 2013
 Most unexpected: what are the 2 golden rules of an op amp (I’m a mechanical engineer)?2 AnswersThe positive and negative inputs of an op amp: (1) are the same voltage, and (2) draw no current.Solution: 1. the output attempts to do whatever is necessary to make the voltage difference between the inputs zero. 2. The inputs draw no current Comments on 1: The voltage gain of a real op-amp is so high that a fraction of a millivolt input will swing the output over its full range. Practically, that amounts to rule1 Comments on 2: The input current is so low (0.08 microamps for the 741, picoamps for an FET-input op-amp) that rule 2 is practically correct.

### Senior Consultant at Sogeti was asked...

Jan 31, 2011
 What is SDLC4 AnswersThey are looking for someone who not only knows what SDLC is but someone who's got experience.A cycle of planning, analysis, design, implementation, testing, deployment, and maintenance.System Design Life CycleShow More ResponsesSoftware Development Life Cycle

### Software QA Engineer at eBay was asked...

Jun 13, 2011
 how to find the closest 2 number in an array of unique positive number5 Answersasked during phone interviewOne solution is to sort the array, then iterate through all neighboring pairs to find the pair with smallest difference. This is O(NlogN) solution. If the integers are bounded, you may be able to sort in O(N) time for an O(N) solution.public static int[] find2Closest(int[] myArray) { assert(myArray.length >= 2): "myArray needs to be larger than 2"; Arrays.sort(myArray); //quickSort int indexMin1 = 0; int indexMin2 = 1; int min = myArray[indexMin1] - myArray[indexMin2]; for(int k = 0; k < myArray.length-1; k++) { int difference = Math.abs(myArray[k] - myArray[k+1]); if(difference < min) { min = difference; indexMin1 = k; indexMin2 = k+1; } } int[] values = new int[2]; values[0] = myArray[indexMin1]; values[1] = myArray[indexMin2]; return values; }Show More Responsespublic class ClosestTwoNumber { public int[] findClosest2Number(int[] arr){ if(arr == null || arr.length diff) { min = diff; num1 = arr[i - 1]; num2 = arr[i]; } } if (num1 == -1 || num2 == -1) { throw new IllegalArgumentException(); } int[] result = new int[2]; result[0] = num1; result[1] = num2; return result; }public class ClosestTwoNumber { public int[] findClosest2Number(int[] arr){ if(arr == null || arr.length diff) { min = diff; num1 = arr[i - 1]; num2 = arr[i]; } } if (num1 == -1 || num2 == -1) { throw new IllegalArgumentException(); } int[] result = new int[2]; result[0] = num1; result[1] = num2; return result; }

### Software Development Summer Intern at Salesforce was asked...

Mar 6, 2011
 Given 999 distinct numbers between 1 and 1000, find one/two that is/are missing.4 Answersone is missing: there are plenty of ways of doing this, simplest is to sum all numbers, subtract from 1+2+...+1000. two are missing: you'd need 2 equations, a+b = something, and a*b = something_else. first equation can be generated using the technique mentioned above, try summing the squares of numbers for the next equation.missign number = Sum to 1000 - Sum of all given numbers.Its 1 and 1000, cuz the question say between 1 to 1000, i.e., now only 1 and 1000 are leftShow More Responses1 number missing: Calculate sum of numbers 1 - 1000 , which is (1000)(1001) / 2, and then subtract actual sum from that. You'll get your missing number. 2 numbers missing: Calculate sum of numbers AND sum of squares of numbers (n)(n + 1)(2n + 1) / 6, subtract from actual sum. You have two equations, two variables, solve. You can continue this pattern for n numbers, pretty sure.

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

Feb 28, 2014
 In as much technical detail as possible, how would you design the infrastructure for a twitter-like site (at scale). 1 AnswerThis is pretty open ended so I described a lot of stuff I knew would and wouldn't work and went through both the "naive implementation" and a scaled up version of each part of the site.
110 of 101 Interview Questions