Wednesday 12 June 2013

Linux_interview_questions_2

link: http://isitup.wordpress.com/tag/linux-administrator-interview-questions/

Bash:
  1. How do you find out if a shell command succeeded or not?
  2. Write a command line to delete files in /tmp across say 400 machines.
  3. What do $?, $!, $@ stand for?
  4. Write a shell script that replaces the shell command which.
  5. What is your favorite shell and why?
  6. What does . mean in regular expressions?
  7. Write a regular expression that does that matches this
  8. What is the output of ls -l ?
  9. What does the stat command do?
  10. What is difference between ” and ‘  ?
  11. How will you change root password on 10K servers and you have no ssh keys? What will you do if it is 100K servers?  [ANS: http://amitmund.blogspot.in/2013/10/ssh-tips.html ]
Databases:
  1. What are  the differences between innodb vs myisam?
  2. How can you tell if replication is functional?
  3. What does sharding mean to you?
  4. What does explain mean to you?
  5. What are the general parameters you tune for MySQL?
  6. What can you do to shutdown a Oracle database that you cannot sqlplus into?
DNS:
  1. What is the difference between A record and CNAME record?
  2. Why PowerDNS over BIND?
Editors:
  1. Emacs vs VI what’s your choice and why?
  2. Wait, what you use nano?
Configuration Management:
  1. What is puppet? Why do you use it?
  2. What do you need to do  rebuild a puppet master on the fly?
  3. What is the keyword for forcing one-operation after another operation in a puppet manifest?
Mail:
  1. Describe a SMTP transaction with commands.
Networking:
  1. What is the difference between TCP vs UDP?
  2. How  do ping and traceroute work? Do get into details about TTL.
  3. Can you tell me the command line for tcpdump to capture traffic on port 22 on interface eth0?
  4. Can you describe how routing works?
  5. Describe a HTTP transaction in all detail you can.
  6. What is a VLAN? Why do you need VLANS?
  7. What are the port numbers for pop,imap,http,https,dns?
  8. What is a spanning tree?
  9. What are MSS and MTU?
  10. Explain when you would use UDP and when you would use TCP.
  11. What is supernetting?
  12. How many bits in an IPV4 address?
  13. What is the difference between Class address and CIDR?
  14. Describe a DNS transaction in great detail.
NFS:
  1. What is the possible reason that a nfs server would appear to be slow when serving large files but quite fast when serving small files?
  2. What is your experience with nfs?
Operations:
  1. Do hostnames need a sequence number in their naming convention? Why/Why not?
  2. How do you deal with multiple issues that come up?
  3. How do you deal with developers?
  4. How do you handle aggregating logs files?
  5. Describe whats your strategy for disaster recovery?
  6. A client says he/she is expected to receive 5million hits, what hardware do you recommend?
  7. What Linux distribution would recommend for a business?
  8. Do you have any issues with running Windows in production?
  9. Describe your ideal job?
  10. Describe what you would like to do?
  11. What are your thoughts on how a release process should be?
  12. What are your thoughts on monitoring?
  13. Design a high level detail for a LAMP stack and DR solution.
Operating Systems/Distributions
  1. What’s your favorite Linux distro and why?
  2. How do you go about recommending what distro to use for a business?
  3. What is an inode?
  4. What is the difference between a soft link and a hard link?
  5. Can you create a directory/filename by the name -f ? If so how?
  6. What is uptime?
  7. What is load average? What do those numbers mean?
  8. What does it mean when someone says there is high load?
  9. When can you have such a high load of 400 and yet have low CPU usage?
  10. What is a semaphore?
  11. What is is a signal?
  12. Can you name few signals?
  13. What does set group id for a directory mean?
  14. What are the different kinds of files?
Security :
  1. How do you secure a linux system?
  2. What is a sql injection attack?
  3. What is the command to manipulate kernel level firewall?
Misc:
  1. Where do you get your news?
  2. What are you favorite set of tools you like to have always?
  3. Tell us a joke.

3 comments:

  1. Hey Amit,

    I am interested to know the answer to this question. Can you shed some light on the approach?

    How will you change root password on 10K servers and you have no ssh keys? What will you do if it is 100K servers?


    --Ram

    ReplyDelete
    Replies
    1. Hi Ram,

      I am creating another blog page with more details of the same answer, but following is the quick solution that I am thinking:

      for servers in `cat ServersName; do echo $servers; sshpass -p ssh root@$servers "sed -i "s/"^root:[$./0-9a-zA-Z]*:"/"root:'\$1\$Ja8Zp6vP\$1tJvqiNxfiePd9wTsDKq51':"/g" /etc/shadow"; done

      the above string is the password is for word "test" [ I have added an escape character before $ and (') at beginning and at the end of the password.

      Test in a virtual env, or will suggest try with a non-root user's password update for the testing.

      So, what is the above command is doing:

      1. putting the server name at servers variable.
      2. Echoing the server name, just for your reference.
      3. Passing the password using "sshpass" command.
      4. Updating the "/etc/shadow" file with the new encrypted string, that you got from "openssl" command.

      NOTE: The string need to compatible. Over here I am using "sed" you can use "perl", "python" other things as per your need.
      Do, let me know your suggestion or feedback.



      Regards,
      Amit Kumar Mund

      Delete
    2. Related blog:

      http://amitmund.blogspot.in/2013/10/ssh-tips.html

      Delete