InterviewDB
Question
Truncate Logs - Reduce Log File to Size Limit by Dropping Oldest Entries
phone
Question Details
Problem You have a list of log lines, each with a timestamp and a message. The log must be truncated to fit within max_bytes total size. Remove the oldest entries first (by timestamp). Each log line contributes len(line) + 1 bytes (including newline)…
Full Details
🔒
Unlock full leaked content
Full insider details, leaked discussions, and candidate experiences.
Get Premium →Topics
Coding
Onsite
Phone