uber logo
Uber· SDE II

Uber SSE (L5A) Phone Screen

Posted
4 Apr 2026
284 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.

How it went

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)

Questions asked (1)

  1. 01

    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)

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Uber recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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