SpinTheMic
Pro

Interview practice question

Adding logging and metrics to many methods

Backend Engineering · OOP and Design Patterns · Beginner

You need to add timing metrics and logging to every method of your payment client, and copying the code into each method feels wrong. What would you do?

What a strong answer covers

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

  • Cross-cutting concern.
  • Decorator wrapping the client.
  • Or AOP/middleware/interceptors.
  • Keeps business class clean.
  • Reusable across clients.
Practise this topic

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

See all topics