Google Coding Round 1
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)
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.
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.