Pregunta de entrevista de Zynga

Write a function that implements division without dividing or multiplying.

Respuestas de entrevistas

Anónimo

26 mar 2013

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

1

Anónimo

18 may 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

Anónimo

17 ene 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