Just had an interview with US Bank. It's actually First American Funds (FAF), a sub-division of US Bank. They are looking for software/web developer. Since I live close by, they invited me for an in-person interview that lasted about an hour.
The non-technical part went fine I guess, the interviewer explained the job and I asked a few questions. The technical part consists of two questions, and I have to write on a white board.
Q1. Give an index x, return the x element in a Fibonacci Sequence.
Example, the sequence is 1,1,2,3,5,8..., for x = 4, the function should return 3.
I had a mental block on this, supposedly we should use recursive function for this.
The reason is that fab(1) = 1, fab(2) = 1;, fab(n) = fab(n-1)+fab(n-2) for n > 2.
i.e., something like this
long fib(unsigned long n) {
if (n < 1) {
return n;
} else if (n == 1 || n==2) {
return 1;
} else {
return fib(n-1)+fib(n-2);
}
}
I did a non-recursive version of it, which still works, but not as pretty.
Q2. Give x=3, y=5, swap the value without introduction another variable.
I was stuck here for a while, but it's actually quite easy.
x = x + y; //sum the two value together
y = x - y; //sum(x+y) - y = x;
x = x - y; //sum(x+y) - x = y;
I think bitwise operation would do as well, same concept.
--Update (2/29/08)--
Got a phone call from the head hunter/agent the next day saying I passed. So will have a final interview with the boss on Monday (3/3). Fingers crossed!
--Update2 (3/7/08)--
The manager seemed pleased during the final interview. And today I got an email from my headhunter saying the HR is checking with legal for visa issues. So either I get rejected because of visa issues, or I'll get an offer from them. We'll see.
Thursday, February 28, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment