WalzoneInterview Prep
๐Ÿ“ž Interviewing soon? Practice with a realistic AI mock phone interview โ€” it calls you, then scores you. First 15 min FREE โ†’

Wall Street Quant ยท Puzzles & Problems ยท question 22 of 155

You are given three points in a plane. Construct an algorithm to determine the center and radius of the unique circle that passes through all three points.?

๐Ÿ“• Buy this interview preparation book: 155 Wall Street Quant questions & answers โ€” PDF + EPUB for $5

To determine the center and radius of the unique circle that passes through three non-collinear points (A(xA,โ€†yA), B(xB,โ€†yB), and C(xC,โ€†yC), you may follow these steps:

1. Find the midpoints of the line segments AB and BC, denoted as D and E, respectively.


$$x_D = \frac{x_A + x_B}{2},\ y_D = \frac{y_A + y_B}{2}$$

$$x_E = \frac{x_B + x_C}{2},\ y_E = \frac{y_B + y_C}{2}$$

2. Calculate the slopes of the lines AB and BC, denoted as mAB and mBC, respectively.


$$m_{AB} = \frac{y_B - y_A}{x_B - x_A}$$

$$m_{BC} = \frac{y_C - y_B}{x_C - x_B}$$

3. Determine the slopes of the perpendicular bisectors of line segments AB and BC, denoted as mD and mE, respectively.


$$m_D = -\frac{1}{m_{AB}} = -\frac{x_B-x_A}{y_B-y_A}$$

$$m_E = -\frac{1}{m_{BC}} = -\frac{x_C-x_B}{y_C-y_B}$$

4. For the perpendicular bisectors of line segments AB and BC, calculate the equations of the lines containing the bisectors of both line segments. Using the point-slope form, these are:


yโ€…โˆ’โ€…yDโ€„=โ€„mD(xโ€…โˆ’โ€…xD)

yโ€…โˆ’โ€…yEโ€„=โ€„mE(xโ€…โˆ’โ€…xE)

5. Next, solve the system of equations in step 4 to find the coordinates of the center O(xO,โ€†yO) of the circle.

6. Finally, compute the radius of the circle by finding the distance from the center to any of the original points, say point A. To calculate the distance between two points, you may use the distance formula:


$$r = \sqrt {(x_O - x_A)^2 + (y_O - y_A)^2}$$

Once you have the center and radius, youโ€™ve found the unique circle that passes through the three points.

For an algorithm, you may implement these steps in any programming language or mathematical tool, making sure to handle special cases such as vertical lines, horizontal lines, and duplicate points.

Reading is step one. Saying it out loud is the interview. Our AI interviewer calls your phone and runs a realistic Wall Street Quant interview โ€” then scores it.
๐Ÿ“ž Practice Wall Street Quant โ€” free 15 min
๐Ÿ“• Buy this interview preparation book: 155 Wall Street Quant questions & answers โ€” PDF + EPUB for $5

All 155 Wall Street Quant questions ยท All topics