Operating System MCQ

An operating system provides a platform on which other applications programs can be installed. It also provides the environment within which programs are executed. It can be termed as a program or system software that acts as an intermediary between user and hardware.

Resource Manager/Allocator - It manages the system resources in an unbiased fashion in both hardware(mainly CPU time, memory, system buses) and software(access, authorization, semaphores) and provides the functionality to application programs.

Operating System controls and coordinates the use of resources among various application programs.

Computer Hardware - CPU, Memory units, I/O devices, system bus, registers, etc, provides the basic computing resources.

System and Application Programs - Defines the way in which these resources are used to solve the computing problems of the user.

Functions of Operating System

  • Process Management
  • Memory Management
  • I/O device management
  • File Management
  • Network Management
  • Security and Protection


Types of Operating Systems

Batch Operating System

  • To speed up the processing job with similar types, the tasks are batched together and were run through the processor as a group batch.
  • In some operating systems, grouping is done by the operator while in some systems, it is performed by the Batch Monitor resisted in the low end of the main memory.
  • The jobs are bundled into batches with similar requirements.
  • Then the submitted jobs were grouped as FORTRAN jobs, COBOL jobs, etc.


Multiprogramming Operating System

  • A single program cannot, in general, keep either the CPU or the I/O devices busy all times. The basic idea of a multiprogramming operating system is it keeps several jobs in the main memory simultaneously.
  • The OS picks and begins to execute one of the jobs in memory. Eventually, the jobs may have to wait for some task, such as an I/O operation, to complete.


Multitasking Operating System

  • In the modern OS, we are able to play MP3 music, edit documents, surf the web all running at the same time.
  • For multitasking to take place, firstly there should be multiprogramming i.e. presence of multiple programs for execution. And secondly the concept of time-sharing.


Real-Time Operating System

  • A real-time system is a time-bound system that has well-defined fixed time constraints. Processing must be done within the defined constraints or the system will fail.
  • RTOS is intended to serve real-time applications that process data as it comes in, typically without buffer delays. It is used in an environment where a large number of events must be accepted and processed in a short time.


Resources

Practice Coding
OS Interview Questions
Features of Operating System
Components of Operating System

Operating System MCQ

1. 

When can the binding of instructions and data to memory addresses be done?

Load time

Compile time

Execution time

All of the above

2. 

The speed of writing data in magnetic tape disks is comparable to that of disk drives. State True/False

True

False

Both, depends on the data

None

3. 

The two types of semaphores are-

Counting and decimal semaphore

Counting and binary semaphore

Counting and mutex

None

4. 

Thread is a

Light weight process

Heavy weight process

Multi-process

I/0 process

5. 

Threads is not shared among which of the following?

stack

program counter

both program counter and stack

none

6. 

To access the services of operating system the interface is provided by the?

System Calls

API

Library

Assembly Instructions

7. 

UNIX is written in which language?

C#

C++

C

.NET

8. 

Unsafe states are?

Not deadlocks

Deadlocks

Livelock

None

9. 

What are the two types of operating modes of AT?

Virtual mode, dedicated mode

Private mode, public mode

Real mode, protected mode

Direct mode, indirect mode

10. 

What else is a command interpreter called?

prompt

kernel

command

shell

11. 

What is meant by ready state of a process?

When the process is scheduled to run after some execution

When the process is currently using the CPU

When the process is dependent of the execution time of some other process.

None of these

12. 

What of the following defines Thread cancellation?

The process of terminating a thread process before its execution

The process of removing a thread after its work is executed

The process of destroying the thread after its work is executed

none

13. 

When a thread terminates some target thread immediately, it is known as?

Immediate Termination

Asynchronous termination

Synchronous termination

Deferred cancellation

14. 

When are the register context and stack of thread deallocated?

when the thread terminates

when the thread blocks

when the thread unblocks

when the thread spawns

15. 

The size of virtual memory is based on which of the following?

CPU

Address Bus

RAM

Data Bus

16. 

Which of the following are CPU scheduling algorithms?

Priority scheduling

Round Robin

Shortest Job First

All of the above

17. 

Which of the following are two types of atomic operations performed by semaphores?

wait, signal

wait, stop

signal, stop

signal, wait

18. 

Which of the following commands in UNIX is used to send a signal?

send

kill

sigsend

none

19. 

Which of the following is a single user operating system?

Windows

Ms-DOS

MAC

None

20. 

Which of the following is also known as the base register?

Relocation register

Regular register

Delocation register

Basic register 

21. 

Which of the following is an example of a real-time operating system?

Process Control

MS DOS

WIndows XP

Lynx

22. 

Which of the following is known as uninterruptible unit?

single

static

atomic

none of the mentioned

23. 

Which of the following is not an operating system?

Linux

DOS

Oracle

Windows

24. 

Which of the following is the only state transition that is initiated by the user process itself?

dispatch

wakeup

block

none

25. 

Which of the following schedules threads?

Virtual memory

Operating system

CPU

Input

26. 

Which of the type of OS reads and reacts in terms of actual time?

Quick sharing OS

Time Sharing OS

Real time OS

Batch OS

27. 

Why is CPU scheduling done?

decrease CPU utilisation

decrease cost

increase CPU utilisation

None

28. 

Identify the system calls that on termination does not return control to the calling point.

exec

fork

longjmp

ioctl

29. 

A process which is copied from main memory to secondary memory on the basis of 
requirement is known as -

Demand paging

Paging

Threads

Segmentation

30. 

A systematic procedure for moving the CPU to new process is known as-

Synchronization

Deadlock

Starvation

Context Switching

31. 

Among the following CPU scheduling algorithms, which of these allocated the CPU first to the process that requests the CPU first?

FCFS

SJF

Priority scheduling

None

32. 

Among the following, which is an example of a spooled device?

A line printer that prints the output of a number of jobs.

A terminal that inputs user data

A I/O device to display graphics.

None

33. 

Consider the following program:

main()
{
     if(fork()>0)
sleep(100);
}

infinite process

orphan process

zombie process

none

34. 

Device driver required in?

Register

Main memory

Disk

Cache

35. 

FIFO scheduling is a type of:

Pre-emptive scheduling

Non-pre-emptive scheduling.

Deadline scheduling

None of the above

36. 

For which of the following is resource sharing used?

an application having several threads of activity all within the same address space.

share the memory and resources of the process to which the threads belong

Compress the address space a process can use

all of the mentioned

37. 

For which of the following is the jacketing technique used?

to construct a new thread

to communicate between threads

convert a blocking system call into non blocking system call

None

38. 

For which of the following purposes in Banker’s algorithm is used?

Preventing deadlock

Solving deadlock

Recover from deadlock

None

39. 

How many minimum variables is/are required to share between processes, so as to solve the critical section problem?

one

two

three

four

40. 

Identify the call which never returns an error?

fork

getpid

ioctl

open

41. 

A binary semaphore has a value of

0

1

-1

2

42. 

Identify the two steps of a process execution.

CPU & I/O Burst

I/O & OS Burst

Memory & I/O Burst

CPU and Memory burst

43. 

Is mutual exclusion required for shareable resources?

Yes

No

Maybe

None

44. 

Main memory of a computer system is?

Non-volatile

Volatile

Restricted

Unrestricted

45. 

Many to One model is at an advantage in which of the following conditions?

When the program needs to be multi-threaded

When there is a single processor present

When the program does not need multithreading

None

46. 

Operating systems

Provides a layer so as to act as a user-friendly interface that enables the programmer to draw a flow chart

Links the program with subroutines

Helps to create a flow chart of the programs

All of these

47. 

OS classifies the threads as-

Mainframe and motherboard level

Kernel and User level

Security and Memory level

OS and CPU level

48. 

Select the correct definition of spooling.

Spooling is a type of fast memory

Spooling holds a single copy of data

Spooling holds copy of all data in the system

none

49. 

Semaphore is a __ and it helps to solve the problem of  ___?

atomic, critical section

integer variable, memory error

integer variable, critical section

atomic, memory error

50. 

Signals of some given type are

sent together

queued

stacked

none

51. 

The most optimal CPU scheduling algorithm is ________

Shortest Job First

First Come First Serve

Round robin

None

52. 

The output of the following C program is?

int main(){
	fork();
    fork();
    printf("code ");
}

code code code code

code code code

code code

code

53. 

The release and request of resources are a type of which of the following?

system calls

I/O interrupts

command lines

None