Pergunta de entrevista da empresa Google

If you have a computer with no division operator, how do you do it

Resposta da entrevista

Sigiloso

16 de mai. de 2012

1. Subtract repeatedly the denominator till remainder less than denominator 2. Keep doing 2 * last multiplier where last multiplier starts with denominator till the result goes bigger than numerator. Doubling since easy to do with left shift. Then figure out remainder / denominator.