Pergunta de entrevista da empresa Google

What happens when I type "ps" into a UNIX prompt?

Respostas da entrevista

Sigiloso

25 de abr. de 2015

Those are not the answers that they are looking for. You basically answered what happens when you turn your computer on with: "The picture appears on the monitor". A proper answer involves: shell word splitting, searching PATH, loading dynamic libs, argument parsing, syscalls, /proc. If you don't know what ps is doing, it isn't hard to find out.

10

Sigiloso

4 de jun. de 2022

It's a question to check if you understand behind the scenes of a terminal when a command is issued. I would answer it in that way: when I type a command and press enter, the Shell has a command line parser that checks if the text entered is a available command in the PATH or not, if not found it checks the system libs to see if it can find the definition of it, if nothing is found, it throws error ": command not found". In the successful case, where the command is found it loads the binary from the defined path and a system call is executed accordingly to fetch the process data from the OS.

Sigiloso

10 de nov. de 2014

see list of all processes

Sigiloso

10 de nov. de 2014

see list of all running processes