Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

What are system calls and library functions in terms of Unix commands?

Answer»

System calls: System calls are an interface to the kernel itself that further requests the operating system to perform tasks on behalf of user programs. Whenever a system call is invoked within the operating system, the application PROGRAM performs a context SWITCH from user space to kernel space. These are not portable.

Library functions: These are functions that are not PART of the kernel but are used by the DIFFERENT application programs. As compared to the system call it takes less time for execution and is portable and can perform certain tasks only in ‘kernel MODE’.

2.

What is a wildcard and how is it used?

Answer»

A wildcard is a symbol that takes the PLACE of an unknown CHARACTER or SET of characters. The asterisk(*) and question mark(?) are wildcard characters USUALLY used. The wildcards are majorly used in searching files with unknown characters in the filename (or directory).

3.

Explain the alias mechanism.

Answer»

To reduce the TIME of REPEATEDLY typing long commands, an alias is used to assign another NAME to that command. Basically, it is a short form of a larger command.
alias gco='git checkout -b'

Here, we added an alias for the checkout command of git which is FREQUENTLY used by devs making it less painless every time typing a long command.

4.

Explain networking stack and protocol.

Answer»

The default networking stack protocol for the UNIX KERNEL is TCP/IP. TCP/IP works in two PARTS: TCP(Transmission Control Protocol) is responsible for the virtual circuit layer that provides bidirectional DATA transmission, IP(INTERNET  Protocol) is responsible for packet transmission between the user processes and the networking layer. 

5.

Enlist some file manipulation commands in UNIX.

Answer»

These are few FILE manipulation COMMANDS:

  • CAT filename - Displays contents of the file.
  • cp source destination - Copy the source file into the destination.
  • mv old_name new_name - Move/rename.
  • rm filename - Remove/delete filename.
  • touch filename - creating/changing modification time.
  • In [-s] old_name new_name - Creating a soft link on an OLD name.
  • Is –F - Displays information about the file type.
  • ls -LTR - This will display in long format sorted by modified time with oldest first.
6.

Explain Superblock in UNIX.

Answer»

A SuperBlock is a program that contains records of specific file systems such as the block size, the empty and the filled blocks and their RESPECTIVE counts, the size of the block groups, the disk block map, the size and location of the inode TABLES, and usage information. There are basically two types of superblocks:

  • Default superblock: It is a fixed offset from the beginning of the SYSTEM’s disk partition.
  • Redundant superblock: There are multiple copies of superblocks of a default ONE and are referenced when the default superblock is affected by a system CRASH or some errors.
7.

Explain a path in UNIX and different types of pathnames.

Answer»

A Path is the unique location of a file/directory and a way to access it within the hierarchy of directories. There are BASICALLY TWO TYPES of pathnames that are used in Unix.

  • Absolute Pathname: The complete path specifying the location of a file/ directory from the very start of the actual file system(root directory).
    Ex- /usr/local/Cellar/mysql/bin
  • Relative Pathname: The path from the current working directory where the user is i.e. the present working directory (PWD).
    Ex- If current directory is /usr/local/Cellar the the relative path for bin is ./mysql/bin
8.

Can you enlist some commonly used network commands?

Answer»

Some commonly used networking commands in Unix are:

  • TELNET: This is used for REMOTE login and for communication with ANOTHER hostname.
  • ping: This is used for checking network connectivity.
  • hostname: This gives the IP address and DOMAIN name.
  • nslookup: This performs a DNS query.
  • xtraceroute: This is used to determine the number of hops and response time required to reach the network host.
  • netstat: This provides information about system and ports, routing tables, interface statistics, etc.
  • tcpdump: This provides info about both incoming and outgoing network traffic.
9.

In shell scripting, what is the significance of the Shebang line?

Answer»

It gives INFORMATION about the location of where the engine is placed. The engine is the ONE that executes the GIVEN script. It is placed at the TOP of the script.

10.

Explain the file system in UNIX

Answer»

These are a fundamental COMPONENT of the file system:

  • Boot lock
  • Inode lock
  • Data Block
  • Super Block

The UNIX file system has many different file system types such as ufs (UNIX filesystem), NFS(Network file system), vxfs(VERITAS file system), and cdfs(CD-ROM filesystem). Among these, the ufs file system type is the most standard UNIX file system. READS and writes to a ufs file system are done in blocks depending on the SIZE of the file system block size. Block sizes can range from 1 KB to 8 KB depending on the file system type selected.

11.

What do you know about the MBR?

Answer»

It stands for Master BOOT RECORD and is a small program that is executed when the computer is BOOTING up in order to find the OS and load it into MEMORY. During the first stage of the system boot-up process, the BIOS (basic input-output system) searches for the MBR and then loads it into memory, after which the MBR takes over. 

12.

What can you tell about shell variables?

Answer»

The shell has a few sets of predefined internal variables with the support of creating new ones as well. Some of these are environment variables whereas others are local variables. These can be accessed by different PROCESSES. The name of a variable can contain only letters(A-z), numbers(0-9), or the UNDERSCORE CHARACTER ( _).

NAME="SUMIT Roy"$ ECHO $NAME$ unset NAME
13.

Explain the term filter.

Answer»

A program that takes input from the standard input, and displays results to the standard output by PERFORMING some actions on it. The most POPULAR EXAMPLE of a Unix filter is the grep command. This is USED to search for a pattern in FILES(standard input) and print them out in the output screen(standard output).

14.

Explain the process model of Unix?

Answer»

Processes are scheduled using a priority-based preemptive round-robin scheduling algorithm. This ensures that there is no CPU starvation and CPU saturation. Based on the completion of the time slice or WAIT by any I/O, processes can be preempted from the run queue and moved to the sleep queue. While scheduling we MIGHT face DEADLOCK on any RESOURCES hence, user APPLICATIONS need to provide deadlock detection to ensure that user processes do not deadlock on resources.

15.

Can you explain the method of changing file access permission?

Answer»

There are three components of a file permissions

  • Owner permissions − This determines what actions the owner of the file can perform.
  • Group permissions − This determines what actions a group member(of the group that a file belongs to) can perform.
  • Other (WORLD) permissions − This is for everyone else.
$ ls -l /home/sroy8091-rwxr-xr-- 1 sroy8091 users 1024 MAR 23 00:10 myfiledrwxr-xr--- 1 sroy8091 users 1024 Mar 23 00:10 mydir

r, w, and X represent read, WRITE and execute respectively.

To change the file permission we need to run chmod command.

$ ls -l testfile-rwxrwxr-- 1 sroy8091 users 1024 Mar 23 00:10 testfile$ chmod o+wx testfile$ ls -l testfile-rwxrwxrwx 1 sroy8091 users 1024 Mar 23 00:10 testfile

Here we updated the permission for other users, from only read to read, write and execute.

16.

Differentiate between swapping and paging?

Answer»

Swapping: In the case of swapping the main memory is loaded with the complete process and thus only the process less than the main memory size is executable. This is FAIRLY EASY to implement but not very efficient.

Paging: On the other hand in the case of paging instead of loading the whole process into the main memory only required memory PAGES are loaded. This is complex to implement but allows us to run a NUMBER of PROCESSES simultaneously.

Previous Next