Interview practice question
A 3,000-line service class
Backend Engineering · OOP and Design Patterns · Beginner
Your OrderService class has 3,000 lines and handles validation, pricing, payments, emails and reporting. How would you refactor it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Violates single responsibility.
- Identify responsibilities.
- Extract classes: validator, pricing, payment, notifier.
- Add tests before refactoring.
- Small, incremental steps.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.