// I don't get this question.... // Is there any Aha algorithm for solving it, instead of the naive approach? int divide(int dividend, int divisor) int ans=0, partial=0; while(partial+divisor

No, its essentially that asinine. Glad I spent 10 years in the industry and got my PhD to be judged on this algorithm....

I'm not sure a correct answer for this question is going to say, "Hey...Here's the next designer/programmer of Chrome v2"....? WTF?!? public static void main(String[] args){ int divisor = 2; int number = 100; int i = Integer.MAX_VALUE; for (int j = 1; j = number) { System.out.println((j)); break; } } }

If they were looking for engineers with dumb ideas like totally destroy their branding by copying Bing's background image function, this would definitely be a good recruiting questions.... like I said before; idiots!

int a = 9; int b = 2; int sum = 0; int result = 0; while (sum + b < a) { int term = b; int mult = 1; while (sum + term < a) { result = result + mult; sum = sum + term; term = term + term; mult = mult + mult; } } Print result; It's not hard to realize the calculation time is O(Log(a)) and more precisely C * Log(a/b) <= Time <= C * 2 * Log(a/(2*b))

delegate the problem to one of the mindless google calculator boys.