Software Developer Interview Questions in Mountain View, CA | Glassdoor

Software Developer Interview Questions in Mountain View, CA

"Software developers design, write, test, and maintain the code for a software system. Extensive knowledge of programming languages, data structures, and algorithms are necessary to pass the technical interview which is designed to test these skills. Employers are looking for candidates with a bachelor's degree in computer science or related field or equivalent work experience. "

Top Interview Questions

Sort: RelevancePopular Date

How would you write a sort routine to ensure that identical elements in the input are maximally spread in the output?

4 Answers

This is my opinion: First of all, understand what "maximally spread out" means - if we have an array of 4 identical elements, there are 4! = 24 permutations we can arrange the elements by. If we measure for each element the distance of its new position minus its old one (i.e. the number of "hops" the element made), and sum these measurements we get an idea of how well the permutation "mixed up" the array. However, there is more than one such maximal permutation, and so we need to choose the "maximally spread out" one. I think this is the one where the minimal amount of "hops" for any element is maximal, in the 4 elements array case - each element does 2 hops, i.e. [a b c d] turns into [c d a b]. In order to achieve this we can use a *stable* MergeSort, and when performing the last merge (e.g. between [a b] and [c d]), we simply choose to perform this specific merge with preference for items from the right array and not the left one. (all through the recursions levels of the operation we stayed stable, meaning we preferred to initially place elements from the left array, this time we do the opposite). We can accomplish this by giving an extra boolean parameter for the recursion, the top level gets it as 'true' and invokes all other levels with it being 'false'. ... This is just my opinion :)

I am confused for more than one reason. First, "sort" usually means "arranged in ascending or descending order". In sorted output the identical elements are right next to each other, not "maximally spread out"! Or do I miss something? If your "sort" means "any arrangement that follows certain rules", then you should mention what these rules, besides identical elements in the input being maximally spread out. Is there some ordering of non-identical elements?

probably dynamic programming question, o(n^2) for each item in input_array for i=0 to i=output_array.length if (item == output_array[i]) { swap_in_output_array(i, i-count) count++ } output_array.append(item)

Find the optimal map route between two points on a grid (maze) with some areas blocked out.

3 Answers

Create a data structure that minimizes time complexity of retrieving median and inserting new element. Getting median should be O(1) and insertion should be O(log(n)).

5 Answers

How can you write a recursive function calculating the exponential of a number?

2 Answers

What happens when you type www.google.com in your browser?

3 Answers

Browsers running javascript is single threaded, how can we make AJAX calls in the backgroung?

2 Answers

What's your favorite programming language? Talk to me about it.

2 Answers

They want me to design a scalable prototype of basic information retrieval system.

2 Answers

A,B,C Input, determine if its a triangle.

1 Answer

How to design a search engine? If each document contains a set of keywords, and is associated with a numeric attribute, how to build indices?

1 Answer