[Snap][US][Staff SWE] Phone Screen Interview

Implement Java's Math.sin(x) function which takes an input number and returns the sin() double value.

sin(x) is defined by the Taylor Series as:

Challenges:

  1. Taylor series has no end. When do you decide to terminate and return value to avoid infinite loop?
  2. What is the precision to aim for return value?

Decision: Passed to onsite & Downleveled. Needed few hints from the interviewer to be nudged in the right direction.

Comments (7)