← Back to Difficulty Selection

Code Review (Easy): Restoring the Hierarchy

Story

While updating the internal team directory, Lena realized that two employee profiles had accidentally been swapped, causing the alphabetical hierarchy to look broken. Eva noticed that the search feature was failing because these two names were in the wrong places, and she asked Mark to help Lena write a fix. They need a small utility that finds the two people who are out of order and swaps them back to their correct positions without touching the rest of the structure. For example, if a name starting with 'Z' is mistakenly placed near the beginning of the list and a name starting with 'A' is near the end, the tool should detect the error and swap them to fix the sequence.

Your Task

Read the story and code, then decide if the code is ready for production or needs improvement.

Hints

What would block an approval? Give me a hint.

Next

Check out Next Topic: Flexible Registry Search

Cookies help us track your progress - nothing extra.