Developer Interview Questions

269,104 developer interview questions shared by candidates

Implement a method 'find' that will find the starting index (zero based) where the second list occurs as a sub-list in the first list. It should return -1 if the sub-list cannot be found. Arguments are always given, not empty. Sample Input 1 list1 = (1, 2, 3) list2 = (2, 3) Sample Output 1 1 Explanation As second list (2, 3) is sub-list in first list (1, 2, 3) at index 1 Sample Input 2 list1 = (1, 2, 3) list2 = (3, 2) Sample Output 2 -1
avatar

Senior Java Developer

Interviewed at Atlassian

3.2
Apr 13, 2016

Implement a method 'find' that will find the starting index (zero based) where the second list occurs as a sub-list in the first list. It should return -1 if the sub-list cannot be found. Arguments are always given, not empty. Sample Input 1 list1 = (1, 2, 3) list2 = (2, 3) Sample Output 1 1 Explanation As second list (2, 3) is sub-list in first list (1, 2, 3) at index 1 Sample Input 2 list1 = (1, 2, 3) list2 = (3, 2) Sample Output 2 -1

Implement the MyStack. (A lot of questions about multi-threading) @protocol Stack -(void)pushObject:(nonnull id)obj; -(nonnull id)popObjext; @property(nonatomic,assign)NSInteger count; @end @interface MyStack : NSObject <Stack> @end @implementation MyStack @end
avatar

IOS Developer

Interviewed at Booking.com

4.1
Aug 26, 2016

Implement the MyStack. (A lot of questions about multi-threading) @protocol Stack -(void)pushObject:(nonnull id)obj; -(nonnull id)popObjext; @property(nonatomic,assign)NSInteger count; @end @interface MyStack : NSObject <Stack> @end @implementation MyStack @end

String,String buffer,String builder difference. Can u write your own immutable class n how? hashmap implementation and hashcode(),equals() method he asked me to write 2 logical testing programs with reduced complexity( 0,1,1,2,4,5,3,3,1,0,1 traverse once only n get the duplicate number's along with the count). printing pascal triangle duplicate letter from a string with less complexity reversing words of string individually(this is a tree---o/p: siht si a eert)
avatar

JAVA DEVELOPER

Interviewed at Oracle

3.5
May 25, 2015

String,String buffer,String builder difference. Can u write your own immutable class n how? hashmap implementation and hashcode(),equals() method he asked me to write 2 logical testing programs with reduced complexity( 0,1,1,2,4,5,3,3,1,0,1 traverse once only n get the duplicate number's along with the count). printing pascal triangle duplicate letter from a string with less complexity reversing words of string individually(this is a tree---o/p: siht si a eert)

There are 4 people who want to cross a bridge. They each take 1, 2, 5 and 8 minutes. Only 2 people can cross at a time and they take as long as the slowest person. What is the fastest time you can get everyone across? Then I was asked to write the mathematical equation to determine the trade-off point between each of the 2 approaches to solving this.
avatar

Software Developer

Interviewed at Microsoft

4
May 2, 2011

There are 4 people who want to cross a bridge. They each take 1, 2, 5 and 8 minutes. Only 2 people can cross at a time and they take as long as the slowest person. What is the fastest time you can get everyone across? Then I was asked to write the mathematical equation to determine the trade-off point between each of the 2 approaches to solving this.

(this is a little easier to explain if it's drawn out, but I'll try my best to do it here) Given some integer N = 2^k which represents an NxN matrix, write a function that fills the matrix with 'L' shapes, such that the entire matrix is filled except for 1 empty space. For example, a 2x2 matrix would have 3 spaces filled with one of the corners empty. And a 4x4 matrix would have the entire outer row of spaces filled, with the center 4 filled the same way the 2x2 matrix is filled.
avatar

Android Developer

Interviewed at Vine

3.9
Apr 19, 2016

(this is a little easier to explain if it's drawn out, but I'll try my best to do it here) Given some integer N = 2^k which represents an NxN matrix, write a function that fills the matrix with 'L' shapes, such that the entire matrix is filled except for 1 empty space. For example, a 2x2 matrix would have 3 spaces filled with one of the corners empty. And a 4x4 matrix would have the entire outer row of spaces filled, with the center 4 filled the same way the 2x2 matrix is filled.

Viewing 371 - 380 interview questions

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