Skip to content

Instantly share code, notes, and snippets.

@abuzarhamza
Created July 15, 2016 13:08
Show Gist options
  • Save abuzarhamza/d7de1324583fc9aeefc1e945570377d2 to your computer and use it in GitHub Desktop.
Save abuzarhamza/d7de1324583fc9aeefc1e945570377d2 to your computer and use it in GitHub Desktop.
Perl *nix developer interview
1. Can you get the process running for specific user
ps –u username
2. What is system call
In computing, a system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. This may include hardware-related services (for example, accessing a hard disk drive), creation and execution of new processes, and communication with integral kernel services such as process scheduling. System calls provide an essential interface between a process and the operating system
3. What is kernel panic
A kernel panic is a computer error from which the operating system (OS) cannot quickly or easily recover. The term applies primarily to Unix-based systems and to Mac OS X. In other systems, the equivalent of a kernel panic is known by slang terms such as blue screen of death, sad Mac or bomb
4. Can u tell me how to check system call are being made by one process
strace(1) - Linux man page
http://www.thegeekstuff.com/2011/11/strace-examples/
strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them. Students, hackers and the overly-curious will find that a great deal can be learned about a system and its system calls by tracing even ordinary programs. And programmers will find that since system calls and signals are events that happen at the user/kernel interface, a close examination of this boundary is very useful for bug isolation, sanity checking and attempting to capture race conditions.
5. What is proc dir in linux
/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information centre for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory. For example, 'lsmod' is the same as 'cat /proc/modules' while 'lspci' is a synonym for 'cat /proc/pci'. By altering files located in this directory you can even read/change kernel parameters (sysctl) while the system is running.
The most distinctive thing about files in this directory is the fact that all of them have a file size of 0, with the exception of kcore, mtrr and self
6. Where is system log locate?
Almost all logfiles are located under /var/log directory and its sub-directories on Linux. You can change to this directory using the cd command. You need be the root user to view or access log files on Linux or Unix like operating systems. You can use the following commands to see the log files:
7. If inbuild command like “cmd” is giving an error how you will check the error?
strace - trace system calls and signals
http://www.thegeekstuff.com/2011/11/strace-examples/
8. What is iptables?
Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains.Each chain is a list of rules which can match a set of packets. Each rule specifies what to do with a packet that matches. This is called a 'target', which may be a jump to a user-defined chain in the same table.
9. What is subnet mask?
A subnet mask is a screen of numbers used for routing traffic within a subnet. Once a packet has arrived at an organization's gateway or connection point with its uniquenetwork number, it can be routed to its destination within the organization's internal gateways using the subnet number.
10. Which command to use for checking the network connection?
Test Network Connection with Ping and PathPing. Ping is a tool that helps to verify IP-level connectivity; PathPing is a tool that detects packet loss over multiple-hop trips. When troubleshooting, the ping command is used to send an ICMP Echo Request to a target host name or IP address.
11. One question was “etc/hosts” for DNS config. They asked me how you will config that.
Simply put, the hosts file is a plain text file that all operating systems use to translate hostnames into IP addresses. Whenever you type in a hostname, such as facebook.com, your system will look into the hosts file to get the IP address that it needs to connect to the appropriate server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment