# 879

Financial Intern interview questions shared by candidates

## Top Interview Questions

Sort: Relevance|Popular|Date
Financial Software Developer Intern was asked...17 April 2012

### There are 20 floors in a building. If you're on an elevator and you're trying to get to the 20th floor, what is the probability that 4 people ahead of you click the 20th floor before you do? Assuming you click last.

The above two are close, but wrong.. There are 20 buttons, thus 20 choices, sure. But you are getting on at one of the floor. No body will press the button for the floor they get on.. Thus, there is really only 19 choices. P = (1/19)^3 (Independent events mean (1/19)(1/19)(1/19)). Less

1/19 + 1/18 + 1/17 + 1/16 assuming that there were no repeated destinations.

based on question: P(all 4 ahead of you want to get off on 20th fl) = (1/19)^4 real life(all 4 want to get off on 20th fl, and one of them is the first person press the button to 20th fl, and that leave all others, including you, stay still): (1/19) * (1/4) Less

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

#include using namespace std; const int maxx = 5; const int maxy = 5; void printpath(int x = 1, int y = 1, string path = "") { if(x Less

Suppose 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. Less

@Sid Ray: Thanks for the hint.

### Linked list memory management: deleting a node from the middle of a list was easy. Next question - how to delete a node from the end of a list. Was too tired to think and realize this was a trick question.

check node-&gt;next-&gt;next equals to null or not, then can just update node-&gt;next = null Less

I guess this question makes sense only when we don't know the Head node !

You can't, since the pointer already points to null. No way around it.

### Write a function to cause stackoverflow.

That is not true if the compiler use tail recursion. Using tail recursion will not cause a stack overflow. Less

Call a function inside of itself with no exist condition

Call a function from itself in an infinite loop.

### I've been asked three questions. The only one I missed is quite a basic question:If you want to do something before Java GC recycle the object?

Just simply override the Finalize() function.

Not quite. Finalize() is unreliable, in some cases it is not called (e.g. when exiting the application and shutting down the runtime). If you want to call something every time reliably (aka destructor in C++) use the reliable try/finally block. The question does not say that it needs to be run "right before GC", just "before GC". And because you cannot call any method after GC (other than fiddling with Unsafe), everything you call at any time during the program execution is called "before GC". Less

override finalize() method. This is the method called right before GC recycle the object Less

### Write a function to convert First Name, Last Name to Last Name, First Name.

#include using namespace std; void swap (string * first, string * last); int main () { string first, last; cout &gt; first; cout &gt; last; swap (&amp;first, &amp;last); cout &lt;&lt; "Swapping your first and last name." &lt;&lt; endl; cout &lt;&lt; "Your first name is now " &lt;&lt; first &lt;&lt; "." &lt;&lt; endl; cout &lt;&lt; "Your last name is now " &lt;&lt; last &lt;&lt; "." &lt;&lt; endl; return 0; } void swap (string * pfirst, string * plast) { string temp = *pfirst; *pfirst = *plast; *plast = temp; } Less

To be precise I forgot to add: // above swap (&amp;first, &amp;last) cout &lt;&lt; "Your name is " &lt;&lt; first &lt;&lt; ", " &lt;&lt; last &lt;&lt; endl; // replace above return 0; cout &lt;&lt; Your name is now " &lt;&lt; first &lt;&lt; ", " &lt;&lt; last &lt;&lt; endl; You don't have to pass by reference, you could have just used the swap function to reverse the order of the first and last name, but this is more impressive for an interview! Less

You can do it inplace my swapping the last and first char and then shifting the start index and rest string by one place each time. Less

### Given a dollar value, write a function that calculates the number of possible coin combinations that make up that value.

You need to use Dynamic Programming

Try Diophantine

that was my CS101 first question on the first lab assignment, modulo and division Less

### What is put option?

An insurance that you pay to hedge against price changes in the future. buy put to hedge against price going down. Less

Where you “put” options on high or low before a date

A put option is a right but not obligation to sell the underlying asset at the strike price at maturity. One put option contains 100 shares of the underlying asset. A put option can be an effective tool for managing risk and uncertainty. Using a protective put one can hedge the potential downside risk of the portfolio, with only giving up a small portion of the upside potential, which is the premium paid for the option(s). This is known as the breakeven point. Less

### if A! + B! + C! = ABC and A, B, C are single digit numbers, find A, B, and C.

145. You don't need to check for 0. You don't need to check for any number &gt;=6 (6! = 720, therefore 6! + B! + C! will be greater than 720. Thus, ABC needs to be greater than 720. But even if we assume A = 6, the number cannot be greater than 654, assuming that there are no repetitions in the digits). Thus, we're reduced to [1, 5]. Now, 5! + 4! + 3! = 120 + 24 + 6 = 150. Thus, we know that the first digit of the number has to be a 1. So we're left with just 12 combinations for B and C and 145 seems to fit pretty well :) PS: This is under the assumption that the digits are unique. Less

#include int factorial (int n) { int i, f = 1; for (i = 2; i &lt;= n; i++) { f = f * i; } return f; } int main() { int a,b,c; for (a=0; a &lt; 10; a++) for (b=0; b &lt; 10; b++) for (c=0; c &lt; 10; c++) { int af = factorial (a); int bf = factorial (b); int cf = factorial (c); int sum = af + bf + cf; if (sum == (100*a + 10*b +c)) { printf ("A = %d, B = %d, C = %d\n", a, b, c); return 1; } } return 0; } Less