HomeChallengesRepsProblemsLeaderboardTake a challenge

The pyramid in the middle of the function

Four levels of nesting, and the one line that does the work is the hardest to find. Invert every condition, return early, and keep all four error responses exactly as they are.

Beginner15 min on the clock5 graded checks · 100 pointsCode Someone Else Can Change

See alsoFive levels deep, and the transfer is at the bottomThe same pyramid in C#, where you also have to decide which failures are defects and which are outcomes.

Graded by running your code against real cases.

What you build

  • Every failure condition returns immediately
  • No else branch anywhere in the function
  • The four error messages are unchanged, word for word
  • submitRegistration is the last statement, at the top level
  • The payload is still trimmed, lower-cased and timestamped

Done means

The same four errors and the same payload, with the successful path readable in one pass.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. All four rejections behave exactly as before+25Error handling
  2. The successful path still builds the same payload+15Reshaping API data
  3. No else branch survives+25Error handling
  4. Every failure is checked before any work is done+20Error handling
  5. The conditions are inverted, not reordered+15Error handling

What it teaches

The rest of Code Someone Else Can Change