System Administrator Interview Questions

In today’s dynamic IT world many people might find themselves in a position where they are now looking to get a new or better job than they had up to that point in time. Getting your foot into the door is hard enough, and for that you need a well-written CV, not to mention the ability to make a good first impression on the potential phone conversation you might get. However, getting the foot in the door is just the first step of actually getting the job. In most cases you should now expect to be interviewed by an experienced IT Professional, perhaps even the same one that you’re going to replace, or the one you’re going to work under.

1. What are the different ways to check the load average on a system?
Answer: vmstat, top, uptime, w, procinfo
vmstat: Report virtual Memory Statistics
top: Provides a dynamic real-time view of a running system (processes)
uptime: Tell how long the system has been running and current time, number of user logged on, system load average for the past (1, 5, 15 minutes)
w: Show who is logged on and what they are doing

Bonus – Describe the values that uptime shows
1-minute, 5-minute and 15-minute load averages

2. What are the different running states of a Solaris System?
1, 2 and 3

3. How do you check CPU and Memory resources on a Server?
Memory: free -m
CPU: cat /proc/cpuinfo (Linux RedHat)
more /proc/cpuinfo (Linux RedHat)

4. What does an init 5 do?
Shutdown the system, it will sync the file system first.

5. How do you reset the root password on a server? No one has the password or has forgotten it. SUDO is not configured on the server as well.
a. Insert Solaris/Linux CD in the cd drive and from ok prompt run command: boot cdrom -s
b. This will take you as single user mode
#fsck /dev/rdsk/c0ttod0s0.
Answer y to clear all.
c. mount /dev/dsk/c0t0d0s0 /a
d. cd /a/etc
e. TERM=Sun
f. export TERM
g. vi /a/etc/shadow
Remove passowrd (between the first thwo colons i.e..,
root:WY1PW5T2EyiU6:13750::::::) from password field of root and save file with :wq!
h. cd /
i. unmount /a
j. init 6
You will be prompted for the new root password.

6. How do you check the disk usage. How do you trouble shoot a high disk usage issue. For example: 2% of disk available and could crash the application.
a. First, check which partition is full.
du -hk
b. Find out which files/folder are taking up the most space
du -h | sort -n
du -k /local01 | sort -rn | head -55
find /local01 -size +600000 -type f -ls | sort -k 7,7 -n
c. Delete files that are not needed anymore. To delete files older than x number of days in the current working directory and below, the safe way is:
For log files older than 5 days:
find -name *.log -mtime +5 -exec ls -tl {} ;
find -name *.log -mtime +5 -exec rm -f {} ;

Find and remove files that are older than 30 and 60 days. In addition, create a log file.
find . -type f -name “bai-.*” -mtime +1 >todelete.log (Find the files and create a log)

Find, delete and create a log file:
find . -type f name “p.*” -atime +60 -exec rm {} ; -print > /tmp/deleted.log
find . -type f -name “p.*” -mtime +30 -exec rm {} ; -print > /tmp/deleted1.log

###Just to find big files
du -k /local01 |sort -rn | head -55
find /local01 -size +600000 -type f -ls | sort -k 7,7 -n

7. How do you check the ports in use on a Linux server?
netstat -an

8. What is NDD?
Make the changes to the running system.
# ndd -set /dev/hme adv_100hdx_cap 0
# ndd -set /dev/hme adv_100fdx_cap 1
# ndd -set /dev/hme adv_autoneg_cap 0
# ndd -get /dev/hme link_mode
0 — half-duplex
1 — full-duplex
# ndd -get /dev/hme link_speed
0 — 10 Mbit
1 — 100 Mbit
1000 — 1 Gbit

9. What is the garbage collection in Java?
When an object is no longer referenced by the program, the heap space it occupies must be recycled so that the space is available for subsequent new objects. The garbage collector must somehow determine which objects are no longer referenced by the program and make available the heap space occupied by such unreferenced objects. In the process of freeing unreferenced objects, the garbage collector must run any finalizes of objects being freed.

Solaris Networking Commands:

1. Route Configuration
Add a route o the routing table
route add net

2. Changes the destination address for a route
route change net

3. Delete a route form the route table
route delete net

4. Flush the routing table, which will remove all entries
route flush

5. Which interface will be used to contact hostname
route get [hostname]

6. Monitor routing table lookup misses and changes
route monitor

7. Ethernet address ARP table
arp -a

8. Delete an ethernet address arp table entry
arp -d myhost

9. Display open files for internet address
lsof -iTPC@10.20

10. Get all IP address on a DNS Server
name-xfer -z -f /tmp/allip

11. Print ARP table in cache with IP and MAC address
ndd /dev/arp arp_cache_report

12. Display number of active established connections to the localhost
netstat -a | grep EST | wc -l

13. Show the state of all the sockets on a machine
netstat -a | more

14. Show the state of the interfaces used for TCP/IP traffic
netstat -i

15. Similar to arp -a without name resolution
netstat -np

16. Show the state of the network routing table for TCP/IP traffic
netstat -r

17. Display routng information but bypasses hostnmae lookup
netstat -rn

18. Snoop for network packets and get size and tipe stamp entries
snoop -S -ta [machine]

19. Follow the route to the ipaddress