Geometry Problems for Coding Interviews
53 Geometry problems from real coding interviews, each with test cases you can run online. By difficulty they split into 10 basic, 32 intermediate and 11 advanced. The companies that ask them most often are Google, Amazon, Microsoft, Bloomberg.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Pascal Triangle Value (Intermediate)
- Largest Perimeter Triangle (Basic)
- Circular Window Maximum (Basic)
- Maximum Circular Subarray (Intermediate)
- House Robber II (Intermediate)
- Gas Station (Intermediate)
- Triangle Minimum Path (Intermediate)
- A-Star Pathfinding (Intermediate)
- As Far From Land as Possible (Intermediate)
- Freedom Trail (Advanced)
- Minimum Score Polygon Triangulation (Intermediate)
- Josephus Winner (Intermediate)
- Convex Hull Vertex Count (Advanced)
- Point in Polygon Classification (Advanced)
- Lattice Points Inside Circles (Intermediate)
- Maximum Manhattan Distance (Intermediate)
- Largest Triangle Area (Basic)
- Min Cost to Connect All Points (Intermediate)
- Count Triangles in a Graph (Intermediate)
- Find the Safest Path in a Grid (Advanced)
- Minimum Distance to Type With Two Fingers (Advanced)
- Necklaces With K Colors (Advanced)
- Valid Triangle Number (Intermediate)
- Minimum Cuts to Divide a Circle (Basic)
- First to Roll Target Face Win Probability (Intermediate)
- Doubled Polygon Area (Basic)
- Boundary Lattice Points of Polygon (Intermediate)
- Interior Lattice Points of Polygon (Intermediate)
- Orientation of Three Points (Basic)
- Is Polygon Convex (Intermediate)
- Count Collinear Triples (Intermediate)
- Axis-Parallel Right Triangles in Points (Intermediate)
- Number of Corner Points of Convex Hull (Intermediate)
- Convex Hull Doubled Area (Intermediate)
- Integer Points in Origin Circle (Intermediate)
- Lattice Points on a Circle (Advanced)
- Point Inside Triangle (Basic)
- Is Polygon Simple (Advanced)
- Clock Page Replacement Faults (Advanced)
- Bracelet Count With Reflections (Advanced)
- Pythagorean Triple Perimeter Count (Advanced)
- Angle Type Between Vectors (Basic)
- Manhattan Distance Sum of All Pairs (Intermediate)
- Triangle Count (Intermediate)
- Polygon Diagonal Count (Basic)
- Lattice Points Inside a Circle (Intermediate)
- Collinear Triple Count (Intermediate)
- Right Triangle Triples (Intermediate)
- Isosceles Triangle Triples (Intermediate)
- Triangle Kind From Sides (Basic)
- Robot Distance After Repeated Program (Intermediate)
- Candy Rounds Final Receiver (Intermediate)
- Distinct Spots Visited on a Circle (Intermediate)
Related
- Basic Geometry problems
- Intermediate Geometry problems
- Advanced Geometry problems
- Practice coding problems online
- All interview guides
Frequently asked questions
How do I get good at geometry problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run geometry problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.