Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 713 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

101.

GRUB stands for ………

A. grand unified boot loader
B. greater rochester urban bounty
C. greedy reclamation of unused bandwidth
D. none of the above
Answer» B. greater rochester urban bounty
102.

When a process makes a system call ,its mode changes from………

A. user to kernel
B. kernel to user
C. restricted to unrestricted
D. unrestricted to restricted
Answer» B. kernel to user
103.

LILO’s configuration file is

A. /etc/lilo.conf
B. lilo.config
C. etc/lilo.config
D. none
Answer» B. lilo.config
104.

Consider the following program main ( ){ printf ("Aayush won a football match on\n"); system ("date");printf("In Berlin"); } if a.out is the executable code corresponding to the above source code,then the command a.out >out f

A. redirects the output of date to a file out f
B. displays the output of date on the screen
C. prints everything on screen
D. prints the two messages on the screen
Answer» B. displays the output of date on the screen
105.

inode name is also called……

A. file
B. link
C. file
D. file descriptors
Answer» C. file
106.

Below is the codeint main() { int fd1, fd2;struct stat buff1, buff2;fd1 = open(“1.txt”, O_RDWR); fd2 = open(“2.txt”, O_RDWR | O_APPEND);lseek(fd1, 10000, SEEK_SET);write(fd1, “abcdefghij”, 10);write(fd2, “abcdefghij”, 10); fstat(fd1, &buff1);fstat(fd2, &buff2);printf(“ %d %d”, buff1.st_size, buff2.st_size);return 0;}Before running the program, the file 1.txt and 2.txt size is 20 each. What is the output?

A. 30 30
B. 100020 20
C. 100030 30
D. 100010 30
Answer» E.
107.

Code snippet (file1 size is 2024)f1 = fopen (file1, RDWR, RWX)lseek(f1,1024,SEEK_SET) write(f1,buf,10)What is offset now.

A. 1024
B. 1034
C. 2034
D. 2054
Answer» C. 2034
108.

BIOS stands for ……….

A. boss india operating system
B. basic input operating system
C. basic input output system
D. boston input output system
Answer» D. boston input output system
109.

is used to stop a process

A. kill
B. remove
C. clear
D. overt
Answer» B. remove
110.

What is the output of the following program? [ -n $HOME ]echo $?[ -z $HOME ]echo $?

A. 0 1
B. 1 0
C. 0 0
D. 1 1
Answer» B. 1 0
111.

…………responsible for exchanging data between kernel and programs

A. system calls
B. thread
C. process
D. none of these
Answer» B. thread
112.

The system start-up scripts are executed by                    when the system starts up and it is these scripts which are responsible for completing the bootstrap process of the UNIX system.

A. init
B. kernel
C. root
D. none
Answer» B. kernel
113.

LILO can also be used to boot other operating systems as well such as ……..

A. ms-dos
B. windows 98
C. windows nt
D. all of these
Answer» E.
114.

The open and create system calls returns an integer called a ……….

A. file number
B. file discriptor
C. file variable
D. none of these
Answer» C. file variable
115.

The user bhojas logged in and performed the following sequence of command. What will be the output of the last command? $ cd project/module1$ pwd

A. /home/bhojas/project/m odule1
B. /home/project/mod ule1
C. /usr/bhojas/project/module1
D. project/module1
Answer» B. /home/project/mod ule1
116.

The tail command in UNIX……

A. can be used to look at the tail or bottom of the file
B. can be used to display the list of last 10 files in the current directory
C. can be used to display the list of last 15 in the current directory
D. none of the above
Answer» B. can be used to display the list of last 10 files in the current directory
117.

The main difference between application and system software is that ………

A. application software is composed of program instruction but system software is not
B. application software is stored in memory whereas system software is only the cap
C. system software is unnecessary wheras application software must be present on the computer
D. system software manages hardware wheras application software performs user tasks
Answer» E.
118.

The statement z = ‘expr 5 / 2′ would storewhich of the following values in z?

A. 0
B. 1
C. 2
D. 2.5
Answer» D. 2.5
119.

Consider the following command that invokes the executable file a.out, with the following command line arguments a .out God loves youargv( [1][2] )corresponds to the character

A. e
B. o
C. y
D. d
Answer» E.
120.

The seventh field of /etc/password is………….

A. password
B. login
C. shell
D. home
Answer» D. home
121.

What would be the current working directory at the end of the following command sequence? $ pwd/home/user1/proj$ cd src$ cd generic$ cd .$ pwd

A. /home/user1/proj
B. /home/user1/proj/sr c
C. /home/user1
D. /home/user1/proj/src/generic
Answer» E.
122.

rom where would the read statement read if the following statements were executed? exec < file1 exec < file2 exec < file3 read line

A. it would read all the files
B. it would not read any files
C. t would read all the files in reverse order
D. it would read only file3
Answer» C. t would read all the files in reverse order
123.

Executing cat /etc/password > /dev/sda as superuser will

A. write data into a regular file called /dev/sda
B. write data to the physical device sda
C. it
D. none of the above
Answer» C. it
124.

cat < file1 >> file2 | file3

A. file1 content will be appended to file2 and finally stored in file3
B. file1 content will be appended to file2 and file3 will be ignored
C. file2 and file3 will have same content
D. syntax error
Answer» E.
125.

The following commands gives the output like this #cat file1 file2 #cat: file1: No such file or directory hello If we execute the command “cat file1 file2 1>2 2>&1” the output would be

A. cat: file1: no such file or directory hello
B. no output is displayed
C. cat: 1>2: no such file or directory
D. hello
Answer» C. cat: 1>2: no such file or directory
126.

Syntax to suppress the display of command error to monitor?

A. command > &2
B. command 2> &1
C. command 2> &2
D. command 2> /dev/null
Answer» E.
127.

Which of these is the correct method for appending “foo” in /tmp/bar file?

A. echo foo > /tmp/bar
B. echo foo >> /tmp/bar
C. echo foo | /tmp/var
D. /tmp/bar < echo foo
Answer» C. echo foo | /tmp/var
128.

cmd > abc 2>&1 will

A. write file2 to file1
B. write standard output and standard error to abc
C. write standard error to abc
D. write standard output to abc & standard error to monitor
Answer» C. write standard error to abc
129.

cmd 2>&1 > abc will

A. write file2 to file1
B. write standard output and standard error to abc
C. write standard error to abc
D. write standard output to abc & standard error to monitor
Answer» E.
130.

The redirection 2> abc implies

A. write file 2 to file abc
B. write standard output to abc
C. write standard error to abc
D. none of the mentioned
Answer» D. none of the mentioned
131.

Which of the following files will not be displayed by the command cat re* ?

A. reminder
B. receipt
C. receipt
D. recipe-cake
Answer» D. recipe-cake
132.

BASH shell stands for?

A. bourne-again shell
B. basic access shell
C. basic to advanced shell
D. big & advanced shell
Answer» B. basic access shell
133.

The user bhojas logged in and performed the following sequence of command. What will be the output of the last command? $ cd project/module1 $ pwd

A. /home/bhojas/project/m odule1
B. /home/project/mod ule1
C. /usr/bhojas/project /module1
D. project/module1
Answer» B. /home/project/mod ule1
134.

Which of the following represents an absolute path?

A. ../home/file.txt
B. bin/cat
C. cs2204/
D. /usr/bin/cat
Answer» E.
135.

Which is true with regards to the shell prompt

A. it can be accidentally erased with backspace
B. the prompt cannot be modified
C. the prompt can be customized (modified)
D. none of the mentioned
Answer» D. none of the mentioned
136.

If a file with execute permissions set, but with unknown file format is executed

A. the file is passed to /bin/sh
B. the system returns an error
C. the current shell will try to execute it
D. none of the mentioned
Answer» D. none of the mentioned
137.

What is a shell in UNIX?

A. a program through which users can issue commands to unix
B. a window management system
C. the login screen
D. the thing that rides on the back of a turtle in unix
Answer» B. a window management system
138.

Create a new file “new.txt” that is a concatenation of “file1.txt” and “file2.txt”

A. cp file.txt file2.txt new.txt
B. cat file1.txt file2.txt > new.txt
C. mv file[12].txt new.txt
D. ls file1.txt file2.txt | new.txt
Answer» C. mv file[12].txt new.txt
139.

What would be the current working directory at the end of the following command sequence? $ pwd /home/user1/proj $ cd src $ cd generic $ cd . $ pwd

A. /home/user1/proj
B. /home/user1/proj/sr c
C. /home/user1
D. /home/user1/proj /src/generic
Answer» E.
140.

What will be output of following command:$ echo "The process id is" $$$$

A. the process id is $$
B. the process id is $<pid>$<pid>
C. the process id is <pid><pid>
D. the process id is $$$$
Answer» D. the process id is $$$$
141.

which of these is NOT a valid variable in bash

A.      (double underscore)
B. _1var (underscore 1 var )
C. _var_ (underscore var underscore)
D. some-var (some hyphen var)
Answer» E.
142.

What is the output of the following code: s=Unix echo 1.$os 2."$os" 3.'$os' 4.$os

A. 1.unix 2.unix 3.unix 4.unix
B. 1.unix 2.unix 3.$os 4.unix
C. 1.unix 2.unix 3.unix 4.$os
D. 1.unix 2.$os 3.$os 4.$os
Answer» C. 1.unix 2.unix 3.unix 4.$os
143.

What is the return value ($?) of this code:os = Unix [$osName = UnixName] && exit 2 [${os}Name = UnixName] && exit 3

A. 0
B. 1
C. 2
D. 3
Answer» E.
144.

What is the output of the following program? x = 3; y = 5; z = 10; if [( $x -eq 3 ) -a ( $y -eq 5 -o $z -eq 10 )] then echo $x else echo $y fi

A. 1
B. 3
C. 5
D. error
Answer» C. 5
145.

What is the output of the following program? [ -n $HOME ] echo $? [ -z $HOME ] echo $?

A. 0 1
B. 1 0
C. 0 0
D. 1 1
Answer» B. 1 0
146.

What is the output of the following program?b = [ -n $b ] echo $? [ -z $b ] echo $?

A. 1 1
B. 2 2
C. 0 0
D. 0 1
Answer» D. 0 1
147.

The expression expr -9 % 2 evaluates to:

A. 0
B. 1
C. -1
D. 2
Answer» D. 2
148.

The statement z = ‘expr 5 / 2′ would store which of the following values in z?

A. 0
B. 1
C. 2
D. 2.5
Answer» D. 2.5
149.

Which one of the following options is not a shell in UNIX system?

A. bourne shell
B. c shell
C. net shell
D. korn shel
Answer» D. korn shel
150.

Which of the following is not true of program variables

A. can be exported to the entire system
B. can be used only within the shell program
C. can hold data
D. all of the above
Answer» D. all of the above