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

snap logo
snap
Staff SWEUSOngoing
October 13, 20259 reads

Summary

I had a phone screen interview at Snap for a Staff SWE role in the US, where I was tasked with implementing Java's Math.sin(x) function using its Taylor Series. Although I received some hints, I passed this round and was downleveled for the onsite interview.

Full Experience

My recent phone screen interview at Snap for a Staff Software Engineer position in the US presented an interesting challenge. The core task was to implement Java's Math.sin(x) function, specifically using its Taylor Series definition: $$X - X^3/3! + X^5/5! - X^7/7!....$$ The interviewer prompted me to consider the practical aspects, such as when to terminate the infinite Taylor series to prevent an infinite loop, and what level of precision was expected for the returned double value. While I did require a few nudges and hints from the interviewer to guide me through these intricacies, I successfully navigated the problem. Ultimately, I passed this phone screen and will be moving on to the onsite interviews, though I was informed that I would be downleveled.

Interview Questions (1)

Q1
Implement Math.sin(x) using Taylor Series
Data Structures & Algorithms

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: $$X - X^3/3! + X^5/5! - X^7/7!....$$

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?
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!