Interview questionsInterview questions
Linux interview questions 49 questions, 49 with model answers. Every member practises all of them free.
Samples
3 of 49 questions. What's your Linux-level checklist before approving any custom AMI to production? Show the answer OS hardening : CIS Benchmark compliance scan (using oscap or AWS Inspector); disable unused services (disable rpcbind, avahi-daemon, etc.).Kernel version : confirm the kernel is patched against known CVEs; check uname -r.SSH hardening : PermitRootLogin no, PasswordAuthentication no, AllowUsers list; check /etc/ssh/sshd_config.Audit logging : auditd installed and configured; /var/log/audit/audit.log persists across reboots.File system integrity : AIDE or Tripwire baseline for critical system files.No default credentials : verify no test users, default passwords, or embedded secrets.Systemd units : only required services enabled on boot (systemctl list-unit-files --state=enabled).SELinux/AppArmor : enforcing mode, not permissive or disabled.Package audit : rpm -qa or dpkg -l — no unnecessary packages; all packages from approved repos.Golden image scan : Trivy or Grype image scan for HIGH/CRITICAL CVEs; Packer + AWS Inspector for AMI-level scanning.Cloud-init idempotency : cloud-init runs cleanly without errors on first and subsequent boots.FIPS mode (if required): verify with fips-mode-setup --check.Bash One-liner: Find all running containers using more than 500MB RSS memory on a node. Show the answer docker stats --no-stream --format "{{.Name}} {{.MemUsage}}" | awk '{split($2,a,"/"); val=a[1]; if(val ~ /GiB/) {gsub(/GiB/,"",val); if(val*1024 > 500) print $1, val"GiB"} else if(val ~ /MiB/) {gsub(/MiB/,"",val); if(val+0 > 500) print $1, val"MiB"}}'Alternative using /proc (RSS in kB for each container's main process):
for cid in $(docker ps -q); do
pid=$(docker inspect -f '{{.State.Pid}}' $cid)
rss=$(awk '/^VmRSS/{print $2}' /proc/$pid/status 2>/dev/null)
name=$(docker inspect -f '{{.Name}}' $cid)
[ "$rss" -gt 512000 ] 2>/dev/null && echo "$name RSS: $((rss/1024))MB"
doneHow do you check running processes in Linux? Show the answer ps aux # all processes, user-readable format
ps -ef # full format with parent PID
ps auxf # tree view
top # interactive, real-time
htop # interactive with color, easier navigation
pgrep -a nginx # find by name, show command line
pidof nginx # PID(s) of a named process
systemctl status nginx # for systemd-managed services46 more in the member app, with practice sets and your own marks. Join free
More topics
Other interview topics.