Interview frequency: …
Short answer
The rule says, "Leave the campsite cleaner than you found it." With every code change or new task, improve a small nearby part of the code before handing it off.
Explanation
Technical debt accumulates gradually from quick shortcuts under schedule pressure and can eventually harden the entire system if ignored. Instead of requesting weeks of management time for a rewrite (which is usually rejected), apply the Boy Scout Rule through continuous incremental cleanup: rename an unclear variable, extract a small method, remove dead code, or add a missing unit test.
Code example
function addPhone(user: User, phone: string) {
- if (phone != null && phone != "") { user.phone = phone }
+ if (!phone) return // clearer guard, cleaned up while we were here
+ user.phone = phone
}
-// legacyExport: unused for a year — deleted in the same change
-function legacyExport(user: User) { /* ... */ }Common mistakes
- Performing a massive, full-project refactor while handling an urgent, critical bug fix.