System Resource & I/O Optimization Questions

Tuning how a system uses CPU, memory, disk, and network at the OS and I/O layer. Covers I/O throughput and blocking, buffering and batching, filesystem and kernel-level performance settings, and resource contention between processes. Includes OS-level performance tuning and diagnosing resource saturation on the host.

MediumTechnical
35 practiced

Compare O_DIRECT (direct I/O) and fsync-related durability semantics. How do they interact with filesystem buffering and device write caches (battery-backed or volatile), and what are the performance and correctness trade-offs for database systems?

MediumTechnical
28 practiced

Explain and demonstrate with pseudocode how to use sendfile or a zero-copy transfer to serve static files on Linux over TCP to reduce CPU copies. Discuss limitations such as file descriptors, inability to use sendfile with TLS in some stacks, and when splice or kTLS are alternatives.

HardTechnical
32 practiced

Explain why swapping (paging to disk) is particularly harmful for latency-sensitive services and list techniques to avoid swap-induced latency: strict memory limits, overcommit tuning, mlock, cgroups settings, memory reservation, admission control, and application-level fallbacks.

MediumTechnical
37 practiced

Implement a Python function that computes CPU utilization percentages from two snapshots of /proc/stat taken one second apart. Input: two strings each containing CPU lines like 'cpu 3357 0 4313 1362393 234 0 0 0 0 0'. Output: JSON-like dict with percent utilization for total and each core for user, system, idle, iowait. Focus on correct delta calculation and handling counters wrapping.

MediumTechnical
30 practiced

Write a Python function that parses /proc/meminfo and returns a JSON object with fields MemTotal, MemFree, Buffers, Cached, SwapTotal, SwapFree, calculated used memory (MemTotal - MemFree - Buffers - Cached) and percent used. Make sure your parser handles missing fields and arbitrary line ordering.

Unlock Full Question Bank

Get access to all 14 System Resource & I/O Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.