Software Engineer Interview Questions in Boulder, CO | Glassdoor

# Software Engineer Interview Questions in Boulder, CO

Software engineers write programs to design and develop computer software. Interviews are highly technical, so come ready to work through coding problems and math brainteasers. The specific questions you are asked will depend on what type of programming position you are looking for. Try researching a specific software discipline such as web development, application development, or system development.

## Top Interview Questions

Sort: RelevancePopular Date

Mar 19, 2009
 What sort would you use if you required tight max time bounds and wanted highly regular performance.6 AnswersVector sort.Guaranteed to be O(n log n) performance. No better, no worse.That is so say, a "Balanced Tree Sort" is guaranteed to be O(n log n) always.Show More ResponsesMerge sort and heapsort are always guaranteed to be n*log(n). Quicksort is usually faster on the average but can be as bad as O(n^2), although with very low probability. Heapsort also does it sorting in-place, without needing an extra buffer, like mergesort. Lastly, heapsort is much easier to implement and understand than balancing trees mentioned by earlier posts.for something like this you generally want bubble sort or insertion sort. It's not about being fast it's about being consistent. Make it do exactly the same thing every time.Use a sorting network. There's some precomputation time, but runtime will be very consistent (the only variability is branch prediction performance)

Apr 24, 2010
 Intersection of two numerical arrays8 AnswersAlgorithm and pseudo code* assuming b[] is the longer array quick sort b[] for all items from a[] binary search this item in b[]for above.. O(n log n) + O(n) * O(log n)Show More ResponsesI have a O(n) algorithm: 1. Iterate over all the elements of first array a[] and build a dictionary mapping the element value to the index - O(n) 2. Now iterate over all the elements of the second array b[] and for each element that is already present in the dictionary, move the element to a different array that maintains the intersection elements - O(n) 3. Hence the overall complexity is O(n) in time and O(n) for the dictionary and the array to maintain the intersection elements.given arrays of lengths n and m. A simple solution is to sort array n in O(n lg n) and for each item in array m, look for it in sorted n, O(m lg n). So total time = O((m+n)lg n), let array n be the short array. I feel there is a much quicker solution, maybe O(n+m) if we assume integers.Two possible approaches: 1. Sort both arrays and then walk over each array simultaneously until you find all the common entries. This is O(n*logn) to do the sort and then walking over the items is O(n). 2. Walk over first array and insert each item into a hash table. Then search for each item in the hash table. This is O(n) time and O(n) space. If you're doing this a lot with the same sets of data, both algorithms allow you to do the expensive step once for each array and then find the common items in linear time.Simple O(n) solution: public static Integer[] getIntersection(Integer[] a, Integer[] b) { Map countsMap = new HashMap(); for(Integer num : a) { // O(n) time countsMap.merge(num, 1, (x, y) -> y + 1); } List intersection = new LinkedList(); for(Integer num : b) { // O(n) time if(countsMap.containsKey(num)) { // O(1) int count = countsMap.get(num); // O(1) if(count > 0) { intersection.add(num); // O(1) countsMap.put(num, count - 1); // O(1) } } } // Above loops run in O(n) time each. // Total time complexity = O(2n) return intersection.toArray(new Integer[intersection.size()]); }Actually, even conversion of list to array happens in O(n) time. So above solution required O(3n) and not O(2n), Please pardon my mistake.

Mar 19, 2009
 What sort would you use if you had a large data set on disk and a small amount of ram to work with?5 AnswersMerge sort, I would think.A run of the mill quick sort would use far less RAMDivide and conquer algorithms use too much memory. In-place quick sort has worst case O(n^2), so if you say that, you need to be able to explain how you're going to optimize it to make sure you don't get that speed. Heapsort -- O(n*logn) and in-place -- would be better in the worst case, though quick sort performs better on average.Show More ResponsesPeople, people! Please READ the whole question before posting an 'answer'. It will go badly for you if in an interview, you answer the wrong question, going off on the wrong track. I says this since the question specifically said the dataset was 'large', one should assume too large for fitting in RAM, so quicksort is out of the question. Merge sort and heap sort are much better candidates. There is a reason for the distiction in Vol 3 of Knuth between in-memory sorting algorithms and on-disk algorithms.the problem doesn't give a runtime bounds -- so insertion or bubble sort would be fine. My 2C: focus on the task given. A correct answer is the one that solves the problem with the least effort in terms of labor cost while satisfying the requirements. The information about data-set size doesn't provide any insight into what sort you should be using ... it's a bread-crumb leading you in the wrong direction.

Aug 8, 2010
 Write a function to return the number with the longest collatz sequence in a given range: int longestCollatz(int lower, int upper);3 AnswersWikipedia was allowed: http://en.wikipedia.org/wiki/Collatz_conjecture Code is simple. Wrote a recursive function to calculate the length of a given sequence, called it for each number in the range.this was for a phone interview ? first or second ?An optimization is having a cache for already calculate sequence lengths. this is a good idea because whenever you reach the same number the sequence is going to look the same from that point on. In other works, the problems share many common subproblems from which you can reuse solutions.

Aug 8, 2010
 Write a function to return if a number is a palindrome (eg, 113848311)4 AnswersCount the digits, loop inwards from the outside edges to the center.bool isPaldrome(int n) { int r = 0; for (int num = n; num; num /= 10) r = r * 10 + (num % 10); return r == n; }Explanation: Make another int variable that adds to the end what gets knocked off the input int. Then just return if they match. Sample program flow for 12321 would be: 12321, 0 1232, 1 123, 12 12, 123 1, 1232 0, 12321Show More ResponsesThe fastest calculation for this is to only look at half of the digits. Reversing the integer is a bad idea as well because you could overflow the number. The fastest answer in terms of digits is o(n/2) time, but requires o(4) space: bool isPalindrome(int n) { int right = n % 10; int left = n / 10; int power = 1; for(int i = 2; right < left; ++i) { power *= 10; right = right + power * (left % 10); if( (i & 1) && right == left) return true; left = left / 10; } return right == left || left == 0; }

Apr 24, 2010

### Software Engineering Intern I at National Instruments was asked...

Oct 20, 2012
 Find the average value of a binary tree both recursively and iteratively. Explain why iteratively may be preferred over recursively.2 AnswersIteratively should theoretically be more efficient. No function calls, uses less memory, etc.method 1 ; inorder sort method 2 augmented BST with size as extra data

### Software Engineer at Qualcomm was asked...

May 21, 2013
 what is the significance of '20 log x'?2 AnswersThis convention is in place due to the original definition of Decibel (dB) as a measure of a ratio between powers. If X, X0 are power measurements( X0 could be the input or reference power, X the output ), then the dB measurement was defined as X_dB = 10log_10 (X/X0) This way, if X is 10 times X0, we read X is 10dB greater than X0. On the usefulness of utilizing the log_10: it allows to express a very large range of ratios in a range of moderate size, allowing one to clearly visualize huge changes of some quantity. Many contributions to Control Theory have come from the area of Electrical Engineering. Since in a circuit with constant resistance, the power developed is proportional to the square of the applied voltage, then if V and V0 are two voltages of interest (I/O) one finds that: V_dB= 10log_10(V^2/V0^2) = 20log_10(V/V0) which is the reason why Electrical engineers use the dB defined as 20log_10(V/V0), and so Control theorists do!C code for converting decimal to binary: char buff[10]; int i; printf("enter the number\n"); scanf("\n%d", &i); itoa(i,buff,2); printf("%s", buff);

### Embedded Software Engineer at Qualcomm was asked...

Feb 20, 2013
 A brain teaser question where we have to find out 45 minutes with the help of two ropes. Given that one rope burns completely in 1 Hr and the rate or burning is not consistent. 4 AnswersI assume that both ropes have the same non consistency. If you burn from one end it takes 1H. If you burn it from both ends it takes 1/2 H. To get 1/4 H, burn it from both ends and the point that in the first rope the fires got together.I assume that both ropes have the same non consistency. If you burn from one end it takes 1H. If you burn the first rope from both ends it takes 1/2 H. Immediately after the first rope burnt, burn the second rope from one end and the middle point that fires reached each other in the first rope. To get 1/4 H, burn it from both ends and the point that in the first rope the fires got together.Burn first rope from both ends, and second rope from one end only. When First has completely burned, 30 mins will have passed and second rope will have 30 mins left on it. Now burn second rope, which has burned for 30 mins already, from both ends, this will burn a 30 minute rope at twice speed, making it complete in 15 mins. This will be 45 minutes total.Show More ResponsesI've faced same question in ASSIA interview