The File Size Profiler
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
Given entries (list of 'filepath size_bytes timestamp' strings), sum size_bytes per file extension (everything after the last '.' in the filename). Files without an extension (no '.' in basename) are grouped under the key 'no_ext'. Extension matching is case-insensitive, so 'report.CSV' counts toward 'csv'. Return a dict mapping each lowercased extension (or 'no_ext') to the total size in bytes.
Summary
File types and their disk footprint. One type dominates.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.