Level: Intern
Round: Phone Screen · Type: Coding · Difficulty: 6/10 · Duration: 60 min · Interviewer: Neutral
Topics: Data Structures, Algorithms, Hash Table
Location: Remote
Interview date: 2026-01-19
Got offer: False
I had a technical phone screen for an Amazon internship. The question involved identifying users who have only visited a website once and retrieving the oldest of these users.
The coding question I received was:
Problem:
In a shopping website, to retain churned users, we need to analyze "non-returning users" (users who have visited only once) and provide them with promotional activities.
Core Task:
You need to implement a class containing the following two core methods:
newUserLogin(username): This method is called whenever a user logs in.getOldestOneTimeVisitingUser(): Returns the username of the user who logged in earliest (longest ago) among all users who have only visited once.Follow-up:
getOldestOneTimeVisitingUsers(int X): Extend the functionality to return the top $X$ oldest, one-time visiting users.
Example Analysis:
User login sequence: john -> jeff -> jeff.
Call getOldestOneTimeVisitingUser().
Result: Returns john. Although jeff has also logged in, he has logged in twice, which does not meet the "visited only once" condition.