Google Coding Round 1

google logo
google
August 31, 202533 reads

Summary

I had a Google coding interview where I was challenged to find the number of squares formed by a given set of coordinates, initially with axis-parallel sides and then with any orientation.

Full Experience

My recent coding round at Google began with an interesting geometry problem. I was given a list of [x, y] coordinates and asked to determine the total number of squares that could be formed using these points. The interviewer first clarified that the sides of the squares must be parallel to the x and y axes. After discussing this, a follow-up modified the problem to consider squares with any orientation, making it a more complex challenge.

Interview Questions (2)

Q1
Count Axis-Parallel Squares from Points
Data Structures & Algorithms

Given a list of [x, y] coordinates on a coordinate plane, find the number of squares. The sides of the squares are required to be parallel to the x and y axes.

Q2
Count Squares from Points (Any Orientation)
Data Structures & Algorithms

Follow-up question: Given a list of [x, y] coordinates on a coordinate plane, find the number of squares. The sides of the squares are NOT required to be parallel to the x and y axes, but it must still be a square.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!