Linux & the shell interview questions
4 questions across 2 sections, in the order you would learn them. Every answer here is one that works — but an answer you have read is not an answer you can give, so use Test yourself and say it out loud first.
The shell and the server
Read the section that teaches thisIf this comes up in an interview
How do you find what is using a port?
lsof -i :PORT, or ss -tlnp on Linux. It gives you the process id, which you can then inspect or kill.
A service is failing on a remote machine. Walk me through what you check.
Whether the process is running, the recent logs filtered for errors, disk and memory, and whether it can reach its dependencies. Then follow a single request id through the log to see where it diverges.
How do you handle secrets on a server?
Environment variables injected by the platform or a secret manager, never committed files. A gitignored .env with restrictive permissions is acceptable locally and not in production.
Working on a remote GPU machine
Read the section that teaches thisIf this comes up in an interview
Your training job died overnight. How do you find out why?
Check the job's log for a traceback, then system signs: whether the disk filled, whether the process was killed for running out of memory (the kernel log shows this), and whether the SSH session ended because it was not in tmux. Check the GPU for errors too.
Then they push further
How do you make the next run survive this?
Run in tmux or a job scheduler, save checkpoints regularly and resume from the latest, check disk space before starting, and log to a file rather than only the terminal.
What gets marked up. Marked up for a systematic list of causes and for checkpointing and resuming rather than just rerunning.
These are the questions for one topic. The whole question bank covers every topic on the site.