This is a SQL / Logic problem where you are given a table Triangles with three columns representing the lengths of the three sides: A, B, and C. You need to classify each row as:
This is a common question at Aon and other data-focused companies. It tests your ability to implement conditional logic in SQL using the CASE statement. It also evaluates your basic geometry knowledge and whether you can handle the "Not A Triangle" edge case before performing the classification.
The pattern is Conditional Logic (CASE WHEN). You must evaluate the conditions in a specific order:
| A | B | C |
|---|---|---|
| 20 | 20 | 20 |
| 20 | 20 | 30 |
| 20 | 30 | 40 |
| 10 | 10 | 30 |
The most significant mistake is forgetting the triangle inequality check. Without it, sides like (10, 10, 30) might be incorrectly classified as "Isosceles." Another mistake is not putting the CASE conditions in the right order—the equilateral check must come before the isosceles check.
When using CASE statements, always put the most restrictive or important conditions first. SQL evaluates the WHEN clauses in order and stops at the first match.