Pergunta de entrevista da empresa Zynga

Write a function that implements division without dividing or multiplying.

Respostas da entrevista

Sigiloso

26 de mar. de 2013

After giving a satisfactory answer, I was told that it can be optimized to constant time.

1

Sigiloso

18 de mai. de 2013

For integer division: divide = lambda a,b: 0 if a < b else (1 + divide(a-b, b)) Curious to see how he thinks it can be done in constant time... http://en.wikipedia.org/wiki/Computational_complexity_of_mathematical_operations#Arithmetic_functions

1

Sigiloso

17 de jan. de 2021

Through questions like this, interviewers are mostly trying to test your skillset (and its relevance to the role) as robustly as possible, so be prepared for multiple offshoots and followups. It could be a useful exercise to do mocks with friends or colleagues in Zynga to get a real sense of what the interview is actually like. Alternatively Prepfully has a ton of Zynga Software Engineer New Grad experts who provide mock interviews for a pretty reasonable amount. prepfully.com/practice-interviews