Financial engineer Interview Questions | Glassdoor.co.uk

# Financial engineer Interview Questions

145

financial engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

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

### 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[6] = {'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. One or more comments have been removed. Please see our Community Guidelines or Terms of Service for more information.

### Financial Engineer at Mako Trading Group was asked...

30 Aug 2020
 If you have a large cube filled with N-cubed cubes and you remove the top layer of those cubes, how many cubes have you removed ?4 Answersyou have removed: (N-cubed) - ((N-1)-cubed)length of cube = N ^ (1/3) Top layer == side of cube which is length ^ 2 == N ^ (2/3)The large cube has side length [N] and contains [N^3] small cubes. Therefore after you remove the top layer you are left with a large cube of side length [N-2] containing [(N-2)^3] small cubes. This then means the number of cubes you have removed is: [N^3] - [(N-2)^3]Show more responsesIf you've removed the top layer from just one face then it is N^(2/3). If you remove the top layer from all 6 faces then it would be: 2 x [ N^(2/3) + N^(1/3) x (N^(1/3) -2) + (N^(1/3) -2) x (N^(1/3) -2) ], which simplifies to: 2 x [ 3xN^(2/3) - 6xN^(1/3) + 4]

### 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 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 Engineer at First Derivatives was asked...

20 Apr 2018
 They ask what can you tell about the firm and their products. 3 AnswersSee website. Everything is theredid it take exactly 2 weeks from the initial (1st round) interview? thanks!Yeah something like that. Skype maybe a week after the call, and then the offer around a week after

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

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
 How does Java Garbage Collection work? How would you implement garbage collection?2 AnswersLook on youtube.. It's an entire lecture about it on UCLA's channel.Description without details: 1. Keeps reference count for each object(which is a pointer) 2. Increments/decrement a these counters when need 3. When there is no enough memory for a new object or after some timeout(actually there are many decision making algorithms for go) it iterates over all counters and frees memory used for objects with ref count == 0.
110 of 145 Interview Questions