Software Developer Interview Questions | Glassdoor.co.uk

Software Developer Interview Questions

2,249

Software developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

The questions were not very difficult but you really need to have all the concepts crystal-clear and be ready to apply them successfully. One of the questions was "how to count the letters in this string:" "The quick brown fox jumps over the lazy dog";

12 Answers

public static int countWords(String str){ if(str == null || str.isEmpty()) return 0; int count = 0; for(int e = 0; e < str.length(); e++){ if(str.charAt(e) != ' '){ count++; while(str.charAt(e) != ' ' && e < str.length()-1){ e++; } }else{ e++; } } return count; }

Sorry, the above version has an error!!!!!!!!!!!!!!!!!!!!!!!! concider this one: public static int countWords(String str){ if(str == null || str.isEmpty()) return 0; int count = 0; for(int e = 0; e < str.length(); e++){ if(str.charAt(e) != ' '){ count++; while(str.charAt(e) != ' ' && e < str.length()-1){ e++; } } } return count; }

# That's why i love Python: len(re.findall('[a-zA-Z]', s))

Design an algorithm to find the first unique element in an array.

8 Answers

The first coding question was to determine whether a list of integers with size N, contains all the numbers from one to N.

7 Answers

A rabbit wants to climb some stairs and it can do steps of 1 or 2. How many possible paths are there to follow ( e.g 1-1-1... or 2-2-2 ... or 2-1-2-1... etc)

6 Answers

write a function that returns the first unique element in an array

5 Answers

Russian roulette brain teaser: Interviewer takes an imaginary revolver gun with 6 empty chambers, and loads 2 adjacent chambers with bullets. Interviewer has the first turn: rolls the cylinder, puts it to his head, and pulls the trigger... no shot. The lucky interviewer passes the gun to you and gives you two options before you put the gun to your head and pull the trigger: (a) to roll the cylinder again or (b) not to roll the cylinder Which option would you choose?

5 Answers

Given two arrays of integers find numbers how can you find the numbers in both? What is the complexity?

4 Answers

int i=14; if (i=15) i++; How much is i?

4 Answers

Most efficient way to find the most frequent number (0-255) in a string of numbers

4 Answers

Determine from an integer number of unique integers (0,1,2,3,..9) in it

4 Answers
110 of 2,249 Interview Questions