← IBM Interview Insights

IBM·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

IBM DevSecOps interview that leaned pretty hard into Linux internals. One main question but it had a lot of surface area and I felt like I was being tested on breadth more than depth.

Questions Asked (1)

Q1

Given a running process's PID, what Linux commands would you use to inspect it, and what does each one tell you?

System DesignTechnical Trade-offsRoot Cause Analysis
Author's notes

I started with ps and top because those are the obvious ones, then remembered /proc and that's where things got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by grouping commands into categories: process overview, resource usage, system calls, and open files/network. For each command, briefly state what it does and what specific insight it provides about the process's behavior or health. Emphasize a systematic troubleshooting approach, starting with high-level inspection and drilling down as needed.

Pro tip: Mention that you'd first check the process state and resource usage with `ps` and `top` to identify anomalies, then use `strace` and `lsof` for deeper investigation, but always consider the performance impact of these tools in production.

1. Get a high-level overview

Use `ps -p <PID> -o pid,ppid,user,%cpu,%mem,stat,start,time,cmd` to see the process's basic attributes, resource usage, and state. This helps you quickly assess if the process is running, sleeping, zombie, etc., and its resource consumption.

2. Monitor real-time resource usage

Use `top -p <PID>` or `htop -p <PID>` to observe CPU and memory usage in real-time, and identify threads with `top -H -p <PID>`. This reveals if the process is CPU-bound, memory-leaking, or has thread-level issues.

3. Inspect open files and network connections

Use `lsof -p <PID>` to list all open files, sockets, and pipes, which can indicate file descriptor leaks or network activity. For network specifics, `netstat -tulpn | grep <PID>` or `ss -tulpn | grep <PID>` shows listening ports and connections.

4. Trace system calls and signals

Use `strace -p <PID>` to attach and trace system calls, which helps diagnose hangs, errors, or unexpected behavior. For a snapshot, `strace -p <PID> -c` gives a summary of syscall counts and time.

5. Examine memory and stack traces

Use `pmap -x <PID>` to view memory mappings, and `gdb -p <PID>` to attach a debugger for stack traces (if symbols available). For Java processes, `jstack <PID>` provides thread dumps.

Key Points to Mention

  • `ps` and `top` for process state and resource usage
  • `lsof` and `netstat`/`ss` for open files and network connections
  • `strace` for system call tracing and debugging
  • `pmap` and `gdb` for memory and stack analysis
  • Consideration of production impact: tools like `strace` can slow down the process
  • Alternative tools like `pidstat`, `iotop`, and `perf` for I/O and performance profiling

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.