Logging is slowing down a hot path: fix it

MediumSystem design15 minSWEREPro outline

The question

Profiling shows a noticeable share of time spent in logging inside a latency-sensitive service. How would you cut the cost without losing the logs you need?

What the interviewer is looking for

  • Measures where the cost is: formatting, locking or I/O
  • Skips work for disabled levels before formatting
  • Uses async buffered writing
  • Considers sampling and rate limiting
  • Keeps crash logs reliable

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported MiniMax question type: reduce the overhead of logging.

Reported in: api-cdn.nowcoder.com

Practice question written by BlogLLM based on publicly reported interview formats. Not an official MiniMax question.