Software developer Interview Questions in United Kingdom | Glassdoor.co.uk

# Software developer Interview Questions in United Kingdom

10,482

software developer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

29 Oct 2015

### Financial Software Developer at Bloomberg L.P. was asked...

4 Nov 2014
 Design an algorithm to find the first unique element in an array.8 AnswersOne possibility that comes in mind: * Walk the array, create a hashmap (key is the value in array, value is the count of such values). * Walk the array again and check the count in the hash map, once you hit 1, you have the first unique value. This is O(n) both space and time.Are you sure that this is O(n), it is definitely O(n^2), you go over all items twice.dear utk O(2n) = O(n) != O(n^2)...Show more responsesIts a hashmap. It never guarantees you the order in which you inserted the elements...!!@ankush: this is where LinkedHashMap comes into play.An easier one would be to sort the array and since they are asking for the first unique element return the first element that does not appear more than once in the newly sorted array.@ankush: That does not matter, you do not need to keep the order in the hash map. You go again through the original array, so you definitely find the first unique value. The hashmap is just for bookkeeping.@kabajiegara: No, that will not work, consider array "2 1" - if you sort, you'll have "1 2" and would thus return 1, which is the wrong answer because the first unique is 2.

### Financial Software Developer at Bloomberg L.P. was asked...

22 Dec 2012
 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 Answersuse recursion2^n possibility...F(n) = F(n-1)+F(n-2)Show more responsesSummation(i=0,floor(n/2))[(n-i)C(i)]. I'm sure this can be further simplified though.Correction on the above: Summation(i=0,floor(n/2))[(n-i)P(i)].Summation(i=0,floor(n/2))[(n-i)C(i)] is correct. I need to sleep. Sorry.

23 Jul 2010

### Java Developer at IHS Markit was asked...

9 Nov 2010
 How would you measure 4 litres of water if you have 3 litre and 5 litre canisters?7 Answers1) Pour water in 5 litre container 2) Pour 5 litre container into 3 litre until full. You are left with 2 litre in 5 litre container 3) Empty 3 liter container. Pour 2 litre into 3 litre container 4) Fill 5 litre container until full 5) Pour 1 litre into 3 litre container until full. Left with 4 litres in 5 litre container.1. fill half of the 3 litre container 2. fill half of the 5 litre containerhttp://brainteaserbible.com/interview-brainteaser-puzzle-water-jugShow more responsesbit lenghty but 1)both 3 & 5l are empty. 2) fill 3l, pour in 5l, fill 3l again and pour in 5l, you'll have 1 l in 3 l. now pour this 1l somewhere then fill 3l one more time.Add 2 full measures using the 5l, remove 2 full measures with the 3l, you are left with 4l.Fill full water in the 5 litre canister, remove 3 liters of it to the 5 litre to the 3 litre canister. Keep remaining in the 5 litre canister(=2 litre) somwhere. Take another 5 litre water and perform the same procedure.= another 2 litre... 2+2 =4 litre.. done.Fill full water in the 5 litre canister, remove 3 liters of it to the 5 litre to the 3 litre canister. Keep remaining in the 5 litre canister(=2 litre) somwhere. Take another 5 litre water and perform the same procedure.= another 2 litre... 2+2 =4 litre.. done.

29 Jul 2010

### Forward Deployed Software Engineer at Palantir Technologies was asked...

22 Nov 2017
 Merging of Sets: Sets Users which reference other user groups.6 AnswersRecursivelyHello! When did you interview?Beginning of NovemberShow more responsesOkay. Thanks!Hi, can you provide more details about the question? Thanks!Recursively is bad due performance ;-) Iterative is the better way.

5 Jan 2014