Sift Interview Questions

Sift Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(81)
SQL
(63)
Machine Learning
(52)
Probability
(30)
Statistics
(22)

Sift Interview Questions

Practice for the Sift interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Medium

Create a class named LRUCache that implements the behavior expected of a Least Recently Used (LRU) Cache.

The LRUCache class implements the following methods:

  • __init__(self, capacity) - initializes the object and takes in a capacity parameter specifying the maximum capacity of the cache.
  • get_if_exists(self, key) -> Any|None - gets a value based on a key. If the key exists, returns the associated value. If the key has expired or did not exist in the first place, returns None.
  • put(self, key, value) - places a value inside the cache. In the case wherein the cache is full, invalidates the least recently used element. When two keys collide, the older value should be invalidated in place of the new one.

Example:

cache = LRUCache(2)
cache.put("sample", 55)
cache.get_if_exists("sample")  # returns 55
cache.get_if_exists("key")  # returns None
cache.put("hello", 10) 
cache.put("sample", 9)
cache.put("world", 5)
cache.get_if_exists("hello")  # returns None

Notes:

  • It is assured that the value in the put method will never receive a None value. Moreover, it is assured that the capacity will always be > 0.

  • All operations must be O(1).

  • Aside from Python’s standard dictionary implementation ({}), you may not use any other built-in data structures.

SQL
Easy
SQL
Easy
Loading pricing options

View all Sift questions

Challenge

Check your skills...
How prepared are you for working at Sift?

Sift Salaries by Position

$130K
$220K
Software Engineer
Median: $150K
Mean (Average): $167K
Data points: 6
$165K
$167K
Product Manager
Median: $167K
Mean (Average): $166K
Data points: 3

Most data science positions fall under different position titles depending on the actual role.

From the graph we can see that on average the Software Engineer role pays the most with a $166,667 base salary while the Product Manager role on average pays the least with a $166,333 base salary.

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.