Software Engineer Interview Questions | Glassdoor.co.uk

# Software Engineer Interview Questions

2,452

Software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Software Engineer at Bloomberg L.P. was asked...

27 Jul 2010
 What is the main difference that OO programming brought?3 AnswersPolymorphism, etc..Shifted the focus from procedural programming to viewing everything as real world entities and modelling solutions from that perspectiveShifted the focus from procedural programming to viewing everything as real world entities and modelling solutions from that perspective

### Software Engineer Internship at FactSet was asked...

20 Apr 2012
 How work you work out all the prime numbers up to a given range?3 AnswersStore all the prime numbers in an array and compare the next number with the array to find out whether it is prime or not.Sieve of Eratosthenes algorithm. create an array of the numbers, set them all to the value 1. Start at 2, set every second number after 2 to 0. move to the next number (3). change every third number after three to zero. stop when there's no more numbers set to 1 or you reach the end of the array. At the end, the numbers marked 1 are the primes.Interview candidate - did you give that answer in the interview? If so, what did they say?

3 Aug 2011
 implement dijkstras algorithm2 Answersif you know the algorithm itself, then its easyWas that the exact question? Wow, very specific!

### Mobile Software Engineer at Bloomberg L.P. was asked...

10 Jan 2010
 What does C++ compiler do if i declare a class only as Class A{ };2 AnswersGenerates a default constructor, copy constructor and assignment operator.What M Cox said & also the destructor.

### Software Development Engineer In Test at Amazon was asked...

29 Aug 2013
 Asked question: Using an already implemented method Rand5() that generates a random integer between the ranges 1-5 uniformly. Using this method, implement a a new method that returns a random integer in the range 1-7 uniformly, i.e. Rand7(). Basically this is Rejection Sampling Algorithm. See http://leetcode.com/2010/11/rejection-sampling.html2 AnswersNo need for sort in array question as it will increase running time to O(2log2) not good. Instead... Set largest to first element Set second largest to largest Loop over every element, if current value greater than largest then set second largest to largest and then set largest to current value else if value greater than second largest set second largest to value continue loop return second largest/* following is based on the link provided in the interview question above */ int Rand7() { int[] arr = new int[21] {1..21}; int idx = int.MaxValue; do { idx = (Rand5() - 1) * 10 + Rand5() -1; if(idx20) }

### Software Engineer at Bloomberg L.P. was asked...

8 Oct 2011

27 Sep 2012
 How do you ensure that variables are safe when there are two threads involved2 AnswersUse c++ atomics types , use built-in assembly atomics, use mutexIf these variables form a critical section then that section must be protected by a lock, use java synchronized, a Lock like ReentrantLock or use a nonblocking algorithm by making use of the Atomic variables. If the variables don't form a critical section, then you don't need locks, if possible use an object from Atomic package or make the variable volatile.

25 Jul 2010
 What is the kernel call to get the inode information of a file?2 Answersgetdentsstat fstat or lstat base on what the file is.