UGC NET computer science practice questions and answer

 UGC NET computer science

Practice questions and answers set-2


Q.1 A counting semaphore is initialized to 8. 3 wait() operations and 4 signal() operations are applied. Find the current value of semaphore variable.

(1) 9                (2) 5             (3) 1             (4) 4

Answer: 1

Solution:

wait() operation decrements the value of a semaphore.

signal() operation increments the value of a semaphore.

3 wait() implies -3 to value of semaphore.

4 signal() implies +4 to value of semaphore.

So, 8-3+4=9 is the value of semaphore after  3 wait() and 4 signal() operations.


Q.2 Which tag is used to enclose any number of javascript statements in HTML document?

(1) <code>      (2) <script>

(3) <title>        (4) <body>

Answer:2


Q.3 In which file the compiler manage the various objects, which are used in windows programming?

(1) Control File

(2) Binary File

(3) Text File

(4) Obj File

Answer: 4


Q.4 If the Disk head is located at track 32, find the number of disk moves required with FCFS scheduling criteria if the disk queue of I/O blocks requests are:

98, 37, 14, 124, 65, 67

(A) 320

(B) 322

(C) 321

(D) 319

Answer: (C)

Explanation: 

Total disk movement = 66 + 61 + 23 + 110 + 2 = 321.

So, option (C) is correct.


Q.5 Given memory partitions of 100 K, 500 K, 200 K, 300 K and 600 K (in order) and processes of 212 K, 417 K, 112 K, and 426 K (in order), using the first-fit algorithm, in which partition would the process requiring 426 K be placed?

(A) 500 K

(B) 200 K

(C) 300 K

(D) 600 K

Solution:

First-Fit:

212K is put in 500K partition.

417K is put in 600K partition.

112K is put in 288K partition (new partition 288K = 500K - 212K).

426K must wait.

Best-Fit:

212K is put in 300K partition.

417K is put in 500K partition.

112K is put in 200K partition.

426K is put in 600K partition.

Worst-Fit:

212K is put in 600K partition.

417K is put in 500K partition.

112K is put in 388K partition.

426K must wait.

In this example, Best-Fit turns out to be the best.


Q.6 In which tree, for every node the height of its left sub tree and right sub tree differ almost by one?

(A) Binary search tree

(B) AVL tree

(C) Threaded Binary Tree

(D) Complete Binary Tree

Answer: B


Q.7 Which API is used to draw a circle?

(A) Circle ( )

(B) Ellipse ( )

(C) Round Rect ( )

(D) Pie ( )

Answer: B


Q.8 RAD stands for ______.

(A) Rapid and Design

(B) Rapid Aided Development

(C) Rapid Application Development

(D) Rapid Application Design

Answer: C


Q.9 Given an empty stack, after performing push (1), push (2), Pop, push (3), push (4), Pop, Pop, push (5), pop, what is the value of the top of the stack?

(A) 4

(B) 3

(C) 2

(D) 1

Answer: (D)

Solution:

Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out).

Push: Adds an item to the stack. If the stack is full, then it is said to be an Overflow condition.

Pop: Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition.


Q.10 The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing data frame is known as

(A) Bit stuffing

(B) Piggy backing

(C) Pipelining

(D) Broadcasting

Answer: (B)

The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing data frame is known as piggybacking. The principal advantage of using piggybacking over having distinct acknowledgement frames is a better use of the available channel bandwidth.


Q.11 Match the following:

List – I                        List – II

a. Application layer     1. TCP

b. Transport layer        2. HDLC

c. Network layer         3. HTTP

d. Data link layer        4. BGP

Codes:

      a b c d

(A) 2 1 4 3

(B) 3 4 1 2

(C) 3 1 4 2

(D) 2 4 1 3

Answer: C


Q.12 Referential integrity is directly related to 

(A) Relation key

(B) Foreign key

(C) Primary key

(D) Candidate key

Answer: B


Q.13 A algorithm is guaranteed to find an optimal solution if 

  1. ) h' is always 0g

  2. ) is always 1

      (C )h' never overestimates h

      (D)h' never underestimates h

Answer: C


Q.14 Which of the following tasks is not done by data link layer?

A) framing

C) error control

C) flow control

D) channel coding

Answer: D

Explanation: 

Channel coding is the function of physical layer. Data link layer mainly deals with framing, error control and flow control. Data link layer is the layer where the packets are encapsulated into frames.


Q.15 CRC stands for __________

A) cyclic redundancy check

B) code repeat check

C) code redundancy check

 D) cyclic repeat check

Answer: A

Explanation: Cyclic redundancy check is a code that is added to a data which helps us to identify any error that occurred during the transmission of the data. CRC is only able to detect errors, not correct them. CRC is inserted in the frame trailer.


Popular posts from this blog

Create a XML file with Internal / External DTD and display it using a. CSS b. XSL

Indexing and slicing of arrays in python.

UGC NET Practice questions with Solutions