Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
User Journal

Journal nocomment's Journal: Wow, Google is mentally draining 5

I had a phone interview today with Google. They sure ask a lot of strange questions. They sure know how to make a competent guy feel dumb though.

I'm not sure if the questions are bogus or not, or if they really expect their linux admins to know.

They were aking things like
-what system calls does ls make
-how does the kernel know to fork ls
-how does ls get it's pid
-how does test return true or false
-does ls return true or false
-would there be any limitation to using a million chained network switches

And various other really bizarre questions.

All this but then they seemed surprised that you can use php for shell scripts.

I think they were just trying to shake me up, and it worked. Anyone else aware of what system calls ls makes?

This discussion has been archived. No new comments can be posted.

Wow, Google is mentally draining

Comments Filter:
  • Comment removed based on user account deletion
    • Re: (Score:3, Informative)

      by Cyberdyne ( 104305 ) *

      ls: typically, open() then getdents() to get the list of filenames (unless they're passed on the command line: remember, in Unix the shell does wildcard expansion for you), sometimes lstat() to get the permissions, size, ownership and nature of each file (if you're using -l, --color or anything similar) - and, of course, write() (or possibly writev()) to feed the resulting text to stdout. Probably also sbrk() at some point to get a bit of memory to work with, or possible mmap() instead.

      How does the kernel

      • Comment removed based on user account deletion
        • The shell actually never forks ls nor clones. you can see this via stracing bash and running ls. it actually runs via execve, which executes in place. And my testing seems to indicate that it indeed never forks nor clones.

          Nope - if your shell did that, it wouldn't come back! Remember, a successful execve() call never returns: it replaces the calling process with the target. I suspect you straced 'bash -c ls', which tells bash to execute ls then exit; in that case, since bash doesn't need to stick around,

If Machiavelli were a hacker, he'd have worked for the CSSG. -- Phil Lapsley

Working...