Walk me through this code and tell me what’s wrong with it. How would you fix it?
Sigiloso
I first explained what the code was trying to do, then pointed out the main correctness issues, edge cases, and maintainability problems. After that I proposed a cleaner fix, explained why I prioritized those changes, and described what tests I would add.