EASYasked at 2 companies

Find the Town Judge

A easy-tier problem at 50% community acceptance, tagged with Array, Hash Table, Graph. Reported in interviews at Arista Networks and 1 others.

Founder's read

Find the Town Judge is the kind of problem that looks trivial until you realize you need to track both in and out degrees simultaneously. At a 50% acceptance rate, half the candidates who see it live either overthink the graph structure or miss the constraint that the judge trusts everyone but no one trusts the judge. Arista Networks and Turing both ask it. It's short, but the trick matters. If you blank on the approach during the assessment, StealthCoder runs invisibly and surfaces the solution in seconds, so you can move on and not waste time on an easy problem.

Companies asking
2
Difficulty
EASY
Acceptance
50%

Companies that ask "Find the Town Judge"

If this hits your live OA

Find the Town Judge is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

The trap is treating this like a complex graph problem when it's really about degree counting. The judge is the one node with in-degree N-1 and out-degree 0. Most candidates either iterate inefficiently, check trust relationships repeatedly, or overcomplicate with adjacency lists. The pattern: use two arrays or hash tables, one for in-degree (people who trust this person) and one for out-degree (people this person trusts). Scan once, find the match. It's Array and Hash Table work dressed up as a Graph problem. The actual code is five to ten lines. On a live assessment where you're nervous, the clarity of that pattern matters. StealthCoder is the hedge if the constraint set doesn't click in the moment.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Find the Town Judge recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Find the Town Judge interview FAQ

Why is the acceptance rate only 50% if this is marked EASY?+

Candidates overthink the graph angle or misread the constraint that the judge has zero out-degree. The problem statement is slightly tricky, not the algorithm. Once you realize it's just counting degrees, it becomes straightforward. Most rejections are from bad edge-case handling or inefficient scans.

Is this still asked at Arista and Turing?+

Yes, it appears in their reported assessments. Both companies use it at the screening or phone stage. It's popular because it's quick to evaluate but catches candidates who panic or skip careful constraint reading. Expect it if you're on their pipeline.

What's the difference between solving this with an Array vs. a Hash Table?+

Array is faster if N is small and bounded, which it usually is. Hash Table is safer for sparse or unknown ranges. For this problem, Array is standard. Both are O(N) space and O(N) time, so the choice doesn't matter algorithmically, only on code simplicity and language defaults.

How does this relate to the other topics listed, especially Graph?+

It's labeled Graph because you could model it as a directed graph where edges represent trust. But the solution never builds an adjacency list or runs DFS/BFS. It's pure degree counting. The Graph tag is misleading and trips up candidates who expect a traversal pattern.

What's the most common mistake on this problem?+

Forgetting that the judge has both constraints: everyone trusts them AND they trust no one. Candidates often check only in-degree, miss the out-degree check, and return a wrong answer. A second loop verifying both conditions catches this instantly.

Want the actual problem statement? View "Find the Town Judge" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.