Software Engineer Interview Questions |

Software Engineer Interview Questions


Software engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Suppose that you earn 100% annual interest (APY) on $1 initial deposit. How long before you'll be as rich as Bill Gates ($63 billion)? Given a number, e.g., 314159, as an array [3,1,4,1,5,9], increment it: change it to [3,1,4,1,6,0].

17 Answers

Taking just the information we are given and ignoring taxes etc. 100% annual (compound) interest is the same as doubling your investment every year. So for the first four years it would go like this: $1, $2, $4, $8, $16, $32, ... Look familiar? Therefore: 63 Billion = 2^x or x = log2(63 billion) In an interview we wouldn't be able to throw this into a calculator so we would need to do it by hand. We can estimate powers of 2 as powers of 1000: 2^10 ~= 1000^1 2^20 ~= 1000^2 etc. Therefore 63 billion = 63 * 1000^3 or approximately = 63 * 2^30 We know that 64 is 2^6 so we can substitute that with the 63 to get: 2^6 * 2^30 which = 2^36 log2 of 2^36 is 36 Therefore you would have $63 billion after 36 years. Now if we validate with the calculator we see that after 36 years we would actually have about $68/$69 billion. While if we only waited until 35 years we would only have $34 billion.

@Sam That's not actually correct as you have not considered the first year where money increases from $1 to $2, so the correct answer is 37 years...

It toke ^ 10 to for 2 to reach 1k. So it will take ^ 30 to reach 1b. Then u need another ^ 6 to just pass 63b. S the answer is 36 years.

Quickly estimate 2^64 without using a pen/papar.

9 Answers

You have a 64bit interger counter set to 0. How long it will take to overflow the counter given that you are incrementing it at 4Ghz speed.

9 Answers

How to implement a queue simply using two stacks and how to implement a highly efficient queue using two stacks.

7 Answers

How to add a counter to to track the billionth user.

4 Answers

Calculating the max execution time of a program that had to fit into a certain size of memory on an embedded device.

2 Answers

how many golf balls could you fit into that building?

2 Answers

C++ versus Java. Reverse a singly lined list.

3 Answers

How long will it take for an unsigned 64 bit counter to overflow on a xxx ghz machine and another coding problem that requires recursive programming.

2 Answers

N-Way associative set cache

1 Answer
110 of 629 Interview Questions