0% found this document useful (0 votes)
10 views

Computer programming Mcq

Uploaded by

Nan Kumar
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)
10 views

Computer programming Mcq

Uploaded by

Nan Kumar
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/ 28

Telegram - https://t.

me/placementclasses
Computer Science Core

AMCAT Previous Year Papers and study materials


OPERATING SYSTEM & COMPUTER ARCHITECTURE
Question 1 :-
In ____ if a parent process terminates, then all of its children processes must also
be terminated

A) process termination

B) serial termination

C) parallel termination

D) cascading termination

Answer:- D

Question 2:-
Number of tuples in a relation is called ________ and number of attributes is calle
d _______

A) domain, cardinality

B) degree, cardinality

C) cardinality, degree

Placement Classes
Telegram :- https://t.me/placementclasses

D) domain, degree

Answer:- C

Question 3:-
Places(location,name, type) Choose the correct option Which of the following que
ries can be used to retrieve name and type from table “Places(given in the passage
), where column ‘location” has value Delhi and output should be in thealphabetical
ly increasing order of column “name’?

A) SELECT name, type FROM Places WHERE locationDelhi SORT BY 1;

B) SELECT name, type FROM Places WHERE location’Delhi’ SORT BY name;

C) SELECT name, type FROM Places WHERE location=’Delhi’ ORDER BY 1;

D) SELECT name, type FROM Places WHERE location=’Delhi’ ORDER BY 2;

E) SELECT name, type FROM Places WHERE location’Delhi SORT BY 2;

Answer:- C

Question 4:-
What are necessary conditions for deadlock?

1. Mutual exclusion (where at least one resource is nonsharable)

2. Hold and wait (where a process holds one resource and waits for other resourc
es)

3. No preemption (where the resources cant be preempted)

4. Circular wait

A) Only 1 & 2

B) Only 1 & 3

C) Only 2 & 4

D) Only 1 & 2 & 4

E) All the above

Answer:- E

Question 5:-
If a process is executing in its critical section, then no other processes can be exec

Placement Classes
Telegram :- https://t.me/placementclasses

uting in their critical section. This condition is called

A) mutual exclusion

B) critical exclusion

C) synchronous exclusion

D) asynchronous exclusion

Answer:- A

Question 6:-
For a deadlock to arise, which of the following conditions must hold simultaneousl
y ? ( choose all that apply )

A) Mutual exclusion

B) Starvation

C) Hold and wait

D) No preemption

E) Circular wait

Answer:- A,C,D&E

Question 7:-
Consider the following set of processes, the length of the CPU burst time given in
milliseconds : Process Burst time P1 6 P2 8 P3 7 P4 3 Assuming the above process
being scheduled with the SJF scheduling algorithm :

A) The waiting time for process P2 is 3ms.

B) The waiting time for process P2 is 0ms.

C) The waiting time for process P2 is 16ms.

D) The waiting time for process P2 is 9ms.

Answer:- C

Question 8:-
Orders are processed in the sequence they arrive if _______ rule sequences the jo
bs.

A) earliest due date

Placement Classes
Telegram :- https://t.me/placementclasses

B) slack time remaining

C) first come, first served

D) critical ratio

Answer:- C

Question 9:-
A solution to the problem of indefinite blockage of low – priority processes is :

A) Starvation

B) Wait queue

C) Ready queue

D) Aging

Answer:- D

Question 10:-
One of the disadvantages of the priority scheduling algorithm is that :

A) it schedules in a very complex manner

B) its scheduling takes up a lot of time

C) it can lead to some low priority process waiting indefinitely for the CPU

D) None of these

Answer:- C

AMCAT Computer Science Computer Architecture


Question 1:-
Choose the correct option. Which of the following statements is/are true about th
e Seek time in the disk ?

1. Time needed to move the disk amr to the desired cylinder.

2. It is also called positioning time.

3. It is aslo called random access time.

A) Only 1 B Only 2 C Both 1 and 2

D) Both 1 and 3

Placement Classes
Telegram :- https://t.me/placementclasses

E) All 1,2 and 3

Answer:- E

Question 2:-
Which of the following statements are true?

1Transfer of data from Main Memory to Cache Memory is known as mapping


process

2 Associative Memory stores both address and data of memory word

3 If the word is not found in the Cache and is in main memory, it is a miss

4 Content Addressable Memory and Associative Memory are same

A) Both 1 and 3

B) Both 2 and 3

C) Both 1 and 4

D) 1,2 and 3

E) All-1,2, 3 and 4

Answer:- E

Question 3:-

Group A Group B

A. Next fit allocation 1. Processor sharing

B. Mapping of address 2. Contiguous memory allocation

C. Round-robin scheduling 3. Memory management unit

D. Push migration 4. Load balancing

A) A-3,B-4,C-1,D-2

B) A-2. B-3. C-1, D-4

C) A-2,B-1,C-4,D-3

D) A-4,B-2,C-3,D-1

Answer:- B

Placement Classes
Telegram :- https://t.me/placementclasses

Question 4:-

GroupA Group B

A. Contiguous allocation 1. Extra memory consume

B. Linked list allocation 2. Slow random access

C. FAT allocation Group 3. Disk fragmentation

A) A-1, B-2, C-3

B) A-3, B-2. C-1

C) A-1,B-3,C-2

D) A-2, B-1, C-3

Answer:- A

Question 5:-

Group A Group B

A. Hit ratio 1. Logical memory

B. Pages 2. Compaction

C. Frames 3. Translation look-aside buffer

D. External fragmentation 4. Physical memory

A) A-2, B-4, C-1,D-3

B) A-3, B-1,C-4, D-2

C) A-2;B-1.;C-4; D-3

D) A-1; B-3; C-4; D-2

Answer:- B

Question 6:-
Calculate the number of frames the memory will have if the page size is 4 bytes an
d the physical memory of 16 bytes.

A) 4 frames each 4 bytes

B) 6 frames each 1 bytes

Placement Classes
Telegram :- https://t.me/placementclasses

C) 2 frames each 8 bytes

D) 1 frame 16 bytes

Answer:- A

AMCAT Computer Science Process


Management and Synchronisation
Question 1:-
There are 5 processes P1, P2. P3, P4 and P5 which are processed by Preemptive Pri
ority scheduling algorithm. In what sequence the processes would be scheduled, ifl
ower number in the priority column in the given table denotes the higher priority?

Pro A Pri B(in ms)

P1 0 3 10

P2 0 1 1

P3 2 5 2

P4 2 4 1

P5 3 2 5

Process> Pro

Arrival Time>A

Priority >Pri

Burst Time in Milliseconds (ms)>B

A) P2-P1-P1-P5-P1-P1-P4-P3

B) P2-P1-P5-P1-P1-P4-P3

C) P2-P1-P1-P5-P4-P1-P3

D) P2-P1-P1-P5-P1-P4-P3

Answer:- D

Question 2:-
In ------------------, if a parent process terminates, then all of its children processes
7

Placement Classes
Telegram :- https://t.me/placementclasses

must also be terminated.

A) process termination

B) serial termination

C) parallel termination

D) cascading termination

Answer:- D

Question 3:-
Which of the following is/are true?

1 Banker’s algorithm is used for the avoidance of deadlock.

2 Resourse
allocation graph is used for a system with multiple instances of each resource type.
A) Only 1

B) Only 2

C) Both 1 and 2

D) Neither 1 or 2

Answer:- A

Question 4:-
Which of the following statements is/are incorrect’

1. A thread can acquire more than one lock(Mute).

2. Deadlock will occur if a non-recursive mutex is locked more than once.

3. Mutex Is a signalling mechanism used to synchronise access to a resource.

A) Only 1

B) Only 2

C) Only 3

D) Both 1 and 2

Answer:- D

Question 5:-
A semaphore S is an integer variable that, apart from initialization, is accessed onl

Placement Classes
Telegram :- https://t.me/placementclasses

y through two standard atomic operations What are those operations?

A) test() and set()

B) wait() and signal()

C) lock() and unlock()

D) test() and flag()

Answer:- B

Question 6:-
Bankers Algorithm is a technique of _________.

A) deadlock avoidance

B) deadlock prevention

C) deadlock detection

D) deadlock creation

Answer:- A

Question 7:-
Round robin scheduling falls under the category of :

A) Non Preemptive

B) Preemptive

C) Mutli Preemptive

D) None of these

Answer:- B

Question 8:-
The most optimal scheduling algorithm is :

A) FCFS – First come First served

B) SJF – Shortest Job First

C) RR – Round Robin

D) None of these

Answer:- B

Placement Classes
Telegram :- https://t.me/placementclasses

Question 9:-
Consider the following page reference string : 1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6 i
) For LRU page replacement algorithm with 4 frames, the number of page faults is :
A) 14

B) 8

C) 11

D) 10

Answer:- D

Question 10:-
For FIFO page replacement algorithms with 4 frames, the number of page faults is :
A) 16

B) 14

C) 11

D) 15

Answer:- B

AMCAT Computer Science Memory and I/O


Management
Question 1:-

A.windows95 1.FAT16

B.DOS 2.Redundancy

C.RAID 3. NTFS

D.UNIX o.s 4.Time sharing


Match the given operating system terms in GroupA with their chracteristics in
GroupB

A A-3 B-1 C-2 D-4

B A-3 B-4 C-1 D-2

C A-4 B-3 C-1 D-2

10

Placement Classes
Telegram :- https://t.me/placementclasses

D A-1 B-3 C-2 D-4

Answer:- B

Question 2:-
Consider the following reference string - 4.,7,0, 7, 1, 0, 1,2, 1, 2, 7, 1,2, 0 Calculate
the difference between the number of page faults encountered when the optimal
page replacement policy is used with 4 page frames and 3 page frames respectively
A) 0

B) 1

C) 2

D) 3

Answer:- B

Question 3:-

Group A Group B

A. First-Come, First-Serve Replacement Algorithm 1. Coalescing

B. Least Recently Used Replacement Algorithm 2. Stack Algorithm

C. Paging 3. Belady’s Anomaly

D. Buddy System 4. Thrashing

A) A-2, B-3, C-1, D-4

B) A-3, B-2, C-1, D-4

C) A-3, B-2, C-4, D-1

D) A-1, B-2, C-3, D-4

Answer:- B

Question 4:-
Memory management technique in which system stores and retrieves data from s
econdary storage for use in main memory is called

A) fragmentation

B) paging

C) mapping

11

Placement Classes
Telegram :- https://t.me/placementclasses

D) none of the mentioned

Answer:- B

Question 5:-
I/O hardware contains

A) bus

B) controller

C) I/O port and its registers

D) all of the mentioned

Answer:- D

Question 6:-
Run time mapping from virtual to physical address is done by

A) Memory management unit

B) CPU

C) PCI

D) none of the mentioned

Answer:- A

Question 7:-
The page table contains

A) page offset

B) base address of each page in physical memory

C) page size

D) none of the mentioned

Answer:- B

Question 8:-
Thrashing _______ the CPU utilization.

A) increases

B) keeps constant

12

Placement Classes
Telegram :- https://t.me/placementclasses

C) decreases

D) none of these

Answer:- C

Question 9:-
A process is thrashing if :

A) it spends a lot of time executing, rather than paging

B) it has no memory allocated to it

C) it spends a lot of time paging, than executing

D) None of these

Answer:- C

Question 10:-
The hardware mechanism that allows a device to notify the CPU is called _______.

A) polling

B) interrupt

C) driver

D) Controlling

Answer:- B

AMCAT Computer Science Data model


Question 1:-
Which of the following queries can be used to find out the rows containing the
data about the candidates who took the entrance test more than two years ago?

A) SELECT * FROM Candidates WHERE dateOfTest

B) SELECT * FROM Candidates WHERE dateOfTest

C) SELECT * FROM Candidates WHERE dateOfTest

D) SELECT * FROM Candidates WHERE dateOfTest>(yy,-2,GETDATE());

Answer:- B

Question 2:-

13

Placement Classes
Telegram :- https://t.me/placementclasses

What will be the output of the following SQL query?

SELECT Name, Age FROM tbl_student WHERE Age NOT BETWEEN 12 AND 15;

A) Displays only NULL values.

B) Does not display NULL values

C) May display NULL values.

D) Error in the query.

Answer:- C

Question 3:-
A parent Process executes ______ system call to create a child process.

A) exce()

B) fork()

C) child()

D) create()

Answer:- B

Question 4:-
Which of the following is example of Object based logical model ?

A) Entity Relationship Model

B) Hierarchical Model

C) Relational Model

D) Network Model

Answer:- A

Question 5:-
An entity in A is associated with at most one entity in B, and an entity in B is associated w
ithat most one entity in A. This is called as

A) One-to-many

B) One-to-one

C) Many-to-many

14

Placement Classes
Telegram :- https://t.me/placementclasses

D) Many-to-one

Answer:- B

Question 6:-
The attribute name could be structured as a attribute consisting of first name, mid
dle initial, and last name . This type of attribute is called

A) Simple attribute

B) Composite attribute

C) Multivalued attribute

D) Derived attribute

Answer:- B

Question 7:-
In the Relational Model, the number of columns in a table is termed as _______.

A) cardinality

B) degree

C) domain

D) None of these

Answer:- B

Question 8:-
Which company has developed the hierarchical model?

A) IBM

B) Sun Microsystems

C) Oracle

D) Microsoft

Answer:- A

Question 9:-
Which is the subset of SQL commands used to manipulate Oracle Database
structures, including tables?

A) Data Definition Language(DDL)

15

Placement Classes
Telegram :- https://t.me/placementclasses

B) Data Manipulation Language(DML)

C) Both of above

D) None

Answer:- A

Question 10:-
What is a view?

A) A view is a special stored procedure executed when certain event occurs.

B) A view is a virtual table which results of executing a precompiled


query. A view is not part of the physical database schema, while the regular tables are.

C) A view is a database diagram.

D) None of these

Answer:- B

AMCAT Computer Science Relational Algebra and SQL


Question 1:-
The minimal set of a super key is?

A) candidate key

B) primary key

C) foreign key

D) secondary key

Answer:- A

Question 2:-
car(car_number,car_type,mfd) owner(name,age,car_number,number) Akshay has
2 tables namely - car and owner (given in the passage), with a common column car
_number. Which of the following queries will retrieve car_ type where owner na-
me Is ‘Nikhil’?

A)
SELECT car_type FROM car WHERE car_number IN (SELECT car_number FROM own
er WHERE name=’Nikhil’);

16

Placement Classes
Telegram :- https://t.me/placementclasses

B)
SELECT car_type FROM car WHERE car_number=(SELECT * FROM owner WHERE na
me= ‘NikhiI’);

C)
SELECT car _type FROM car WHERE car _number LIKE (SELECT * FROM owner WHER
E name=’NikhiI’);

D)
SELECT car_type FROM car WHERE car_number BETWEEN(SELECT car_number FRO
M owner WHERE name=’Nikhil’);

Answer:- A

Question 3:-
Which of the following is a fundamental operation in relational algebra ?

A) Set intersection

B) Natural join

C) Assignment

D) None of the mentioned

Answer:- D

Question 4:-
Which of the following is not a unary operator?

A) where

B) select

C) rename

D) min

Answer:- D

Question 5:-
If in JOIN operation, conditions of JOIN operation are not satisfied then results of
operation is

A) Zero tuples and empty relation

B) zero tuples from two relation

17

Placement Classes
Telegram :- https://t.me/placementclasses

C) one tuple from one relation saying null

D) two tuples from empty relations

Answer:- A

Question 6:-
Which of the following is not a DML statement?

A) Select

B) Insert

C) Create

D) Delete

Answer:- C

Question 7:-
Which of the following can be rolledback?

A) Truncate

B) Delete

C) Drop

D) None

Answer:- B

Question 8:-
A ________ in a table represents a relationship among a set of values.

A) Column

B) Key

C) Row

D) Entry

Answer:- C

Question 9:-
A relational database consists of a collection of

A) Tables

18

Placement Classes
Telegram :- https://t.me/placementclasses

B) Fields

C) Records

D) Keys

Answer:- A

Question 10:-
The term _______ is used to refer to a row.

A) Attribute

B) Tuple

C) Field

D) Instance

Answer:- B

AMCAT Computer Science Normalization,


Architecture, Indexing
Question 1:-
Recovery of a database system is done to preserve which of the following ACID
properties?

A) Isolation

B) Atomicity

C) Atomicity and Durability

D) Consistency and Atomicity

E) Atomicity, Durability and Consistency

Answer:- C

Question 2:-
Amit hs some knowledge about database normalisation.He has created a table "c
ustomer", which has the following characteristics.

19

Placement Classes
Telegram :- https://t.me/placementclasses

1)Table has transitive dependencies.

2)there are no partial dependencies in the table

3)There is no column with redundant data in the table In which normal form is the
table?

A) 1NF

B) 2NF

C) 3NF

D) BCNF

Answer:- B

Question 3:-
What does isolation in Acid rules for the transaction in database mean?

A) Either the effects of whole transaction is reflected on database or database is rolled back
to its original state

B) No transaction can interfere in the end result of another transaction

C) Effects of a successful transaction must persist in a database

D) Every individual transaction must leave database in a cosistent state. maintaining the
integrity of the database.

Answer:- B

Question 4:-
Amit hs some knowledge about database normalisation.He has created a table "c
ustomer", which has the following characteristics.

1)Table has transitive dependencies.

2)there are no partial dependencies in the table

3)There is no column with redundant data in the table In which normal form
is the table?

A) 1NF

B) 2NF

C) 3NF

20

Placement Classes
Telegram :- https://t.me/placementclasses

D) BCNF

Answer:- B

Question 5:-
What does isolation in Acid rules for transaction in database mean?

A) Either the effects of whole transaction is reflected on database or database is rolled back
to its original state

B) No transaction can interfere in the end result of another transaction

C) Effects of a successful transaction must persist in a database

D) Every individual transaction must leave database in a cosistent state. maintaining the
integrity of the database

Answer:- B

Question 6:-
What does isolation in Acid rules for transaction in database mean?

A) Either the effects of whole transaction is reflected on database or database is rolled back
to its original state

B) No transaction can interfere in the end result of another transaction

C) Effects of a successful transaction must persist in a database

D) Every individual transaction must leave database in a cosistent state .maintaining the
integrity of the database

Answer:- B

Question 7:-
Tables in second normal form (2NF):

A) Eliminate all hidden dependencies

B) Eliminate the possibility of a insertion anomalies

C) Have a composite key

D) Have all non key fields depend on the whole primary key

Answer:- A

Question 8:-
A BCNF is:

21

Placement Classes
Telegram :- https://t.me/placementclasses

A) Loss less join and dependency preserving

B) Loss less join and not dependency preserving

C) Not loss less join and dependency preserving

D) None of these

Answer:- B

Question 9:-
Which forms are based on the concept of functional dependency:

a)1NF

b) 2NF

c) 3NF

d) 4NF

A) 1NF

B) 2NF

C) 3NF

D) 4NF

Answer:- C

Question 10:-
Which of the following one is not true

A) A relation is in BCNF if it is 4NF

B) BCNF is stricter than 3NF

C) A relation is BCNF is ever determinant of a relation is candidate key

D) All of these

Answer:- D

AMCAT Computer Networks


Question 1:-

22

Placement Classes
Telegram :- https://t.me/placementclasses

Group A Group B

A. Physical Layer 1. Network security

B. Network Layer 2. Data transmission rate

C. Application Layer 3. Error detection and control

D. Data Link Layer 4. End to end transmission of packets

A A-2, B-1, C-4, D-3

B A-2, B-4, C-1, D-3

C A-3,B-1,C-4,D-2

D A-4. B-1, C-2, D-3

Answer:- D

Question 2:-
Which of the following condition is used to transmit two packets over a medium at
the same time?

A) Collision

B) Contention

C) Asynchronous

D) Synchronous

Answer:- A

Question 3:-
Which of the following method can't be used for data communication?

A) Simplex

B) Multiplex

C) Half Duplex

D) Full Duplex

Answer:- B

Question 4:-

23

Placement Classes
Telegram :- https://t.me/placementclasses

Which of the following is used for error detection in high level TCP/IP protocols?

A) Data Sum

B) Bit Sum

C) Check Sum

D) Error Sum

Answer:- C

Question 5:-
What is the default subnet mask for a class C network?

A) 127.0.0.1

B) 255.0.0.0

C) 255.255.0.0

D) 255.255.255.0

Answer:- D

Question 6:-
What is the maximum size of header of an IP?

A) 32

B) 54

C) 28

D) 60

Answer:- D

Question 7:-
A distributed network configuration in which all data/information pass through a
central computer is?

A) Bus network

B) Star network

C) Ring network

D) Point-to-point network

24

Placement Classes
Telegram :- https://t.me/placementclasses

Answer:- B

Question 8:-
Which of the following is not the Networking Devices?

A) Gateways

B) Linux

C) Routers

D) Firewalls

Answer:- B

AMCAT Computer Science OSI, TCP


/IP layers and protocols
Question 1:-
Which of the following statements is incorrect?

A) Bridge is a combination of hardware and software to link two similar network

B) Gateway is a combination of hardware and software to link two different types of


network.

C) Bridges are faster than Routers

D) Gateway operate at network and transport layer of the OSI model E Both B and C

Answer:- E

Question 2:-
Cooperating processes require an Interprocess Communication (IPC) mechanism t
hat will allow them to exchange data and information. Which of the following opti
ons is/are the method(s) of Interprocess Communication(IPC)?

A) Message passing

B) Cooperation

C) Shared memory

D) Both 2 and 3 E Both 1 and 3

25

Placement Classes
Telegram :- https://t.me/placementclasses

Answer:- E

Question 3:-
Gateway works in which layer?

A) Physical layer

B) Data Link Layer

C) Network layer

D) None

Answer:- C

Question 4:-
Bridge works in which layer?

A) Physical Layer

B) Data Link Layer

C) Network Layer

D) None

Answer:- B

Question 5:-
MAC Address is the example of?

A) Transport Layer

B) Data Link Layer

C) Application Layer

D) Physical Layer

Answer:- B

Question 6:-
What is the address size of IPv6 ?

A) 32 bit

B) 64 bit

C) 128 bit

26

Placement Classes
Telegram :- https://t.me/placementclasses

D) 256 bit

Answer:- C

Question 7:-
Repeater operates in which layer of the OSI model?

A) Physical layer

B) Data link layer

C) Network layer

D) Transport layer

Answer:- A

Question 8:-
Which layers of the OSI model are host-to-host layers? A. B. C. D.

A) Transport, Session, Presentation, Application

B) Network, Transport, Session, Presentation

C) Datalink, Network, Transport, Session

D) Physical, Datalink, Network, Transport

Answer:- A

Question 9:-
How many layers are in the TCP/IP model?

A) 4 layers

B) 5 layers

C) 6 layers

D) 7 layers

Answer:- A

Question 10:-
Which of the following IP address class is Multicast A. B.Class B C.Class C D.Class D
A) Class A

B) Class B

27

Placement Classes
Telegram :- https://t.me/placementclasses

C) Class C

D) Class D

Answer:- D

AMCAT Computer Science Network


Devices and Routing Algorithms
Question 1:-
Which of the following processes is used for sending data along with the acknowl-
edgement?

A) Automatic Repeat Request

B) Stop and Wait ARQ

C) Go-Backn ARQ

D) Piggybacking

Answer:- D

Question 2:-
Which of the following statements is true about bus topology?

A) It is a point to point configuration

B) It is not easy to reconfigure

C) If the backbone link is broken then the network is not incapacitated

D) It requires more cable as compared to mesh topology

Answer:- A & B

28

Placement Classes

You might also like