Senior Software Engineer, Android Interview Questions | Glassdoor

Senior Software Engineer, Android Interview Questions

4

Senior software engineer, android interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

write a recursive function that solves the equation X[n] = X[n-1] + X[n-2] where X is an array that contains at least two integer values and the function should solve the question for the 3rd value in the array

2 Answers

I'm guessing a key element they want to see in your answer is that you realize there's a lot of recalculating the same values over and over in the recursion process, especially for large values of n. For example, x[5] = x[4] + x[3] x[4] = x[3] + x[2] x[3] = x[2] + x[1] x[2] = x[1] + x[0] x[1], x[0] are known x[1] is known x[2] = x[1] + x[0] x[1], x[0] are known x[3] = x[2] + x[1] x[2] = x[1] + x[0] x[1], x[0] are known x[1] is known If you cache a couple of values in the recursive function, you can improve performance significantly. You might also get some points for recognizing this can be used to generate the Fibonacci sequence.

yes its a fibonacci series problem solved using recursion and memoization, classic example of dynamic programming. without caching runtime is exponential.

Question : given an input string like below, solve it and return the answer in string only. Input : String : "1+3*4-2" Output : string : "11"

Question : given an input string like below, solve it and return the answer in string only. Input : String : "1+3*4-2" Output : string : "11"

Design a client-server system for gathering mobile application metrics.