I think if you're gonna charge someone 100K or 150K for being a senior admin, its okay if they want to ask you questions pertinent to the skill set required for the position. This is just an opinion and you can disagree if you like. It doesn't really matter to me. I just want to make one point: THE TEST ANSWERS BETTER DAMN WELL BE CORRECT. There is more than one way to do things in *nix, so answering the other way doesn't make you wrong. It may makes you fail a lamely constructed test answer combo, but you weren't technically wrong.
I've been a UNIX sys admin for 11 years. I'm largely self taught like many of us. However, I had to at one point sit down and learn what the modes where both in symbolic notation and octal. I think we can all agree that is a very important concept for admins.
The other day I was interviewing for a position with a very famous company who's name I won't say because I don't want the admin who created the answers to hunt me down and kill me for vehemently discussing my feelings with the HR lady for about 15 minutes about how wrong her answers were.
This was one of those, if you don't get 7 out of 10, we don't send you're resume to the hiring manager. I managed to only complete a 6 in her eyes. Which pissed me off to no end so I asked her which ones I got wrong.
####
1) The first one had something to do with the value of some inode count of a new directory related question. I honestly didn't know the answer. I told her I didn't know the answer. She wanted me to guess; and proceeded to force me to guess when I repeated that I did not know the answer.
So I wildly said somewhere between 4 and 16. The answer was 2. I guess she was trying to make me feel stupid, but I didn't care cause I told her I didn't know the answer and I was completely forthright on that point.
####
DISCLAIMER: This post is not supposed to be a tutorial on modes, symbolic notation, or octal notation. Please don't complain because I was incomplete, or perhaps my answers are vague or even wrong, they are just my thoughts.
2) She went on to ask me two question about file permissions or modes. After she marked me wrong, she tried to convince me that in the case of:
mode 075 that a member of the owning group could not read the file. If you are a member of the group then you get the 7 (g+rwx). I told her, as long as you are in the group that owns that file, you should be able to read the file. I guess I could be wrong, but I don't think so.
Well, ok, since its the first position it means the process will appear to be running as the user who owns the file. Off the top of my head, I'm not sure what user shows up if it was read by a group user, but thats not important for this demonstration. She disagreed that it meant that group member user could NOT read the file. Had the mode been 4475 I might have mistaken, but she gave me 3 digits, not 4. I explained it would look like this
-r--rwxr-x user group filename (roughly)
but she said I was wrong. On that alone I got cut out of the chance of my resume getting passed onto the hiring manager for review.
####
3) Then she tried to convince me that in mode 475 that the 4 stood for setUID.
My general understanding is that a file is setup with the modes in this order: user,group,other/world. User is the owner of the File. Also group is an owner of the file, but you have to be in the group if you want to inherit those permissions.
read is 4 (r), write is 2 (w), execute is 1 (x)
They can be combined in any way you want. You can also use like below:
chmod g+rwx filename
I explained there is an optional 1st position when using modes. One example might be `chmod 0750 filename` if you want to remove things like setUID, setGID, sticky bit, etc, etc. You can hence declare 4475 or any other 4 digit combo that has nasty results if you don't know what you are doing. Here is where I'm cutting off cause there are plenty of other ways to do this.
So she flat out tells me I'm wrong that in this case mode 475 that the 4 means setUID. I'm still stumped by this answer.
####
4) She then asked me what $ and # do in bourne shell. Now I realize that these two characters have a different meaning in other programs like vi, sed, etc. But this was a question about bourne shell (not bash).
I answered that when you used $ in a bourne shell script it was right before a previously declared variable name. I then said that you would put a hash mark # before any comment you wanted to make in this script.
She proceed to state that $ doesn't mean the beginning of calling a variable in bourne shell and # doesn't mean comment, like I told her it meant. She gave me two alternate answers that I had never heard of and we dropped it.
I wanted this job badly, so I tried to offer up this simple explanation. If you had a tiny shell script like this:
!#/bin/sh
# This is a comment
a=100
echo $a
./filename would then return
> 100 ( or at least something like this)
####
So the point of this long story is that I walked away feeling like she misgraded my answers by three. Employers better damn well make sure their answers are right, or provide the screen with alternate answers!
So I would have gotten a 9 out of 10 rather than a 6 out of 10. I never debated the inode question, because it was a pure guess. In the end, I emailed her, which probably was the kiss of death, and told have someone review my answers in light of the following wikipedia pages on modes. It would explain why I answered the way I did.
http://en.wikipedia.org/wiki/Modes_(Unix)
http://en.wikipedia.org/wiki/File_system_permissions#Symbolic_notation
Sorry for being so long winded,