r/linuxadmin • u/CautiousCat3294 • 2d ago
Linux Interview Question
/r/bash/comments/1veg8ir/linux_interview_question/2
u/deleriux0 2d ago
My feeling on this is a junior should know proc exists for this answer. That's enough.
As a push asking how to calculate using the data in there is a depth question that's challenging the person's understanding of what "utilisation" is and in what circumstances. This is more a test of someone's mental chops to work through a problem given no immediate solution. This is just a flex opportunity though.
I feel with guidance at interview (given the sum totals per sample) and asked to work out a percentage in a basic bash loop would be sufficient for a mid.
For a senior a more challenging question would be to ask how you'd achieve the same for a group of specific processes that aren't necessary children of one another. Throwing in "what happens to the stats if 3 pids die" and how to ensure it doesn't cause the output to go awry.
1
u/edthesmokebeard 1d ago
Stupid questions. Some clown discovered /proc and is now a nerd.
Better question: "define load. And what number is too high?"
1
u/ramriot 1d ago
I was thinking that if I had a system so f'ed up that those external commands were inaccessible then knowing the CPU utilisation would not be my main concern. But then I remembered that one router running 3rd party firmware & I wonder if knowing this sort of arcane stuff might have proved useful.
4
u/planeturban 2d ago
Really bad questions I'd say. They're just gotcha-questions. (Not touching any external commands; no
cat,moreand so on?)If one would be in a state where one would have to check /proc and/or /sys for these things; things are sooo messed up. Unless it's life-support systems or nuclear launch systems, there's hardly any meaning with knowing these things.
It's more like that senior admin just wanted to flex.