0% found this document useful (0 votes)
19 views25 pages

Quiz 2

The document consists of a series of questions and answers related to operating systems, covering topics such as system calls, protection mechanisms, APIs, security, memory management, and file permissions. Each question includes a selected answer and a list of possible answers, with some questions needing grading. The content is structured as a quiz format, testing knowledge on various aspects of operating systems.

Uploaded by

Ksososos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views25 pages

Quiz 2

The document consists of a series of questions and answers related to operating systems, covering topics such as system calls, protection mechanisms, APIs, security, memory management, and file permissions. Each question includes a selected answer and a list of possible answers, with some questions needing grading. The content is structured as a quiz format, testing knowledge on various aspects of operating systems.

Uploaded by

Ksososos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

• Question 1

wait event, signal event are examples of system calls related to ____________.

Selected Answer:
process management
Answers: protection
file management
device management

process management
• Question 2
1 out of 1 points
Which of the following statement is true about Protection:
Selected
Answer: Is a mechanism for controlling access of processes or users to resources
defined by the OS
Answers:
Is a mechanism for controlling access of processes or users to resources
defined by the OS
This is optional and is set up by the user when installing the OS
Reduces reliability
Is only available on some operating systems
• Question 3
1 out of 1 points
Which one of the following APIs are used in Mac operating system?

Selected Answer:
POSIX API
Answers: Linux32 API
Java API

POSIX API
Win32 API
• Question 4
1 out of 1 points
Choose the false statement about Security from the options given below::
Selected Answer:
Cannot protect against external attacks
Answers: Can protect against denial of service attacks

Cannot protect against external attacks


Can protect against unauthorized use of system
Can protect against internal attacks
• Question 5
1 out of 1 points
Which mix of languages are typically used for implementing operating systems?

Selected Answer:
Assembly, C and C++
Answers:
Assembly, C and C++
C++, Python and HTML
Perl, Python and Java+
C and HTML5
• Question 6
1 out of 1 points
How does a system distinguish among users to determine their privileges?

Selected Answer:
Each user has a User ID associated with their name and number
Answers:
Each user has a User ID associated with their name and number
None of the above
Each group has full access to all files on the system
Users can only belong to one group
• Question 7
1 out of 1 points
Which data structures are used by OS?

Selected Answer:
Singly linked list
Answers:
Singly linked list
ROM memory
RAM memory
Variables
• Question 8
1 out of 1 points
A cloud run by a company for the company's own use is an example of _______________ cloud.

Selected Answer:
private
Answers: own
public
hybrid
private
• Question 9
1 out of 1 points
__________ allows execution of processes not completely in memory.

Selected Answer:
Virtual memory
Answers: Virtualization
Cache

Virtual memory
CPU scheduling
• Question 10
1 out of 1 points
A user program can request a service from the operating system's kernal using _______________.

Selected Answer:
system call
Answers: scheduling
interrupt

system call
process switching
• Question 11
1 out of 1 points
________________ is used to run multiple operating systems at the same time as a guest
operating system, on a single computer system.

Selected Answer:
Virtualization
Answers: Interrupt
Scheduling
Emulation

Virtualization
• Question 12
1 out of 1 points
Which of the following is used to prevent a process from hogging resources or prevent an
infinite loop?

Selected Answer:
Timer
Answers:
Timer
Emulation
Virtualzation
VMM
• Question 13
1 out of 1 points
A process is:

Selected Answer:
A program in execution
Answers: Something that you do
A program that has finished execution

A program in execution
A program that is waiting to be executed
• Question 14
1 out of 1 points
In _____________ multiprocessing all processors work in parallel and share resources.

Selected Answer:
symmetric
Answers:
symmetric
mix
asymmetric
simple
• Question 15
1 out of 1 points
In cloud computing, _________ is a software stack ready for application use via the Internet.

Selected Answer:
PaaS
Answers:
PaaS
IaaS
NaaS
SaaS
• Question 16
1 out of 1 points
Which memory is the fastest from the following, in terms of access time?

Selected Answer:
registers
Answers: solid state disk
registers
magnetic disk
main memory
• Question 17
1 out of 1 points
One of the benefits of multi-processor system is:

Selected Answer:
Increased Reliability
Answers:
Increased Reliability
Loadable Operating System modules
Using a sinlge CPU effectively
Easier Operating System design
• Question 18
1 out of 1 points
Memory management involves:

Selected Answer:
Keeping track of which parts of memory are currently being used
Answers: Not keeping track of who is using the memory
Memory manages its own space
Installing the maximum memory

Keeping track of which parts of memory are currently being used


• Question 19
1 out of 1 points
Primary storage includes:
Selected Answer:
Processors L1 cache
Answers: Optical drive
Hard drive

Processors L1 cache
Magnetic disk
• Question 20
1 out of 1 points
Which of the following has the largest capacity?

Selected Answer:
Magnetic disk
Answers: Main memory
Flash memory
Register

Magnetic disk
• Question 21
Needs Grading
You have the following files and directories in the current working directory. Write a
command (using wild card) to move file_1_.txt
and file_1_.docs to documents directory.

Correct Answer:
mv file_1* documents
(there are other variations of possible
answer)
Response Feedback: [None Given]
• Question 22
Needs Grading
Write the command to complete the following tasks:

1. Login as root user


2. Create a directory quiz2 in root user's home directory.
3. Create a file question1 in quiz2 directory.

Correct Answer:
1. su - root (1 mark)
2. mkdir quiz2 1 mark)
3. touch quiz2/question1 (1 mark)
Response Feedback: [None Given]
• Question 23
Needs Grading
Write the command to complete the following tasks:
1. Login as student user
2. Create a directory exam in student user's home directory.
3. Create a file questions.txt in exam directory.

Correct Answer:
1. su - student (1 mark)
2. mkdir exam (1 mark)
3. touch exam/questions.txt (1 mark)
Response Feedback: [None Given]
• Question 24
Needs Grading
Write the command to complete the following tasks:
1. Login as teacher user
2. Create a directory project in teacher user's home directory.
3. Create a file myproject.exe in project directory.

Correct Answer:
1. su - teacher(1 mark)
2. mkdir project (1 mark)
3. touch project/myproject.exe (1 mark)
Response Feedback: [None Given]
• Question 25
Needs Grading
Consider you have a file myfile.txt in your current working directory. write command to
complete the following tasks:

1. using octal mode change the permisions of myfile.txt such that user-owner should be
able to read, write & execute, group-owner should be read & execute , while all other
users should be able to execute only.
2. change the user-owner of the file myfile.txt to "student" user

Correct Answer:
1. chmod 751 myfile.txt
2. chown student myfile.txt
Response Feedback: [None Given]
• Question 26
Needs Grading
Consider you have a file info.txt in your current working directory. write command to
complete the following tasks:
1. using octal mode change the permisions of info.txt such that user-owner should be able
to read, write & execute , group-owner should be only read, while all other users should be
able to write & execute only.
2. change the user-owner of the file info.txt to teacher user and group-owner to sharjah

Correct Answer:
1. chmod 743 info.txt
2. chown teacher:sharjah info.txt
Response Feedback: [None Given]
• Question 27
Needs Grading
Consider you have a file data.txt in your current working directory. write command to
complete the following tasks:
1. using octal mode change the permisions of data.txt such that user-owner should be able
to read & write, group-owner should be only read,& execute while all other users should
be able to execute only.
2. change the group-owner of the file data.txt to sharjah

Correct Answer:
1. chmod 651 data.txt
2. chown :sharjah data.txt
Response Feedback: [None Given]
• Question 28
Needs Grading
Calculate the Octal values for following permission string.

RWX--XR-X
Selected Answer: 715
Correct Answer:
715
Response Feedback: [None Given]
• Question 29
Needs Grading

Calculate the Octal values for following permission string.

RW--WXR-X

Selected Answer: 635


Correct Answer:
635
Response Feedback: [None Given]
• Question 30
Needs Grading
Write down the permission string corresponding to the octal value 635.

Selected Answer: [None Given]


Correct Answer:
RW--WXR-X
Response Feedback: [None Given]
• Question 31
Needs Grading
Write down the permission string corresponding to the octal value 514.
Selected Answer: [None Given]
Correct Answer:
R-X--1R--
Ahmed
r-x--xr--
Response Feedback: [None Given]
• Question 32
Needs Grading
Calculate the default file & directory permissions if the umask is 0127.

Selected Answer: 650


Correct Answer:
777
127
------
650
Directory: d RW- R-X ---
File: - RW- R-- ---
Response Feedback: [None Given]
• Question 33
Needs Grading
Calculate the default file & directory permissions if the umask is 0015.

Selected Answer: 762


Correct Answer:
777
015
------
762
Directory: d RWX RW- -W-
File: - RW- RW- -W-
Response Feedback: [None Given]
• Question 34
Needs Grading

Calculate the default file & directory permissions if the umask is 0234.

Selected Answer: 543


Correct Answer:
777
234
------
543
Directory: d R-X R-- -WX
File: - R-- R-- -W-
Response Feedback: [None Given]
• Question 35
Needs Grading
You have the following files and directories in the current working directory. Write a
command (using wild card) to move all .docs (file_1_.docs
and file_2_.docs) to documents directory.

Correct Answer:
mv *.docs documents
Response Feedback: [None Given]
• Question 36
Needs Grading
You have the following files and directories in the current working directory. Write a
command (using wild card) to move all .txt (file_1_.txt
and file_2_.txt) to documents directory.

Correct Answer:
mv *.txt documents
(there are other variations of possible answer)
Response Feedback: [None Given]
• Question 37
1 out of 1 points
Ali is searching for a file named: 01File. Choose the correct command that he has to
run.
Selected Answer:
locate -i 01file
Answers:
locate -i 01file
locate 01file
find 01file
grep 01file
• Question 38
10 out of 10 points
After executing the following command what file permissions are assigned to the owner,
group and others for file1?
chmod 554 file1
Selected D.
Answer: Owner read and execute, group read and execute, others
read
Answers: A.
Owner read write and execute, group read and
execute, others read write
B.
Owner read write and execute, group read write and
execute, others read
C.
Owner read write and execute, group read and
execute, others read
D.
Owner read and execute, group read and execute, others
read
• Question 39
0 out of 10 points
After executing the following command, indicate what file permissions are
assigned to myFile by owner, group, and others.
chmod 554 myFile
Selected B.
Answer: Owner read write and execute, group read and execute,
others read
Answers: A.
Owner read and execute, group read write and execute,
others read
B.
Owner read write and execute, group read and execute,
others read
C.
Owner read and execute, group read and execute, others
read
D.
Owner read and execute, group read and execute, others
read write
• Question 40
10 out of 10 points
What is the octal expression for the permission -rwxrw-r– ?
Selected Answer: C.
764

Answers: A.
755
B.
766
C.
764

D.
744
• Question 41
10 out of 10 points
Which of the following statements best relates to the use of the
command rm -r on a directory in Linux?
Selected D.
Answer: It will delete the directory and all its files and subdirectories.
Answers: A.
It will delete the files .
B.
It will delete the files and similar files .
C.
It will create the directory and all its files and
subdirectories.
D.
It will delete the directory and all its files and subdirectories.
• Question 42
1 out of 1 points
If the umask is 0002, Choose the correct default permission for Files
Selected Answer:
664
Answers: 657
466

664
644
• Question 43
Needs Grading
What is a bootstrap loader and what is its purpose?
What type of memory is used to store a bootstrap loader?
What is the purpose of common bootstrap loader like GRUB ?

Correct
Answer:
1. The bootstrap loader is a small piece of code. It locates the OS kernel,
loads it into computer memory and start the OS.
2. The bootstrap loader is stored in ROM/EEPROM which is read-only
memory.
3. It allows selection of kernel from multiple disks
Response [None Given]
Feedback:
• Question 44
Needs Grading
Write down the four different Operating System Structure to design and implement the
operating systems? Give one example of the operating system implemented by each
structure.

Correct Answer:
1. Simple Structure: MS-DOS
2. Beyond simple but not fully layered: Unix
3. Microkernel System Structure: Mach
4. Modular Structure : Linux, Solaris
Response Feedback: [None Given]
• Question 45
Needs Grading
If the operating system crashed/failed and you want to identify the causes of this failure.
Explain what actions will you take which help you to identify the cause of this operating
system failure?

Correct
Answer: The Operating system failure can generate a crash dump file containing kernel
memory. Investigating this crash dump file can help to identify the causes
of operating system failure.
Response [None Given]
Feedback:
• Question 46
Needs Grading
Write down and describe the operating system services which provide the functions that are
helpful to the users.

Correct
Answer:
1. Program execution - The system must be able to load a program into
memory, run that program, and end execution, (normally or abnormally).
2. /O operations - A running program may require I/O, which may involve a
file or an I/O device
3. File-system manipulation - Programs need to read and write files and
directories, create and delete them, search them, list file Information,
permission management.
4. Communications – Processes may exchange information, on the same
computer or between computers over a network
5. Error detection – OS needs to be constantly aware of possible errors that
may occur in the CPU and memory hardware, in I/O devices, in user program.
Response [None Given]
Feedback:
• Question 47
Needs Grading
If you sent a skype message to your friend. Which service among the services provided by
the operating system is used on your behalf?
Selected Answer: Service for Communications
Correct Answer:
Service for Communications.
Response Feedback: [None Given]
• Question 48
Needs Grading
If you opened a new spreadsheet (Excel) on your computer. Which service among the
services provided by the operating system is used to execute/run the spreadsheet (Excel).
Selected Answer: file management
Correct Answer:
Program execution.
Response Feedback: [None Given]
• Question 49
Needs Grading
What is system call?

What is API?

What is the difference between system call and API?

Correct
Answer: The System calls are programming interface to the services provided by the
OS.
Application Program Interface (API) is used by the programmers to request
the operating system service rather than system call.
Application developers often do not have direct access to
the system calls but can access them through an application
programming interface (API).
Response [None Given]
Feedback:
• Question 50
1 out of 1 points
Reem has two files: FileA and FileB. She wants to merge their contents into a new
file: FileAB. Choose the correct Linux command that Reem should run to perform
this task.
Selected Answer:
cat FileA FileB >FileAB
Answers: head FileA FileB >FileAB
gedit FileA FileB >FileAB
less FileA FileB >FileAB

cat FileA FileB >FileAB


• Question 51
1 out of 1 points
The permission which was assigned to the file "hellp.py" is 705. Choose the correct
meaning of this permission.
Selected
Answer: The owner can read, write and execute. The others can read and
execute. The group can do nothing.
Answers: The others can read, write and execute. The owner can read and
execute. The group can do nothing.
The owner can read, write and execute. The group can read and
execute. The others can do nothing.
The group can read, write and execute. The others can read and
execute. The owner can do nothing.

The owner can read, write and execute. The others can read and
execute. The group can do nothing.
Monday, June 21, 2021 8:24:22 AM GST


The amount of CPU used, clock time elapsed since start, process time limits are maintained for each
process through _______
Selected Answer: B.
Accounting information
Answers: A.
I/O status Information
B.
Accounting information
C.
CPU scheduling information
D.
Memory-Management information
• Question 2
1 out of 1 points
___________ scheduler performs swapping.

Selected Answer: C.
Medium-term
Answers: A.
Device
B.
Long-term
C.
Medium-term
D.
CPU
• Question 3
1 out of 1 points
In __________, the CPU switch from one process to another process.

Selected Answer: A.
context switch
Answers: A.
context switch
B.
message passing
C.
swapping
D.
scheduling
• Question 4
1 out of 1 points
______________ scheduler selects which process should be executed next and allocates CPU.

Selected Answer: D.
Short-term
Answers: A.
Medium-term
B.
Double-term
C.
Long-term
D.
Short-term
• Question 5
1 out of 1 points
In process creation, ________ process creates _______ processes, which in turn creates other
processes, forming a _____ of processes

Selected Answer: D.
parent - children - tree
Answers: A.
parent - tree - children
B.
tree - children - parent
C.
children - parent - tree
D.
parent - children - tree
• Question 6
1 out of 1 points
The life cycle of a process includes

Selected Answer: C.
It changes state to, new, running, waiting, ready, terminated
Answers: A.
It changes state to new, walking, waiting, ready, terminated
B.
It changes state to new, skiping, waiting, ready, terminated
C.
It changes state to, new, running, waiting, ready, terminated
D.
None of the above
• Question 7
1 out of 1 points
Which of the following descibes the state of a process?

Selected Answer: A.
Running, waiting
Answers: A.
Running, waiting
B.
Happy, sad
C.
Read, write
D.
Create, delete
• Question 8
1 out of 1 points
Which of the following is NOT part of Process Control Block (PCB)?

Selected Answer: A.
Text section
Answers: A.
Text section
B.
Program counter
C.
Memory Management Information
D.
Program state
• Question 9
1 out of 1 points
When several jobs are ready to run at the same time, OS has to choose which to run first.
This is done by __________.

Selected Answer: A.
Short term scheduler
Answers: A.
Short term scheduler
B.
Job scheduler
C.
Medium term scheduler
D.
Device scheduler
• Question 10
1 out of 1 points
When a process is waiting to be assigned to a processor it is in _________ state.

Selected Answer: D.
Ready
Answers: A.
Terminating
B.
Waiting
C.
Running
D.
Ready
• Question 11
1 out of 1 points
Which part of a process contains program code?

Selected Answer: D.
text section
Answers: A.
heap
B.
stack
C.
data section
D.
text section
• Question 12
1 out of 1 points
Choose the correct statement about process creation:

Selected D.
Answer: Parent process create children processes, which, in turn create other
processes
Answers: A.
Parent process cannot create children processes. Each process is a parent
and a child
B.
None of the above
C.
Parent process create children processes, which, in turn cannot create
other processes
D.
Parent process create children processes, which, in turn create other
processes
• Question 13
1 out of 1 points
_________ is a combination of IP address and port number, and it is used in communication
between client/server systems?

Selected Answer: A.
Socket
Answers: A.
Socket
B.
Pipe
C.
RPC
D.
IPC
• Question 14
1 out of 1 points
If a process is in running state, and it requires an I/O, then the process will be moved to
__________ state.

Selected Answer: B.
waiting
Answers: A.
terminate
B.
waiting
C.
new
D.
ready
• Question 15
1 out of 1 points
Which of the following adds overhead time?

Selected Answer: A.
Context switch
Answers: A.
Context switch
B.
I/O or event wait
C.
Process termination
D.
Ready process
• Question 16
1 out of 1 points
Execution of a program is started by one of the following options:

Selected Answer: C.
mouse clicks in a GUI
Answers: A.
delete a file from disk
B.
save the program to disk
C.
mouse clicks in a GUI
D.
write the program name in notepad
• Question 17
1 out of 1 points
___________ is the part of the process that contains the memory, which is dynamically allocated
during run time,

Selected Answer: B.
Heap
Answers: A.
Data section
B.
Heap
C.
Stack
D.
Text section
• Question 18
1 out of 1 points
Program is _________ entity stored on disk (executable file), process is _______ entity.

Selected Answer: A.
passive - active
Answers: A.
passive - active
B.
passive - iddle
C.
active - passive
D.
iddle - active
• Question 19
1 out of 1 points
A process consists of:

Selected Answer: D.
Heap, stack, data, text
Answers: A.
Programe, execution, heap, stack
B.
Electricty, code, data stack
C.
Heap, stack, data, variables
D.
Heap, stack, data, text
• Question 20
1 out of 1 points
Which of the following statement is correct:

Selected D.
Answer: Long-term scheduler - selects which processes should be brought into the
ready queue
Answers: A.
Half-term scheduler - selects process that can go on break
B.
Short-term scheduler - selects which process should be removed from the
CPU
C.
Medium-term scheduler - cannot perform swapping.
D.
Long-term scheduler - selects which processes should be brought into the
ready queue
• Question 21
1 out of 1 points
What does process scheduling do?

Selected Answer: A.
It maximize CPU use
Answers: A.
It maximize CPU use
B.
It minimises CPU use
C.
It minimises memory use
D.
It maximize memory use
• Question 22
1 out of 1 points
The medium term scheduler removes a process from memory, and then stores the process
on the disk, as suspended process in virtual memory, it is called _______.

Selected Answer: D.
swap out
Answers: A.
shift out
B.
exchange out
C.
change out
D.
swap out
• Question 23
1 out of 1 points
A program becomes a process:

Selected Answer: A.
When its executable file is loaded into memory
Answers: A.
When its executable file is loaded into memory
B.
If there is a bug in the program code
C.
When a child process is in a waiting state
D.
When it is doing work
• Question 24
1 out of 1 points
With reference to the parts of a process, select the correct option:

Selected Answer: A.
Data section contains global variables
Answers: A.
Data section contains global variables
B.
Stack contains dynamically allocated memory
C.
Heap contains waste
D.
The text contains the user agreement
• Question 25
1 out of 1 points
All of the following statements are true, EXCEPT:
Selected Answer: B.
Program is an active entity stored on disk
Answers: A.
Multiple users can execute the same program
B.
Program is an active entity stored on disk
C.
Execution of a program started by typing its name on command line
D.
As a process executes it changes state
• Question 26
Needs Grading
List the conditions when the CPU suspends a process in execution.

Correct Answer:
• Makes an I/O request
• Time slice has expired
• Forks a child process
• Wait for an interrupt
Response Feedback: [None Given]
• Question 27
Needs Grading
What is swapping? Explain how the OS performs swapping.

Correct
Answer: Swapping occurs when a process is removed from memory
and stored on the disk as a suspended process in virtual
memory. This is called swap out.
When the process is brought back in memory (RAM) from the
disk (Virtual Memory), it is called swap in.
Response [None Given]
Feedback:
• Question 28
Needs Grading
Explain the difference between an I/O-bound process and a CPU-bound
process.

Correct
Answer: The differences between the two types of processes stem from
the number of I/O requests that the process generates.
• I/O-bound process spends more of its time seeking I/O
operations than doing computational work. Many short CPU
bursts.
• CPU-bound process infrequently requests I/O operations and
spends more of its time performing computational work. Few
very long CPU bursts.
Response [None Given]
Feedback:
• Question 29
Needs Grading
Describe the differences among short-term, medium-term, and long-term
scheduling.

Correct
Answer: • Long-term (job scheduler)—determines which jobs are
brought into ready queue (into memory) for processing.
• Short-term (CPU scheduler)—selects from jobs in memory
those jobs that are ready to execute and allocates the CPU
to them.
• Medium-term performs swapping. A swapping scheme is
implemented to remove partially run programs from memory
and reinstate them later to continue where they left off
(swap-out and swap-in)
Response [None Given]
Feedback:
• Question 30
Needs Grading
Describe the actions taken by a kernel to context-switch between
processes.

Correct
Answer: • When CPU switches from one process to another
process, the system must save the state of the
currently running process and load the saved state for
the process scheduled to run next.
• Saving the state of a process typically includes the
values of all the CPU registers in addition to memory
allocation. Context of a process represented in the
PCB.
• Context-switch time is overhead; the system does no
useful work while switching
Response [None Given]
Feedback:
• Question 31
Needs Grading
What common events lead to the creation of a process?

Correct Answer:
• When a program is executed via a mouse click or
using a command line
• When a parent process creates child processes using
fork()
Response [None Given]
Feedback:
• Question 32
Needs Grading
Explain why Google Chrome uses multiple processes.

Correct
Answer: Each website opens up in a separate tab and is represented with a
separate renderer process. If a webpage was to crash, only the
process representing that tab would be affected, all other sites
(represented as separate tabs/processes) would be unaffected.
Response [None Given]
Feedback:
• Question 33
Needs Grading
Name and describe the different states that a process can exist in at any
given time.

Correct
Answer: The possible states of a process are new, running, waiting,
ready, and terminated.
• New: The process is being created while in the new state
• Running: the process is executing
• Waiting: wait for an event to occur
• Ready: The ready state occurs when the process is ready and
waiting to be assigned to a processor
• Terminate: after the process is finished executing its code, it
enters the termination state

You might also like