Engineering Interview Questions | Glassdoor

# Engineering Interview Questions

119

interview questions shared by candidates

## Engineering Interview Questions

Sort: RelevancePopular Date

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

### Software Engineer I at Northrop Grumman was asked...

Jul 9, 2012
 What is systems engineering?4 AnswersCoordinating a complex project across different disciplinesWOW...How many lines of code have you programmed?? They ask questions like this? I'd tell him that I program millions of lines of "Hello World" everyday. Really some nonsense question.What does question "System Engineering" has to do with "Software Engineering"? Weird question by the interviewer. This would be my answer towards the interviewer.Show More ResponsesSystemically approaching a problems, and systematically arriving at solutions.

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

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

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

### Project Manager at FMC Technologies was asked...

May 20, 2010
 Have you had any experience dealing with customer who don't adhear to a design freeze?1 AnswerYes, usually the customer will end up with a product that is of lesser quality than they would have if a design freeze was adheared to during the design process.

### Engineering Co-Op at Central Contra Costa Sanitary District was asked...

Jun 21, 2012
 Do you have good knowledge of thermodynamics?1 AnswerYes.

### Network Engineer at ATEM was asked...

Mar 13, 2014
 What do you like about Consulting services? 1 AnswerI don't know yet - I just know the pay is much better. I guess they just wanted to know if I was cut out for it. Apparently the answer worked.

### Mechanical Design Manager at Teledyne Energy Systems was asked...

Jan 8, 2015
 Was I involved in the initial development of the centralized PDM system from my former employer.1 AnswerAs an engineer we were encouraged to submit our processes to the developer/programmer of the PDM system. A step by step approach was developed to capture the documentation and product release of a product system and its components within a computer based system.

### Specialist Infrastructure Engineer: WAN at Nationwide was asked...

Oct 15, 2013
 What command do you use to find OSPF neighbors? Seriously?1 Answersh ip ospf neighbors
110 of 119 Interview Questions