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.

Mid February, 2026

HubSpot

Staff

Mid December, 2025

LinkedIn

LinkedIn

Junior

Mid November, 2025

HubSpot

Senior

Comments

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