InterviewStack.io LogoInterviewStack.io

Linux Services and Process Management Questions

Covers managing system services and processes on Linux systems. Includes knowledge of service managers such as systemd and legacy System V init, writing and modifying unit or init files, and service lifecycle commands for starting stopping enabling disabling restarting and reloading services. Also covers process monitoring and troubleshooting tools such as ps top htop pgrep and pkill, understanding process states including running sleeping stopped and defunct, identifying and handling zombie processes, managing background jobs, and using signals such as SIGTERM and SIGKILL for graceful and forced termination. Assessment may include diagnosing runaway processes memory or CPU issues service dependency ordering and techniques for ensuring reliable service operation and controlled restarts.

MediumSystem Design
57 practiced
How do you use systemd's OnFailure= property and the systemd unit dependency model to automatically trigger remediation actions (for example, a watchdog service or alert script) when a target service fails repeatedly? Discuss idempotence and avoid loops.
MediumTechnical
47 practiced
A service is leaking file descriptors over weeks and eventually rejects new connections. Describe diagnostic commands (lsof, /proc/<pid>/fd, ls -l /proc/<pid>/fd | wc -l) and a remediation plan including ulimit limits, setting LimitNOFILE in systemd, and application-level fixes. Include how to monitor fd usage over time.
HardTechnical
45 practiced
Implement (in Python 3) a small CLI tool outline that lists systemd units in failed state and attempts to restart them. Requirements: use subprocess to call systemctl (no D-Bus), log actions, rate-limit restarts to 1 per unit per 10 minutes, and be idempotent. Provide a clear algorithm and a short, runnable code snippet for the core loop.
HardSystem Design
87 practiced
Design a fleet-wide controlled restart mechanism to avoid a thundering herd when rolling out a restart across thousands of VMs. Consider coordination (leader election, staggering), health checks, rollback, and integration with orchestration tools (Ansible, Salt, or fleet manager). Provide a concrete rollout plan sketch.
EasyTechnical
52 practiced
Compare SIGTERM and SIGKILL. When should an SRE send SIGTERM, when is SIGKILL acceptable, and what are the implications of repeatedly sending SIGKILL to production services? Include considerations for graceful shutdown and data integrity.

Unlock Full Question Bank

Get access to hundreds of Linux Services and Process Management interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.