Basic Interview Questions on Linux for Beginners

Basic Interview Questions on Linux for Beginners

Here we created a list of Interview Questions on Linux. It will help to crack any interview on Linux…

Basic Interview Questions on Linux

1. What hardware architecture is not supported by Red Hat?

a) Machintosh
b) SPARC
c) Alpha
d) IBM-compatible
Ans a) Machintosh     

 

2. What does FSF stand for?

a) First Serve First

b) Free Software Foundation

c) Free Software File

d) Friends Supporting Friends

Ans b) Free Software Foundation       

 

3. What is X-based tool is available for configuring the X Window System?
a) xf86config
b) XF86Setup
c) XConfigurator

d) All of the above

Ans b) XF86Setup     

 

4. Layer one of the OSI model is?

a) Network Layer

b) Link Layer

c) Physical Layer

d) Transport Layer

Ans c) Physical Layer     

 

5. What Layer of OSI determines the interface of the system with the user?

a) Application

b) Network

c) Session

d) None

Ans a) Application     

 

6. How can you navigate around virtual consoles?

a) Ctrl + Function Key

b) Ctrl + Alt + Del

c) Alt + Function Key

d) None

Ans c) Alt + Function Key     

 

7. Which command is used to display the Unix version?

a) uname -r

b) kernel

c) uname -t

d) uname

Ans uname -r     

 

8. Single Unix specification version 2 enhanced support for?a) 16 bit Unix

b) 8 bit Unix

c) 64 bit Unix

d) 32 bit Unix

Ans c) 64 bit Unix     

 

9. Application communicates with Kernel by using?

a) C Program

b) System Calls

c) Shell

d) shell

Ans b) System Calls     

 

10. Solaris is a product of?

a) IBP

b) Microsoft

c) Sun Microsystems

d) None

Ans c) Sun Microsystems     

 


MCQ File Types Interview Questions on Linux

1. When you use the in command, which of the following occurs?

a) A file is created that points to an existing file.

b) A file is created that is a copy of an existing file.

c) A file is moved from one location to another.

d) A file is renamed

Ans a) A file is created that points an existing file     

 

2. srwxr-xrw- is a

a) internet socket file

b) Unix domain socket file

c) Symbolic link

d) Shared file

Ans b) unix doain socket file     

 

3. Binary or executable files are:

a) Regular files

b) Device files

c) Special files

d) Directory files

Ans a) Regular files     

 

4. The directory files contains:a) File names & Files Sizes

b) File names & Inode Numbers

c) File name & address

d) Files names & Permission

Ans a) File names & Inode Numbers       

 

5. Which directory contains device special files?

a) /etc

b) /etc/dev

c) /rooy/bin

d) /dev

Ans d) /dev     

 

6. Which of the following is not the correct statement regarding file types on Linux?

a) Socket

b) Softlink

c) Inode

d) FIFO

Ans c) Inode   

 

7. Which of the following is not the correct statement regarding file types?

a) hard links share same inode number

b) Soft links cannot be created across partitions

c) Socket files are Unix domain sockets

d) Character file is a special file

Ans b) Soft links cannot be created across partitions     

 

8. Which are the two types of device files?

a) Character & Block

b) Character & Socket

c) Block & FIFO

d) Input & output

Ans a) Character & Block     

 

9. Which is an example of a character special file?

a) Hard Disk

b) CD-ROM

c) Terminal

d) Memory

Ans c) Terminal     

 

10. Which is an example of a block special file?

a) Virtual Terminal

b) CD-ROM

c) Terminal

d) Serial Modem

Ans b) CD-ROM     

 


MCQ Memory Management Interview Questions on Linux

1. on x86-32 Linux, at which address does the code segment of the program starts?

a) 0*00000000

b) 0*08048000

c) 0*80000000

d) 0*bfff00000

Ans b) 0*08048000     

 

2. on x86-32 Linux, at which address the user stack resides normally?

a) 0*00000000

b) 0*3fff0000

c) 0*7fff0000

d) 0*bfff0000

Ans d) 0*bfff0000     

 

3. A system has 512MB of physical memory. Which among the following is not a suitable virtual memory size for this system architecture?

a) 512MB

b) 256M

c) 4GB

d) None of the mentioned

Ans d) None of the mentioned     

 

4. LRU stands for

a) Last received Unit

b) Least Recently Used

c) Least recently usable

d) Lost Recovered Unit

Ans b) Least Recently Used     

 

5. Mm_struct maintains?

a) memory files

b) open files

c) pipe()

d) active memory regions

Ans d) active memory regions     

 

6. Which system call can be used by a user process to lock a memory so that it cannot be swapped out?

a) memory files()

b) memlock()

c) pipe()

d) active memory regions

Ans b) memlock()     

 

7. Is the page table per process entity?

a) Yes

b) No

Ans a) Yes     

 

8. Among these files which has an ELF format

a) Shared objects

b) Core

c) executable

d) All of the mentioned

Ans  d) All of the mentioned     

 

9. What is the use of strace command?

a) strace can be used to check the system calls called by the program. So, this can be used for debugging and benchmarking purposes.

b) strace cannot be used to check the system calls called by the program

c) all of the mentioned

d) None of the mentioned

Ans a) strace can be used to check the system calls called by the program. So, this can be used for debugging and benchmarking process.       

 

10. Which one can be a real-time schedule policy?

a) SCHED_FIFO

b) SCHED_SPF

c) SCHED_OTHER

d) SCHED_FILO

Ans a) SCHED_FIFO       

 


MCQ Signal Handling Interview Questions on Linux

1. If a signal is received by a process, when will it be processed?

a) It is processed immediately

b) It is processed when the process is switching to kernel mode

c) It is processed in the next timeslice given to the process

d) None of the mentioned

Ans b) It is processed when the process is switching to kernel node       

 

2. Which signal is generated when we press control-C?

a) SIGINT

b) SIGTERM

c) SIGKILL

d) SIGSEGV

Ans a) SIGINT     

 

3. Which signal is generated when we press ctrl-Z?

a) SIGKILL

b) SIGSTOP

c) SIGABRT

d) SIGINT

Ans b) SIGSTOP     

 

4. Which signal is sent when the child process terminates?

a) SIGINT

b) SIGKILL

c) SIGSTOP

d) SIGCHLD

Ans d) SIGCHLD   

 

5. Which of the following signal cannot be handled or ignored?

a) SIGINT

b) SIGCHLD

c) SIGKILL

d) SIGALRM

Ans c) SIGKILL     

 

6. Another signal that cannot be caught is:

a) SIGPIPE

b) SIGHUP

c) SIGSTOP

d) SIGUSR1

Ans c) SIGSTOP     

 

7. When the real interval timer expires which signal is generated?

a) SIGINT

b) SIGCHLD

c) SIGKILL

d) SIGALRM

Ans d) SIGALRM     

 

8. Signals are handled using which system call?

a) kill

b) signal

c) both

d) none

Ans b) signal     

 

9. Default action of SIGSEGV is

a) Terminate

b) core dump + Terminate

c) stop

d) cont

Ans b) core dump + Terminate     

 

10. The kill system call is used to

a) Send shutdown messages to all by superuser

b) Send a signal to a process

c) Kill Processes

d) Stop the processes

Ans b) Send a signal to a processes     

 


MCQ Control Statement Interview Question on Linux

1. The break statement

a) jumps out of the innermost for loop

b) jumps out of the innermost while loop

c) jumps out of the innermost do-while loop

d) all of the mentioned

Ans d) All of the mentioned     

 

2. Which statement skips over the rest of the loop body, causing the next cycle around the loop to begin immediately?

a) continue

b) break

c) next

d) none of the mentioned

Ans continue     

 

3. The next statement

a) Immediately stops processing the current record

b) go to the next record

c) Immediately stops processing the current record & go to the next record

d) None of the mentioned

Ans c) Immediately stops processing the current record & go to the next record     

 

4. If the argument is supplied to the exit statement

a) Its value is used as the exit status code for the awk process

b) syntax error will generate

c) exit returns status 0

d) exit returns status 1

Ans a) Its value is used as the exit status code for the awk process       

 

5. Which statement instructs gawk to stop processing the current data file?

a) next

b) nextfile

c) exit

d) exitfile

Ans b) nextfile       

 

6. What is the output of this program?#!/usr/bin/awk -f

BEGIN {

a=5

while (a<5) {

print “sanfoundry”

a++;

}

}

a) Nothing will print

b) “sanfoundry” will print 5 times

c) Program will generate a syntax error

d) None of the mentioned

Ans a) Nothing will print     

 

7. What  is the output of this program?#!/usr/bin/awk -f

BEGIN {

a=0

do {

print “sanfoundry”

a++

} while (a<5)

}

a) “sanfoundry” will print 4 times

b) “Sanfoundry” will print 5 times

c) Nothing will print

d) syntax error

Ans “sanfoundry” will print 5 times     

 

8. The command “awk ‘{if(“9” &gt; “10”) print “sanfoundry” else print  “linux”}””

a) will print “sanfoundry”

b) will print “linux”

c) will generate syntax error

d) none of the mentioned

Ans  c) will generate syntax error     

Also-Read: Basic 50+ Interview Questions on C++

If you have any doubt related to these MCQ Interview Questions on Linux ask me in the comment section…


Leave a Reply

Your email address will not be published.

%d bloggers like this: