Classifying Triangles by Lengths
A easy-tier problem at 51% community acceptance, tagged with Database. Reported in interviews at Aon and 0 others.
This problem lands on your screen during the OA, and you panic because it says Database but your brain's still in LeetCode mode. Aon has asked it. The acceptance rate hovers just over 50%, which means half the people who attempt it walk away empty-handed. The trick isn't complex math or a clever algorithm. It's understanding that the interviewer wants you to organize triangle classification logic in SQL or a database query, not in application code. If you've drilled only coding problems and haven't touched database queries in weeks, this one will cost you time you don't have. StealthCoder solves it in seconds, invisible to the proctor, so you move on.
Companies that ask "Classifying Triangles by Lengths"
Classifying Triangles by Lengths is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderThe problem asks you to classify triangles (valid, isosceles, equilateral, scalene) using database queries instead of procedural logic. Most candidates default to their language's if-else chains, then realize mid-attempt that the framework expects a SELECT statement with CASE logic. The failure point: not setting up the classification correctly in SQL syntax, or forgetting edge cases like invalid triangles (where one side is longer than the sum of the other two). You need a WHERE clause to filter valid triangles first, then CASE statements to bucket them. The SQL structure matters more than the math. If this hits your live assessment and you blank on the exact CASE syntax or the validity check, StealthCoder surfaces a working query in seconds, letting you copy and move on.
Pattern tags
You know the problem.
Make sure you actually pass it.
Classifying Triangles by Lengths recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Classifying Triangles by Lengths interview FAQ
Is this problem still asked, or was it a one-off at Aon?+
Aon is the only company in the public record asking it, so frequency is low. However, database classification problems are common at enterprise firms. If your OA targets Aon or similar companies, this pattern matters. It tests whether you can think in SQL, not just code.
Why is the acceptance rate only 50% if the problem is easy?+
Most candidates underestimate the database angle. They solve the triangle math correctly but fail the query syntax or miss the SQL filtering logic. Easy difficulty doesn't mean easy execution if you're unprepared for the database framework.
What's the main trick to classifying triangles in SQL?+
Validate first, classify second. Use a WHERE clause to filter out invalid triangles (where one side is >= sum of the other two). Then stack CASE statements to distinguish equilateral, isosceles, and scalene. Order matters.
Do I need to memorize triangle classification rules?+
No, the rules are simple. Equilateral: all three sides equal. Isosceles: exactly two sides equal. Scalene: all sides different. Invalid: one side is greater than or equal to the sum of the other two. Write them down as CASE conditions.
How much does SQL syntax matter versus the logic?+
Syntax is everything in a database problem. Your logic can be perfect, but a malformed CASE statement or missing WHERE clause tanks your submission. Test your query before submitting, even on the live assessment.
Want the actual problem statement? View "Classifying Triangles by Lengths" on LeetCode →