# Interview questions in Boulder, CO

University of Colorado Boulder Interviews in Boulder

www.colorado.edu / HQ: Boulder

71 Interviews in Boulder (of 112)

Qualcomm Interviews in Boulder

www.qualcomm.com / HQ: San Diego, CA

45 Interviews in Boulder (of 2,312)

www.google.com / HQ: Mountain View, CA

38 Interviews in Boulder (of 10,927)

## Interview Questions in Boulder

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

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 Responses Merge 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) |

### RF Hardware Engineer at Qualcomm was asked...

What are the effects of a mismatched circuit? 4 Answersunwanted heat and intermodulation products IIP2 & DC Offsets Mismatched circuits can produce excess heat, DC offsets, intermodulation products, and other unwanted complications. Show More Responses IN the digital domain, zero crossings and ISI , as well as DC offset can be compromised.Loss of received signal strength with distortion, Overheating and damage to TX drivers |

### Customer Service Manager at Zayo was asked...

I was asked how do I deliver a "no" to the customer when they are expecting and demanding a "yes" answer. 2 AnswersI explained I would review all the avenues to get a yes and if the answer had to be "no" then that would be the clear and concise message I would deliver. No blaming, no excused, I would present a supportive and final company decision. I would affirm the client by acknowledging how strong of a desire it is to have that feature. I would propose a brainstorming session to look at how we could meet that need in another way that is viable with the company product or service. With this sort of investigation sometimes you can find out a deeper why of the client and come up with a creative solution. And, sometimes the client is looking for something that is not possible and you then need to do the best you can to explain to them why. If you can, work with your dev and TechTeam to find out if there are other solutions available from other providers that can work alongside your product. |

What reporting tools have you used? Actuate, Brio, Crystal Reports? How much experience have you had in scheduling jobs on Unix? Can you write XML and implement it? 1 AnswerThe interviewer was interested in breath of experience rather than specific technical skill. Unix work with scheduling and XML skills are necessary, but not heavy (the same procedures are done over and over again). Emphasis was on selling yourself through experience. |

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

Intersection of two numerical arrays 8 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 Responses I 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. |

### Software Developer at Google was asked...

write an algorithm to divide two numbers using only loops and addition. 6 Answersdelegate the problem to one of the mindless google calculator boys. // I don't get this question.... // Is there any Aha algorithm for solving it, instead of the naive approach? int divide(int dividend, int divisor) int ans=0, partial=0; while(partial+divisor No, its essentially that asinine. Glad I spent 10 years in the industry and got my PhD to be judged on this algorithm.... Show More Responses I'm not sure a correct answer for this question is going to say, "Hey...Here's the next designer/programmer of Chrome v2"....? WTF?!? public static void main(String[] args){ int divisor = 2; int number = 100; int i = Integer.MAX_VALUE; for (int j = 1; j = number) { System.out.println((j)); break; } } } If they were looking for engineers with dumb ideas like totally destroy their branding by copying Bing's background image function, this would definitely be a good recruiting questions.... like I said before; idiots! int a = 9; int b = 2; int sum = 0; int result = 0; while (sum + b < a) { int term = b; int mult = 1; while (sum + term < a) { result = result + mult; sum = sum + term; term = term + term; mult = mult + mult; } } Print result; It's not hard to realize the calculation time is O(Log(a)) and more precisely C * Log(a/b) <= Time <= C * 2 * Log(a/(2*b)) |

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

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 RAM Divide 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 Responses People, 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. |

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

Hardest things to unit test 4 AnswersSingletons in a runtime environment. my first reaction is "people behavior" multi-threaded code :) Show More Responses A random number generator. |

### Software Engineer at Google was asked...

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

### Software Engineer at Google was asked...

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, 12321 Show More Responses The 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; } |