Uber SSE (L5A) Phone Screen

uber logo
uber
· SDE II
April 4, 2026 · 0 reads

Summary

I interviewed for an Uber Senior Software Engineer (L5A) role via a phone screen where I was asked to design O(1) methods for tracking one‑time visitors in a customer visit stream.

Full Experience

Problem

You are given a stream of customer visits. Each customer is identified by an integer customerId.

A customer is called a one-time visitor if they have visited exactly once.

Implement the following methods:

postCustomerVisit(int customerId) 
// Records a visit for the given customer.
getFirstOneTimeVisitor()
// Returns the first customer who has visited exactly once.
// If no such customer exists, return -1.

Example :

postCustomerVisit(2)
postCustomerVisit(5)
postCustomerVisit(2)
postCustomerVisit(3)
getFirstOneTimeVisitor() → 5

postCustomerVisit(2)
postCustomerVisit(4)
postCustomerVisit(5)
getFirstOneTimeVisitor() → 3

Constraints Up to 100,000 operations Customer IDs are positive integers

Expected Complexity :

postCustomerVisit -> O(1)
getFirstOneTimeVisitor -> O(1)

Interview Questions (1)

1.

First One-Time Visitor in Stream

Data Structures & Algorithms

You are given a stream of customer visits. Each customer is identified by an integer customerId. A customer is called a one-time visitor if they have visited exactly once.

Implement two methods:

  • postCustomerVisit(int customerId): Records a visit for the given customer.
  • getFirstOneTimeVisitor(): Returns the first customer who has visited exactly once. If no such customer exists, return -1.

Example

postCustomerVisit(2)
postCustomerVisit(5)
postCustomerVisit(2)
postCustomerVisit(3)
getFirstOneTimeVisitor() → 5

postCustomerVisit(2)
postCustomerVisit(4)
postCustomerVisit(5)
getFirstOneTimeVisitor() → 3

Constraints

  • Up to 100,000 operations
  • Customer IDs are positive integers

Expected Complexity

  • postCustomerVisit → O(1)
  • getFirstOneTimeVisitor → O(1)

📣 Found this helpful? Please share it with friends who are preparing for interviews!

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!