Computer Science Study Materials for Competitive Exams

Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Thursday, 21 January 2016

11.       A network with bandwidth of 10 Mbps can pass only an average of 15,000 frames per minute with each frame carrying an average of 8,000 bits. What is the throughput of this network ?
(A) 2 Mbps        (B) 60 Mbps
(C) 120 Mbps    (D) 10 Mbps
Answer: A
Explanation:
In data transmission, throughput is the amount of data moved successfully from one place to another in a given period of time, and typically measured in bits per second (bps), or in megabits per second (Mbps) or gigabits per second (Gbps).
Here, Throughput = 15000 x 8000/60 = 2 Mbps
12.       Consider a subnet with 720 routers. If a three-level hierarchy is choosen with eight clusters, each containing 9 regions of 10 routers, then total number of entries in the routing table is ...................
(A) 25                 (B) 27
(C) 53                 (D) 72
Answer: A
Explanation:
Each router needs 10 entries for local routers, 8 entries for routing to other regions within its own cluster, and 7 entries for distant clusters, for a total of 25 entries.
13.       In a classful addressing, the IP addresses with 0 (zero) as network number:
(A) refers to the current network
(B) refers to broadcast on the local network
(C) refers to broadcast on a distant network
(D) refers to loopback testing
Answer: A
14.       In electronic mail, which of the following protocols allows the transfer of multimedia
messages?
(A) IMAP            (B) SMTP
(C) POP 3         (D) MIME
Answer: D
15.       A device is sending out data at the rate of 2000 bps. How long does it take to send a file of 1,00,000 characters ?
(A) 50                 (B) 200
(C) 400              (D) 800
Answer: C
Explanation:
1,00,000 characters = 1,00,000 x 8 bits = 8,00,000 bits
8,00,000 bits/2000 bps = 400 seconds

16.       In Activity-Selection problem, each activity i has a start time si and a finish time fi where si≤fi. Activities i and j are compatible if:
(A) si≥fj                           (B) sj≥fi
(C) si≥fj or sj≥fi               (D) si≥fj and sj≥fi
Answer: C
17.       Given two sequences X and Y:
X = <a, b, c, b, d, a, b>
Y = <b, d, c, a, b, a>
The longest common subsequence of X and Y is:
(A) <b, c, a>                  (B) <c, a, b>
(C) <b, c, a, a> (D) <b, c, b, a>
Answer: D
Explanation:
A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
A sequence G is said to be a common subsequence of X and Y, if Z is a subsequence of both X and Y.
Here X = <a, b, c, b, d, a, b>, the sequences <b,c,a>, <c,a,b>, <b,c,b,a>  are subsequences of X.
Given a second sequence of symbols Y = <b, d, c, a, b, a>, then <b,c,a>, <c,a,b>, <b,c,b,a>  are common subsequences to both X and Y.
However, the longest common subsequence of X and Y is <b,c,b,a>.
18.       If there are n integers to sort, each integer has d digits and each digit is in the set {1,2, ..., k}, radix sort can sort the numbers in:
(A) O(d n k)                   (B) O(d nk)
(C) O((d+n)k)                (D) O(d(n+k))
Answer: D
19.       The solution of the recurrence relation
is :
(A) O(lg n)         (B) O(n)
(C) O(n lg n)     (D) None of the above
Answer: D
20.    Floyd-Warshall algorithm utilizes ............... to solve the all-pairs shortest paths problem on a directed graph in ................ time.
(A) Greedy algorithm, θ(V3)                (B) Greedy algorithm, θ(V2 lgn)
(C) Dynamic programming, θ(V3)     (D) Dynamic programming, θ(V2 lgn)
Answer: C


Wednesday, 20 January 2016

1.       The three outputs x1x2x3 from the 8x3 priority encoder are used to provide a vector address of the form 101x1x2x300. What is the second highest priority vector address in hexadecimal if the vector addresses are starting from the one with the highest priority?
(A) BC                (B) A4
(C) BD               (D) AC
Answer: B
2.       What will be the output at PORT1 if the following program is executed?
MVI B, 82H
MOV A, B
MOV C, A
MVI D, 37H
OUT PORT1
HLT
(A) 37H              (B) 82H
(C) B9H             (D) 00H
Answer: B
Explanation:
In 8085 programming, the result of an operation is stored in the accumulator.
So output is 82H.
3.       Which of the following 8085 microprocessor hardware interrupt has the lowest priority?
(A) RST 6.5                   (B) RST 7.5
(C) TRAP                      (D) INTR
Answer: D
4.       A dynamic RAM has refresh cycle of 32 times per msec. Each refresh operation requires 100 nsec and a memory cycle requires 250 nsec. What percentage of memory’s total operating time is required for refreshes?
(A) 0.64              (B) 0.96
(C) 2.00             (D) 0.32
Answer: D
Explanation:
in 1ms :  refresh = 32 times
Memory cycle = 1ms/250ns   = 106ns/250ns = 4000 times
Therefore, % of refresh time  = (32 x 100ns)/(4000 x 250ns)
                                                    = 3200ns/1000000 x 100% = 0.32%
5.       A DMA controller transfers 32-bit words to memory using cycle Stealing. The words are assembled from a device that transmits characters at a rate of 4800 characters per second. The CPU is fetching and executing instructions at an average rate of one million instructions per second. By how much will the CPU be slowed down because of the DMA transfer?
(A) 0.06%          (B) 0.12%
(C) 1.2%            (D) 2.5%
Answer: B
Explanation:
The DMA combines one word from four consecutive characters (bytes) so we get
4800 chars/s = 4800 bytes/s = 1200 words/s (one word = 32 bits = 4 bytes)

If we assume that one CPU instruction is one word wide then
1 million instructions/s = 1 million words/s = 106 word/s

So we have 1200 words received during one second and (106-1200) words processed by the CPU (while DMA is transferring a word, the CPU cannot fetch the instruction so we have to subtract the number of words transferred by DMA).
While DMA transfer CPU executes only 106 - 1200 = 998800 instructions
[998800 / 106] * 100 = 99.88 %
Slowdown = 100 - 99.88 = 0.12%

The CPU will be slowed down by 0.12%.

6.       A CPU handles interrupt by executing interrupt service subroutine.................
(A) by checking interrupt register after execution of each instruction
(B) by checking interrupt register at the end of the fetch cycle
(C) whenever an interrupt is registered
(D) by checking interrupt register at regular time interval
Answer: A
7.       Given the following set of prolog clauses:
father(X, Y):
parent(X, Y),
male(X),
parent(Sally, Bob),
parent(Jim, Bob),
parent(Alice, Jane),
parent(Thomas, Jane),
male(Bob),
male(Jim),
female(Salley),
female(Alice).
How many atoms are matched to the variable ‘X’ before the query
father(X, Jane) reports a Result?
(A) 1       (B) 2
(C) 3       (D) 4
Answer: A
8.       Forward chaining systems are ............. where as backward chaining systems are ................
(A) Data driven, Data driven              (B) Goal driven, Data driven
(C) Data driven, Goal driven              (D) Goal driven, Goal driven
Answer: C
9.       Match the following w.r.t. programming languages:
List - I                                     List – II
(a) JAVA                        (i) Dynamically object oriented
(b) Python                     (ii) Statically Non-object oriented
(c) Prolog                      (iii) Statically object oriented
(d) ADA                         (iv) Dynamically non-object oriented
Codes:
   (a)  (b)  (c)  (d)
(A) (iii)  (i)   (ii)  (iv)
(B) (i)   (iii)  (ii)  (iv)
(C) (i)   (iii)  (iv) (ii)
(D) (ii)  (iv)  (i)   (iii)
Answer: D
10.    The combination of an IP address and a port number is known as ...................
(A) network number                (B) socket address
(C) subnet mask number       (D) MAC address
Answer: B


Friday, 15 January 2016

41.       Loop unrolling is a code optimization technique:
(A) that avoids tests at every iteration of the loop
(B) that improves performance by decreasing the number of instructions in a basic block.
(C) that exchanges inner loops with outer loops
(D) that reorders operations to allow multiple computations to happen in parallel.
Answer: A
42.       What will be the hexadecimal value in the register ax (32-bit) after executing the following instructions?
Mov al, 15
Mov ah, 15
Xor al, al
Mov cl, 3
Shr ax, cl
Codes:
(A) 0F00 h         (B) 0F0F h
(C) 01E0 h        (D) FFFF h
Answer: C
43.       Which of the following statements is false?
(A) Top-down parsers are LL parsers where first L stands for left-to-right scan and second L stands for a leftmost derivation.
(B) (000)* is a regular expression that matches only strings containing an odd number of zeroes, including the empty string.
(C) Bottom-up parsers are in the LR family, where L stands for left-to-right scan and R stands for rightmost derivation
(D) The class of context-free languages is closed under reversal. That is, if L is any context-free language, then the language LR={WR:wϵL} is context free.
Answer: B
44.       System calls are usually invoked by using:
(A) A privileged instruction    (B) An indirect jump
(C) A software interrupt          (D) Polling
Answer: C
45.       The ............... transfers the executable image of a C++ program from hard disk to main memory.
(A) Compiler     (B) Linker
(C) Debugger   (D) Loader
Answer: D

46.       In software testing, how the error, fault and failure are related to each other?
(A) Error leads to failure but fault is not related to error and failure
(B) Fault leads to failure but error is not related to fault and failure
(C) Error leads to fault and fault leads to failure
(D) Fault leads to error and error leads to failure
Answer: C
47.       Which of the following is not a software process model?
(A) Prototyping             (B) Iterative
(C) Timeboxing                        (D) Glassboxing
Answer: D
48.       How many solutions are there for the equation x+y+z+u=29 subject to the constraints that x≥1, y≥2, z≥3 and u≥0?
(A) 4960                        (B) 2600
(C) 23751          (D) 8855
Answer: B
Explanation:
We let y1=x-1, y2=y-2, y3=z-3, y4=u-0
We count the number of solutions for y1+y2+y3+y4=29-6=23
n=4, r=23
The number of solutions is C(n+r-1, r) = C(4+23-1, 23)
                = C(26,23) = C(26,3) = 26x25x24/1x2x3 = 2600
49.       A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each?
(A) 32 GB          (B) 64 GB
(C) 16 GB          (D) 1 GB
Answer: C
Explanation:
block = 210
block pointer size = 4B
entries possible in block = 210/22 = 256
direct pointer gives = 10 * 256 = 10 blocks
single indirect gives = 256 * 256 = 28 blocks
double indirect gives = 256 * 256 * 256 = 216 blocks
triple indirect gives = 256 * 256 * 256 * 256 = 224 blocks
total = 10 blocks + 28 blocks + 216 blocks + 224 blocks
= 16843018 blocks = 16843018 * 1024 = 17247250432 ≈ 16 GB
50.    ................. uses electronic means to transfer funds directly from one account to another rather than by cheque or cash?
(A) M-Banking              (B) E-Banking
(C) O-Banking              (D) C-Banking
Answer: B