Search
⌘K

Leetcode 277. Find the Celebrity

Given n people and an API knows(a, b), find the celebrity — someone who is known by everyone else but who knows no one — or return -1 if none exists. The core challenge is to identify the candidate with minimal knows() calls (typically via pairwise elimination) and then verify incoming/outgoing relationships in O(n) time and O(1) space.

Asked at:

HubSpot

LinkedIn

LinkedIn


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early March, 2026

LinkedIn

LinkedIn

Junior

Early March, 2026

HubSpot

Senior

Slightly different variation, but the core problem was the same

Late February, 2026

LinkedIn

LinkedIn

Senior

Your account is free and you can post anonymously if you choose.