Empresa engajada
In the first interview: they asked me to implement a pow(base, exp) function. I did a linear solution and they asked me to improve it (time complexity). There's a logN solution for this problem.
Sigiloso
Complexity of log(n) implemented via ruby:- def pow(a,b) if n == 0 return 1 else half_pow = pow(a, b/2) if b%2 == 0 return half_pow * half_pow else return half_pow * half_pow * a end end