SpinTheMic
Pro

Interview practice question

Magic numbers and unclear names

Backend Engineering · OOP and Design Patterns · Beginner

In a code review, you see code like if (s == 3 && t > 86400) and variables named d, tmp2 and data. What feedback would you give?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Use named constants (STATUS_SHIPPED, ONE_DAY_SECONDS).
  • Descriptive variable names.
  • Enums for statuses.
  • Small, well-named functions.
  • Code should explain intent.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics