Home > Geeky stuff, misc, Reviews > Google Linux System Administrators phone interview questions

Google Linux System Administrators phone interview questions

So I was contacted by a Google recruiter a while back after applying for a position as a Linux System Administrators. A phone interview was set up and completed and I was subsequently rejected outright. I get flack for the hard interview questions I like to ask when I am on a hiring comity, I don’t even touch Google.
The first question was somewhat of a trick question how would you remove a file in unix that is named -f. It will be interpreted as a command line switch. I for the life of me could not wrap my mind around it at the time. The answer is of course retardly simple use the full path or relative path of the file so rm ./-f would do it since the first character is not a – it would not be interpreted as a command line switch. Then I was asked if I was designing rm how would I handle the case of deleting files named -f without having to use the full path of the file. This I got in a flash which is create a switch that will interpret anything after it as a file and not a switch. I was then informed that rm already has this built in and is the — switch so rm — -f would be the easy way.

I was then asked what would happen if I typed in mv * then hit enter at a shell. I got this with a little leading, at first I thought it would just give you an error, which it will some of the time. After thinking for a minute I got the right answer that the last argument to the mv command has to be a directory. So the bash interperter will expand the * to all the files in the directory that you are in, if the last file in the directory is a directory itself it will move all the files into that directory. If the last file in the directory is a file you get the error returned that the last argument has to be a directory and nothing is done. I think the interviewer was also going to dive into the case of a directory having thousands of files in it then what would happen if you did a mv * or a rm *, but I already mentioned it in my answer to them. Which is you would get back an error that there were too many files to expand since bash has a fixed buffer for this to prevent eating all the systems memory. The work around is using find and xargs like find . -type f -print0 | xargs -0 rm, I happened to already know this as I had run into it a few times.

We then went into the different raid types. I was asked to describe the different raid types. I named the ones I know well which are raid 0 raid 1 raid 5 and I also mentioned raid 0+1 which I have never touched. I then was drilled on all the raid level 0, 1 , 4, 5, 6, 0+!, and 1+0. The interviewer explained the ones which I wasn’t familiar with and then asked how many drives you can loose without loosing data in each raid level. Raid 0 you can loose no drives its it simple striping, I was also asked why you would ever use this. My answer was in cases where the data on the drive is not important but the increase in speed is, my example was a slave database that is only used for reads on high transaction server, the data is already on the master so you don’t care if all the data is lost and you want the increase in speed. Raid 1 you can loose 1 drive in a 2 drive setup, the interview threw me a little on this one asking how many disks you could loose with 3 drives in raid 1, I said that you had to have an even number of drives to run raid 1, he said this was incorrect. So I had to ask if he was talking about all 3 drives mirroring the same data, which he said was the case. So you could loose 2 drives in this case. Raid 4 is striping with a separate parity disk so in the event that you loose the parity drive there is no read hit while the array is degraded you can only loose 1 drive. Raid 5 stripes data and parity across all drives and can loose 1 drive but reads will be degraded. Raid 6 has 2 parity drives which have different parity algorithms which will enable you to loose 2 drives with out any data loss. Then on to raid 1+0 and raid 0+1 which I have never dealt with. The main advantge of these is the write speed, since there is no parity information, the disadvantage is the number of drives you will use 2n + 2, raid 4 and 5 is n + 2, raid 6 is n + 3. So you really only see raid 1+0 or 0+1 in very high transaction database servers. The difference is one is a stipe of mirrors and the other is a mirror of stipes. Here is an example stolen off the web:

Raid 0+1

raid01.gif

Raid 1+0
raid10.gif

I was lead through a series of questions and asked which is better, which I struggled with I just could get my mind around the difference at the time. The answer is that raid 1+0 is better in that both can loose 1 drive with no problem. But the probability of a second failure being down the raid is much greater in raid 0+1. The probability in case 0+1 is (n/2)/(n – 1) in 1+0 it is 1/(n – 1).

After raid it was on to DNS, how does your computer resolve ww.google.com. The answer they were looking for is it depends on how /etc/resolve.conf is set. By default it looks as /etc/hosts then it will go to the dns server. Then on to server side dns what is the chain a dns server would go through to resolve http://www.google.com. Which is the dns server has a list of the root domain servers. These in turn will give the address for the .com dns server, the .com dns will give you the address for the google.com dns server. The google .com server will give you the ip address for http://www.google.com. Then I was drilled on the different types of records in dns and what they do such as A CNAME MX POINTER SOA and NS. Then I was asked if there is a problem whit the NS containing the name of the authoritative DNS server for a domain and not the IP. I said yes since you could not do a A lookup for the name server since I don’t have the address only the name of the name server. I was asked how I would get around this if I designed it and I said I would just return the IP in the NS record. This would work but it is not how it is done. When you ask fot the NS record a glue record is sent back which is a NS record and also the address of the name server.

I probably got 80% of the questions right off the bat 15% with a little leading by the interviewer and 5% with a lot of leading. Apparently not good enough though. It defiantly was a good experience and will defiantly help me with future interviews. I think I will work on getting a few certs before I move on to greener pastures. The goal is to either be out of California or have a job that pays well enough to afford tuition at a good private school before my son is of school age. I have 3 more years before I have to have this done, so realistically I have 18 months so that this will absolutely be done. It really is ashame that the cost of living has shot up so much in California and the quality of life has fallen so much.

Advertisements
Categories: Geeky stuff, misc, Reviews
  1. John
    December 5, 2006 at 11:26 am

    Hi Jeff,
    I’m 24 years old and just graduated univeristy and also have an interview with google next week for a System Administrator job. I was wondering, did you apply for a higher end position? Cause in the junior system administrator job the only requirments are:
    ” 2+ years experience with Linux.
    Working knowledge of TCP/IP networking.
    Working knowledge of security, webservers, NIS/NFS, MTAs.
    Programming/scripting (bash, perl, python). ”

    it doesn’t mention anything about raids. I have no idea how raids work so do i need to read that before my interview? Also did they ask any specific programming questions regarding Perl, Shell Script and Python? also other than DNS any other networking questions? I would greatly appreciate your response to my email (persian_baller@hotmail.com)

    Thanks

  2. Jahangir
    July 13, 2007 at 5:29 am

    Hey Jeff, thanks for sharing your interview.
    Im suprised that 80% accuracy rate still isint good enough to get into google. Does google hire only people with 99% accuracy ?? Honestly i would not even get 60% accuracy if i was giving the same interview right now 😉
    That just shows there’s soo much to learn in the Unix world.

    Keep such posts on tricky sys admin questions coming 🙂

    Thanks.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: