Question d’entretien chez Zynga

Write a function that implements division without dividing or multiplying.

Réponses aux questions d'entretien

Utilisateur anonyme

26 mars 2013

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

1

Utilisateur anonyme

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

Utilisateur anonyme

17 janv. 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