Amazon Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
2
of 2 vote

Use the matrix method. Search the web for more details.

- Anonymous April 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

You can always use the golden ratio for the equation Fib(n) = (Gr^n-(-Gr)^(-n))/sqrt(5)... if you take the floor of this function that will return the nth fibonacci... a different way is obviously using recursion to do the brute force method... but this can be time and memory costly

- rdo April 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Problem with this is floating point will have precision issues because of sqrt(5) and you might get wrong results when n is large. If you try to avoid precision issues and try to compute sqrt(5) using only integer arithmetic, you will realize that a fast way to do that is to first compute Fibonacci numbers!


Matrix method can avoid those issues and only uses integer arithmetic.

- Anonymous April 05, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Golden ratio value: 1.6180

- jane April 03, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

f(n) = F(n-1) + F(n-2)

fibbonacci series where f(1) = 1
and f(0) = 0

- DashDash April 04, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

geeksforgeeks.org/archives/10120

- dumbhead April 06, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

garimaa.blogspot.in/2012/04/program-5th-in-c.html

- two solution with error check involved April 06, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int get_nth_fib(int n) {

return n > 1 ? (get_nth_fib(n-1) + get_nth_fib(n-2)) : 1 ;

}

- Anonymous August 22, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More