Software engineering Interview Questions | Glassdoor

# Software engineering Interview Questions

17

interview questions shared by candidates

## Software engineering Interview Questions

Sort: RelevancePopular Date

### 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 Engineer at Blizzard Entertainment was asked...

Jan 20, 2012
 2 ways of factorial or Fibanacci number calculation1 AnswerStandard interview question - just google it.

### Software Engineer at Blizzard Entertainment was asked...

Jan 20, 2012
 Array based stack and queue. 1 AnswerStandard interview question - just google it.

### Software Engineer at Blizzard Entertainment was asked...

Jan 20, 2012
 Please explain in as much details as possible what happens when you click link in the browser and this request goes to web app and returns back as response.1 AnswerAssumes TCP/IP stack, DNS, Web servers, Web applications knowledge

### Data Migration Specialist at eClinicalWorks was asked...

Dec 9, 2014
 The SQL quiz is pretty easy to solve if you are on a live db. But without being prepared for a paper quiz, you may not be able to prove your skills1 AnswerPrepare

### Software Development Engineer Intern at Amazon was asked...

Mar 6, 2014
 Implement a stack that supports push, pop and mode(the one from statistics) operation. Gave an O(log n ) push and pop and O(1) mode operation.Another good question was implement atoi function. I assumed it as base 10 but was asked to support from binary to any base numbers(even base 50).2 AnswersSolution to atoi function().It supports only base 10 operations. int atoi(char *str) { int is_negative = 0; int int_val = 0; /* Skip non digit characters excluding '-' */ while (!isdigit(*str) && (*str != '-')) { str++; } /* Number is negative */ if (*str == '-') { is_negative = 1; str++; } /* Compute the int_val for contiguous digits */ while (isdigit(*str)) { int_val = (int_val*10) + (*str - '0')%10; str++; } return ((is_negative) ? (int_val * -1): int_val); }how you get a O(log n) of push and pop in a stack?

### Senior Software Engineer at Juniper Networks was asked...

Feb 13, 2013
 What is the limitation of Tcl? Be the first to answer this question

### Software Engineer at Walt Disney Company was asked...

Apr 16, 2012
 How would you approach creating a Chess game?Be the first to answer this question

### Software Engineer at Blizzard Entertainment was asked...

Jan 20, 2012
 Apache handlers - explain how pre- and post-processing works for web server requests and responses.Be the first to answer this question

### Software Engineer at NVIDIA was asked...

Jul 16, 2014
 Questions on C and DSBe the first to answer this question
110 of 17 Interview Questions