Bloomberg | Phone | Collatz Conjecture

Anonymous User
1224
Nov 24, 2022
  • Phone interview with Bloomberg

  • Question: Determine the length of Collatz Conjecture. Discuss different approaches (iterative vs recursive). I used the iterative approach

  • Follow up questions: 1) How would you make subsequent computations more efficient? - Use a Hashmap 2) There are several repeated calculations within the While Loop. Is there a way we can optimize them? -> Use a stack to keep track of the values previously seen and store the results in Hash Map

  • I had to also implement the follow up questions

  • Questions on Why Bloomberg/Fav Project/Why SE and so on

Comments (2)