Largest Triangle Area
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
You are given an array points of distinct points on the X-Y plane, where points[i] = [xi, yi].
Choose any three of the points and form a triangle. Return the largest area of any such triangle. Three collinear points form a degenerate triangle with area 0.
Answers within 1e-6 of the correct value are accepted. The input is small, so checking every triple is fine.
Examples
Constraints
- 3 <= points.length <= 50
- -50 <= xi, yi <= 50
- All points are distinct
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.