Spotify DS Interview Experience

New / Consultant
jennatalia

New Consultant

PRE
Spotify
jennataliamore
May 19 3 Comments

For anyone else interviewing with Spotify.

Google Hangout style interview with coderpad.

Section 1: SQL

Join two tables together to get a specific end result.

Make a query to get the top n records in each group.

Section 2: Coding challenge.

Write a function to test if a number is prime.

I ended up just running a loop for each number n to see if input % n = 0 if found, return false.

The original algorithm counted down, I optimized it by rewriting the algorithm to count up and stop at the halfway mark.

comments

Want to comment? LOG IN or SIGN UP
TOP 3 Comments
  • For primality testing, you can check base cases, then divisibility by 2 and odd integers from 3 to sqrt(n).
    May 19 0
  • New / Eng __python3
    Seive of Eratosthenes
    May 19 0
  • Fannie Mae 996
    Given unlimited space (O(n)) sieve method works well.
    May 19 0