Developer Interview Questions

640,302 developer interview questions shared by candidates

Third person: Given a 2-d array, write code to print it out in a snake pattern. For example, if the array is this: 1, 2, 3 4, 5, 6 7, 8, 9 the routine prints this: 1,2,3,6,9,8,7,4,5 The array is an NxN array. The final question was just how to write a connection pool (i.e, a class that returns connections to the user, and if the user is done, returns them back to the pool)
avatar

Software Engineer

Interviewed at Google

4.4
Feb 28, 2013

Third person: Given a 2-d array, write code to print it out in a snake pattern. For example, if the array is this: 1, 2, 3 4, 5, 6 7, 8, 9 the routine prints this: 1,2,3,6,9,8,7,4,5 The array is an NxN array. The final question was just how to write a connection pool (i.e, a class that returns connections to the user, and if the user is done, returns them back to the pool)

1. Given a preorder traversal, create a binary search tree in optimized time 2. Implement hasNext and next for a list of lists 3. Given a circle with N defined points and a point M outside the circle, find the point that is closest to M among the set of N. O(LogN) 4. Given two sets of intervals, return a combined set 5. Threading related questions
avatar

Software Engineer

Interviewed at Google

4.4
Feb 19, 2013

1. Given a preorder traversal, create a binary search tree in optimized time 2. Implement hasNext and next for a list of lists 3. Given a circle with N defined points and a point M outside the circle, find the point that is closest to M among the set of N. O(LogN) 4. Given two sets of intervals, return a combined set 5. Threading related questions

You're writing an application that receives a stream of individual items of data. The stream may be very long or very short, but you have no way of knowing how long it is (i.e. there's no trick to figuring out the size of the stream of data). How would you go about choosing m items such that any subset of m items was equally likely? (Not an even distribution of values, but just that any m items are equally likely to be chosen). So for example, m=1000, and the number of items in the stream, n, may be 1000, or 10000, or 100000000, or much much larger; there is no way to know how many.
avatar

Software Engineer

Interviewed at Google

4.4
Feb 4, 2010

You're writing an application that receives a stream of individual items of data. The stream may be very long or very short, but you have no way of knowing how long it is (i.e. there's no trick to figuring out the size of the stream of data). How would you go about choosing m items such that any subset of m items was equally likely? (Not an even distribution of values, but just that any m items are equally likely to be chosen). So for example, m=1000, and the number of items in the stream, n, may be 1000, or 10000, or 100000000, or much much larger; there is no way to know how many.

trickier question, code a method given the following method signature that will print out any numbers that intersect both arrays of numbers //Example arrays // 4, 18, 25, 40, 411 // 20, 25, 40, 320, 1009, 1100 void intersect(int[] arr1, int len1, int[] arr2, int len2) {
avatar

Software Engineer

Interviewed at Google

4.4
Mar 8, 2010

trickier question, code a method given the following method signature that will print out any numbers that intersect both arrays of numbers //Example arrays // 4, 18, 25, 40, 411 // 20, 25, 40, 320, 1009, 1100 void intersect(int[] arr1, int len1, int[] arr2, int len2) {

Second interview: 1) A shuffled set contains unique numbers except one of the numbers appears twice. Find the number that appears twice. (Funny enough the interviewer had a custom random shuffler function to shuffle the set. But his shuffler function was not truly random as he would randomly pick indexes from 0--length of set and swap but this could pick the same indexes twice. Its technically buggy code, but I didn't dare mention something like that in an interview. Goes to show how "strong" the developers working in Tinder are. It also explains the numerous buggy user experience on the app) 2) Merge part in merge sort
avatar

Software Engineer

Interviewed at Tinder

3.5
Oct 17, 2017

Second interview: 1) A shuffled set contains unique numbers except one of the numbers appears twice. Find the number that appears twice. (Funny enough the interviewer had a custom random shuffler function to shuffle the set. But his shuffler function was not truly random as he would randomly pick indexes from 0--length of set and swap but this could pick the same indexes twice. Its technically buggy code, but I didn't dare mention something like that in an interview. Goes to show how "strong" the developers working in Tinder are. It also explains the numerous buggy user experience on the app) 2) Merge part in merge sort

Viewing 1031 - 1040 interview questions

Glassdoor has 640,302 interview questions and reports from Developer interviews. Prepare for your interview. Get hired. Love your job.