Finance Interview Questions | Glassdoor

Finance Interview Questions

15,970

Finance interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

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

Nov 2, 2010
 Reverse an integer using C.5 Answersin C: int reverseint(int x) { int y, k=1; while ( x > 10 ) { y = k * ( x % 10 ); k *= 10; x /= 10; } return y; }whoops! "int y" should be "int y=0" and "y = k * ( x%10 )" should be "y += k * (x%10)"num = 0 for (i=0; i 1 ) { a = ( x % 10 ); y = y *10 + a; x /= 10; } printf ("%d", y); return 0; } And the output will be 126.

Aug 10, 2013

Financial Applications Engineer at Bloomberg L.P. was asked...

Mar 25, 2012
 If a 3x3 white cube is painted blue on its face and then cut into 1x1 cube, what are the chances of picking a cube with a blue side from a bag5 Answers33%4/9From a 3x3x3 Cube you can make 27 1x1x1 cubes, Since one face of the cube is painted blue. once face of 9 1x1 cubes will be blue. hence the answer is 9/27 = 1/3 = 33%Show More ResponsesIs it 6/27? why is 9?P= 1/3, or 33%

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

Nov 15, 2010
 Puzzle1 - Given 8 coins, and the fact that one of the coins is heavier than the other, how many times(min) do you need to use a beam balance to figure out which is the anomalous coin? After I answered this, he made it little tougher. Given 9 coins and one anomalous coin(maybe heavier or lighter), figure out which coin it is and whether heavier or lighter. What is the min no of comparisons? This is where i took a while to answer.5 Answers3 times. split 8 coins into 3,3 and 2. Compare the two 3 coin blocks. If they are equal, compare the 2 left over coins. else, pick the heavier 3 coin stack and do one more weighing. puzzle ans 2: split it into 3 groups of 3. Build it from here...You need 2 weighings to find heavier coin out of 8 coins and 3 weightings to find biased coin out of 9.The above answers are wrong. The answers only apply if you know in advance whether the coin is heavier or lighter. The answers do not work if you do not know if the coin is heavier or lighter.Show More Responsesfind 1 heavier amongst 8 coins: split 3 / 3 /2 and balance 3 /3. -if there is 1group heavier take the group of 3 and split the group in 3 groups of 1coin. blance 1/1: --if it is balanced then the third coin is heavier -- if it is not you found the heavier -if the 2 groups of 3 weight the same then check the balance between the 2 remaining coins... 2measurements!to find 1 biaised coin amongst 9: split into 3 groups A, B, C of 3 coins each. check the balance between between A and B. then check the balance between A and C. you can now know if the coin is lighter or heavier and what is his group. just find the heavier(or lighter) coin amongst the 3 coins of the group. 3 weightings

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

Mar 14, 2011
 how many blocks on an n x n megablock are not on the edge?4 Answersn X n - 4n + 4n x n - 8xn + 8Mega block, if in the sense a cube- (n^3) - (12(n-2)+8) where n^3- total 1x1 cubes 12(n-2)- cubes in the edges without the corners 8- corner cubesShow More ResponsesWhy not just? // Guaranteed all edges if n <= 2 return 0 return (n-2)(n-2)

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

Oct 1, 2010
 How would you print a linked list in reverse order?4 Answerspublic Node reverseList(Node root) { Node rev = root; Node current;// = root; Node fwd = root.left; rev.left=null; while (fwd!=null) { current = fwd; fwd=current.left; current.left=rev; rev=current; } return rev; }@blakdogg: The question is not about how to reverse the link list but to print it in reverse. Here is my solution: void reversePrint(Node* current) { if (current) { reversePrint(current->next); printf ("%s \n", current->data); } }Jon: Your solution would crash on a large data set. Too much stack space used. The first solution was a hint at the overall solution which would be to use that function twice. Once to reverse the list, then print, then reverse it back.Show More Responsesvoid printReverseLinkedList (Node node) { if (node.next != null) { printReverseLinkedList(node.next); } System.out.println(node.data); }

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

Feb 8, 2012
 Write a java program that can convert a string of numbers (e.g. "5387") into an integer (5387).4 AnswersYou can do math on individual characters, so subtract a constant from '5' and you can transform that character into an actual integer, 5. Then you need the String class and the Math.Pow() function. Don't forget to import the library that contains Math.Pow() !why do you need Math.pow()? will this work? fun() // input 5467 // take first character and transform into integer //multiply by 10 * index of character which is zero that is 5 + 0 = 5 then take the next character and transform into integer now multiply 5 * 10 * index of character which is one 50 +4 = 54 repeat 540+ 6 = 546 5460 + 7 = 5467 running time is O(k) k = no of digits or O(n) n being the numberThe way I did it was (for your example of 5467) essentially 5000 + 400 + 60 + 7. It's the first solution that came to mind and since that hour long portion of the interview seemed to be winding down, I just went with it. Not a pretty solution, but it does get the right answer. For your solution, I understand what you're doing but I think your description of it is a bit off, or at least confusing. The you don't multiply by the index of the character at any time. What you're doing is just multiplying the sum to that point by 10 before adding the next character... i.e. in pseudo code, sum = 0; n = (length of the string of characters); for(i==0; i < n; i++) { sum *= 10; sum+= (converted integer value of the character at index i); } So the first time through the loop when the index is zero, the initial sum multiplied by 10 is still zero, so you add 5 and get the running sum to be 5. Iteration 2, 5*10 = 50, add the next integer and you get 54, and so on. And that is a far more elegant solution, definitely. Thanks for pointing it out!Show More ResponsesIf Java is allowed than why to do all these things. Why not directly use wrapper calss Integer and convert a string to integer. String s="12345"; int i = Integer.parseInt(s); Simple !

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

Mar 4, 2010
 How to find out whether a number is odd or even.6 Answerslook at last bit.#include using namespace std; int main () { int num; cout > num; if (num % 2) { cout << "This number is odd." << endl; }else { cout << "This number is even." << endl; return 0; } } } }Add however many digits together ex. 23 is 2+3 which is 5, so that is not an even number. Just like 222 is 2+2+2 which is 6 so that is an even number. I know it sounds too easy but just give it a try with any number you like.Show More ResponsesJust thought that I'd give some people to think about, of course this does not work:) But how many of you gave it a shot?or & with 1, if ans = 0 even else oddJust check if the first bit is 1.

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

Mar 4, 2010
 You have 4 aces and a king in a set of cards, what's the probability of get kind before all aces.4 Answers20%1 - P(getting all aces before king)= 1 - (4/5 * 3/4 * 2/3 * 1/2)The correct approach is to find out what is the chances of getting the King as the very first card out of the 5. The answer is trivial. The solution is thus 1 - that chances.Show More Responsesinterview candidate is right rest are wrong: chance of having the king at first is 1/5 and we dont care about the other cards. So answer is 1/5. Anonymous is wrong: having the king first and the king last are not opposite statements: so its p(KAAAA=1-p(AAAAK)-p(AAAKA)-p(AAKAA)-p(AKAAA) = 1/5

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

Mar 5, 2010
 Suppose there is a rectangular map where you can only travel up or right to go from a start location in the bottom left corner to the top right corner, and each move is discrete. Write a program that prints all possible solutions to get from the start to finish.4 AnswersSuppose you need 5 R (right moves) and 5 T (top moves) to reach the upper right corner. Then you can do a permutation of the string, "RRRRRTTTTT" to get all the possible paths.@Sid Ray: Thanks for the hint.Thx for a nice hint.Show More Responses#include using namespace std; const int maxx = 5; const int maxy = 5; void printpath(int x = 1, int y = 1, string path = "") { if(x
4150 of 15,970 Interview Questions