MEDIUMasked at 1 company

Maximum Points Inside the Square

A medium-tier problem at 38% community acceptance, tagged with Array, Hash Table, String. Reported in interviews at HashedIn and 0 others.

Founder's read

Maximum Points Inside the Square is a medium-difficulty array and hash table problem with a 38% acceptance rate. It's been asked at HashedIn and tests your ability to work with coordinate geometry and constraints under time pressure. The problem looks simple on the surface but has a trap that catches most candidates who don't nail the edge cases first. If you hit this during an assessment and freeze on the approach, StealthCoder surfaces a working solution in seconds while the proctor sees nothing.

Companies asking
1
Difficulty
MEDIUM
Acceptance
38%

Companies that ask "Maximum Points Inside the Square"

If this hits your live OA

Maximum Points Inside the Square 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 for the engineer who has done the work but might still blank with a webcam pointed at him.

Get StealthCoder
What this means

The core trick is recognizing that you need to maximize points within a square boundary defined by coordinates or distance constraints. Most candidates jump straight to nested loops or brute-force checking every point, which either times out or misses the geometric insight. The real pattern involves sorting to isolate valid candidates, then using binary search or hash table lookup to count efficiently. Common fail: not handling ties or duplicate coordinates correctly, or misunderstanding whether the square boundary is inclusive. The string and sorting components matter because you're often parsing input and ordering by distance or coordinate value. When this problem appears live on your assessment and the naive approach doesn't pass all test cases, StealthCoder gives you the exact binary search or hash-based pattern to land the solution.

Pattern tags

The honest play

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

Maximum Points Inside the Square recycles across companies for a reason. It's medium-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 for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Points Inside the Square interview FAQ

Is this problem really medium, or is it harder than the rating suggests?+

The 38% acceptance rate signals that most candidates miss the optimized approach. The geometry logic itself is straightforward, but the constraint handling and edge cases push it above easy territory. Once you see the binary search or hashing pattern, it clicks fast.

What's the difference between a brute-force and optimized solution?+

Brute force checks every point against every other constraint, often O(n^2) or worse. Optimized uses sorting plus binary search or hash table to isolate valid points in O(n log n) or O(n). The input size dictates which one your proctor's test cases accept.

How do the topics connect: array, hash table, string, binary search, sorting?+

String parsing reads the input format. Array and hash table store and retrieve points. Sorting orders candidates by distance or coordinate. Binary search finds the boundary where points stop meeting the constraint. All five play a role in the full solution.

Will I see this at other companies besides HashedIn?+

Only HashedIn is reported for this exact problem. That said, the patterns (sorting, binary search, coordinate constraints) are common across tech interviews. Mastering this builds skills for related geometry and constraint problems.

What's the most common mistake candidates make?+

Not recognizing that the square boundary requires checking all four corners or edges consistently. Off-by-one errors in binary search are also frequent. Edge case: when the square has zero width or points lie exactly on the boundary. Test these first during your OA.

Want the actual problem statement? View "Maximum Points Inside the Square" 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.