Financial Software Developer Interview Questions | Glassdoor.co.uk

# Financial Software Developer Interview Questions

72

Financial software developer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

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

4 Dec 2009
 write a function that returns the first unique element in an array5 AnswersWhat the type of elements in the array? If character, set up the hash table, and scan the array. the hash table stores the index of each element. If the element appears more than once, update the table as a negetive value. After scanning, find the smallest index value from the hash table, which would be the first uniqure element. The time complex gonna be O(n), where n is the length of array.I wrote a sample program here. (I use map container here to replace hash_map. The doesnot work on my computer) #include "stdafx.h" #include #include using namespace std; static int find_unique_ele(char*,int); int _tmain(int argc, _TCHAR* argv[]) { char test = {'a','b','c','b','c','a'}; int min_index = find_unique_ele(test,6); if (min_index store_table_value; map store_table; while(i ::const_iterator test_it = store_table.find(*test); if(test_it != store_table.end()){ store_table[*test] = -1; } else{ store_table.insert(map::value_type(store_table_value(*test,i))); } i++; test++; } map::const_iterator table_it = store_table.begin(); store_table_value temp_value = *table_it; int min_index = temp_value.second; while(++table_it != store_table.end()){ temp_value = *table_it; if(temp_value.second < min_index || min_index < 0){ min_index = temp_value.second; } } return min_index; }I think in the above solution you have to scan the original array twice making it order (2n) or O(n). The 2nd scan is needed to determine the corresponding entry in the hash table whether it is unique or not. We need this to determine the first unique element in the array.Show more responsesSort the list then scan the list looking for a data item that does not match the previous item or the next item.very easy with c++ stl using unique() function or use hashtable for O(1) look -up HashTable mm = new HashTable(myArray.count()); for(int i =0; i

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

2 Aug 2010
 int i=14; if (i=15) i++; How much is i?4 Answers16You get an exception. i=15 isn't equality test, but assignment. if statement throws exception if the result of a test isn't a boolean.bagibyte is wrong no exception is thrown (in c++/c) ... the programmer made an error using '=' instead of '==' there for if (i =15) equates to true and i is set to 15 the i++ then increments it to 16Show more responsesanonymous is right, also wants to mention i=15 returns 15 and is true

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

29 Apr 2010
 2 pieces of string of different length and non-uniform width, each take one hour to burn. the remaining length of a burning string doesn't tell you how much longer it burns for. with a lighter measure 45 mins.3 Answerslight one string. light the second string on both ends. when he second string will be completely burnt(that will take 30 min), light the other end of the first string. wait until the first string is burnt... et voila!!!they EACH take one hourTie both strings together and light at both ends. Let them burn for 37.5 mins.

### 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.

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

23 Nov 2009
 template int Product (T1 a, T2 b, T3 c) { return a * b * c; } What is the error in the sample code above?4 AnswersI think that: template Should use , not ; between the types here Tutorial Example: template T GetMin (T a, U b) { return (aI think you cannot return an int since the parameter is type T, you do not know if it is an int, so you must return a type T.Actually returning an int could work in some cases. Either the result can be implicitly converted to int or there is a conversion operator defined.Show more responsesMaybe there is the potential error of not having defined the * operator for classes T1, T2,

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

20 Jun 2010
 You have a large data file, consisting of ten-digit numbers separated by new-line characters. Write a program in C to sort it, using at most 20MB of memory. Make it efficient.4 AnswersUsing external sort ?That works, and a quick implementation in C will score you some points, but you can do much better than that. I believe the solution they're looking for is Pigeonhole sort.I think that combination of external sort and radix sort could also work well.Show more responsesSince you can't load whole file into memory and sort in place, you should use a sorting algorithm which sorts data by buckets. Probably interviewer was asking about any **merge sort**. It's most famous nLog(n) algorithm which can split data, sort splits and then merge buckets. Interviewer will be happy if you know f.e. radix sort, but merge sort is quite enough.

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

3 Feb 2010
 how can I count the bit set to 1 in an integer? What if I want to optimize the process to work with several integers?2 Answershe wanted me to speak a lookup tableint BitCount(unsigned int u) { unsigned int uCount = 0; for(; u; u>>=1) uCount += u & 0x1u; return uCount; } 2nd part Copy the integers to a piece of memory and pass its address in to the function above

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

2 Mar 2013
 Would Java Bytecode generated by Java 7 work on a JVM made to function on Java 1.0?2 AnswersYes.. Java Bytecode didn't change, Java syntax did!No, it can't. JVMs are not forward compatible, they can only run bytecodes generated by current or previous versions.

### Financial Software Development - Internship at Bloomberg L.P. was asked...

23 Mar 2013
 Most efficient way to find the most frequent number (0-255) in a string of numbers4 AnswersMapI think they were probably looking for a tweaked pidgeonhole sort to count the duplicates.//count in two passes.. int function() { int nums; //assume this array holds all the number between 0 to 255 int counter = {0,};//all init to zero for(int i=0;i counts[i]) max = i; } return max; }Show more responsesPrevious solution is okay. Since your data type is in range [0,255] (1 byte), then storing an array of counters and 2 loops is a good trade off memory/cpu consumption. So your code will run in 2n time( linear, O(n)), and use 256 * sizeof(size_t). Interviewer wasn't interested in algorithm, he was interested how you can make trade offs mem/cpu

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

2 Mar 2013
 Classic one from them: You have an array and you want to find the first non-repeating element.2 AnswersHash functionsYou could sort the array, then scan it to find the first non-repeated item. = O(nLog(n)) if using a decent sort. Or ... Simply check if the 1st item exists in the rest of the array, then the 2nd etc. O(n*n) Or... if the range of values being checked lies within known bounds use a pigeon-hole check to find duplicates.
110 of 72 Interview Questions