Linux admin interview questions

  1. How do you take a single line of input from the user in a shell script?
  2. Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
  3. Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
  4. Write a script to list all the differences between two directories.
  5. Write a program in any language you choose, to reverse a file.
  6. What are the fields of the password file?
  7. What does a plus at the beginning of a line in the password file signify?
  8. Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
  9. What is an MX record?
  10. What is the prom command on a Sun that shows the SCSI devices?
  11. What is the factory default SCSI target for /dev/sd0?
  12. Where is that value controlled?
  13. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
  14. What’s wrong with sendmail? What would you fix?
  15. What command do you run to check file system consistency?
  16. What’s wrong with running shutdown on a network?
  17. What can be wrong with setuid scripts?
  18. What value does spawn return?
  19. Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?
  20. Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?
  21. What is the difference between UDP and TCP?
  22. What is DNS?
  23. What does nslookup do?
  24. How do you create a swapfile?
  25. How would you check the route table on a workstation/server?
  26. How do you find which ypmaster you are bound to?
  27. How do you fix a problem where a printer will cutoff anything over 1MB?
  28. What is the largest file system size in solaris? SunOS?
  29. What are the different RAID levels?
This entry was posted in Unix/Linux. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

18 Comments on Linux admin interview questions

  1. Posted 10/18/2005 at 7:45 pm | Permalink

    I had an interview with Google yesterday for the DATA CENTER TECHNICIAN position. They asked me question 21 and 29….

  2. Jojo
    Posted 10/20/2005 at 12:08 am | Permalink

    Main levels of RAID

    RAID 0 - Striping
    RAID 1 - Mirroring
    RAID 4 - Striping without distributed parity
    RAID 5 - Striping with distributed parity.

  3. Boon
    Posted 3/30/2006 at 5:23 am | Permalink

    nslookup
    query Internet name servers interactively

    Nslookup has two modes:
    interactive mode allows the user to query
    name servers for information about various hosts and
    domains or to print a list of hosts in a domain.
    Non-interactive mode is used to print just the name and
    requested information for a host or domain.

  4. spacecow
    Posted 6/19/2006 at 6:58 pm | Permalink

    I had two phone interviews at google, applying for Data Center Technician.

    i was asked 21.)
    plus:

    how to figure out gateway under linux?
    maximum segment length of gigabit ethernet?
    what port is dns using? ssh? http?
    is dns TCP or UDP?
    difference between Router and Switch? Between Hub and Switch?

  5. mickel
    Posted 10/25/2006 at 9:32 am | Permalink

    1) In sh use the read command:
    read var
    echo $var
    2) Assuming the filenames are in filenames.txt:
    sed -ie ’s/\\/\//g’ filenames.txt
    3) s/f.*a[0-9]\+n/UNIX/
    5) Assuming you can’t use tac:
    while read line; do
    i=$(( i + 1))
    lines[i]=$line
    done

    numlines=${#numlines}
    for i in `seq $numlines -1 1`; do
    echo ${lines[i]}
    done

    13) If it has no parent process (ie the parent has already gone away), then it will be adopted by init which will perform a wait to obtain the processes return value. If the parent just doesn’t care, then the process becomes a zombie, which is only bad in that it takes space in your process table.

    15) fsck

  6. raju
    Posted 10/28/2006 at 5:18 am | Permalink

    To create a swap file

    >> mkswap /dev/hdax
    add entry in the /etc/fstab (should look like similar)

    /dev/hdax swap swap defaults 0 0

    >> swapon -a (activates the swap partition)
    >> swapon -s (checks the swap partition)

  7. raju
    Posted 10/28/2006 at 5:23 am | Permalink

    DNS (Domian name server )

    DNS resolves hostname to IP address (forward lookup),
    resolves IP address to hostname (reverse lookup), it allows machines to logically grouped by name domain, provides email routing.

    DNS port: 53
    dameon: named

  8. ravindra patil
    Posted 11/1/2006 at 4:21 am | Permalink

    how to configure linux as router.

  9. nav
    Posted 11/17/2006 at 7:38 pm | Permalink

    SGID, SUID and sticky bit

  10. thirumurugan
    Posted 1/12/2007 at 8:07 am | Permalink

    quiestions asked in novatium :

    1) purpose of nsswitch.conf
    2) purpose of /etc/resolv.conf
    3) port number for dns , http

  11. hari
    Posted 2/24/2007 at 1:40 am | Permalink

    The Password file contains
    usename:encripted passwd:uid:gid:comment:homedirectory:shell
    ex :shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

  12. sanjay kumar
    Posted 2/28/2007 at 2:06 am | Permalink

    purpose of nsswitch.conf
    2) purpose of /etc/resolv.conf
    3) port number for dns , http

  13. Thirumurugan
    Posted 2/28/2007 at 6:53 am | Permalink

    I had two phone interviews at google

    Using Ping utility which protocol working ?

    What is th Port number of SMTP,LDAP?

    Two Types of DNS Queries?

    Netbios Catche?

  14. jason
    Posted 6/25/2007 at 11:44 am | Permalink

    I had a phone interview with google for SRE position. These are the questions they asked:

    - Difference between a Router/Hub/Switch? Explain the process when a packet leaves a host and travels to another host, on same network/different networks. What happens if the host doesnt exist, what does the switch/router/hub do? Where do consecutive requests go? (cache)

    - Explain how traceroute works (explain incrementing the TTL field)

    - Explain the exec / fork process. How do you get the return value of a child that died (i.e. structure returned from waitpid() and wait())

    - Explain what the load average is (a: the number of processes averaged over 1, 5 and 15 minutes that are marked as: R, S, D); where does ‘uptime’ get this information from?

  15. gautham
    Posted 10/17/2007 at 8:55 am | Permalink

    Differences between TCP and UDP

    TCP
    1)TCP -Transmission control protocol
    2)TCP is a connection oriented protocol.
    3)Three way handshake happens between client and server.
    4)TCP is a reliable data transfer
    5)slow transmission of data compare to UDP.
    6)TCP is used to send file like database,where reliability play the first role

    UDP
    1)UDP -User Datagram protocol
    2)UDP is connectionless protocol
    3)NO

  16. gautham
    Posted 10/17/2007 at 8:58 am | Permalink

    Differences between TCP and UDP

    TCP
    1)TCP -Transmission control protocol
    2)TCP is a connection oriented protocol.
    3)Three way handshake happens between client and server.
    4)TCP is a reliable data transfer
    5)slow transmission of data compare to UDP.
    6)TCP is used to send file like database,where reliability play the first role

    UDP
    1)UDP -User Datagram protocol
    2)UDP is connectionless protocol
    3)NO 3 way handshake
    4)NOt a reliable data transer
    5)Faster than TCP
    6)used to send data like video,audio

  17. Ryan
    Posted 3/18/2008 at 11:43 am | Permalink

    I also had an initial interview for a data center tech position.  Questions included what is the max length for a Cat5 cable, how many bits in an 1pv4 address, how to find CPU speed under Linux.

  18. Buddha
    Posted 2/6/2009 at 3:34 pm | Permalink

    Had an interview with one of the big boys yesterday for sys admin gig. I don’t know about you but I feel like a lot of these questions mean absolutely nothing in the real world and it bugs me that HR asks them. You better know what ports things and how to pipe something to grep or a log file, but some of this other crap you can go 10 years as a hardcore admin and never use.

    Quick: name the last time you used a sticky bit, manually changed run levels or needed to know the OSI layers for anything other than a pop quiz?

    Also, I’m starting to think that when HR comes to one of their techs and says “hey we need some pre-screening questions?” they just google this site from stupid crap to ask. :)

    Anyway, after bombing the interview I decided that I better bone up on any academic stuff.

    They asked the difference between UDP/TCP question and some others not here yet:

    q: Is DNS tcp or UDP?
    a: UDP by default, but can use both.

    q: How do you know what run level you are in?
    a: Type: runlevel

    q: How do you switch run levels?
    a: telinit RUNLEVEL
    i.e.: telinit 1

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*