MCQs
Real time multimedia needs connectionless service, so under lying transport layer protocol
used is UDP
File transfer rums over TCP protocol with port no - 21
DNS runs over UDP protocol within port no - 53
Email needs SMTP protocol which runs over TCP protocol within port no - 25
Application
Transport Application
Network Transport
Datalink Network Network Network
Physical Datalink Datalink Datalink
source Physical Physical Physical
(5) R R Destination
(D)
From above given diagram, its early visible that packet will visit network layer 4 times, once
at each node [S, R, R, D] and packet will visit Data Link layer 6 times. One time at S and one
time at D, then two times for each intermediate router R as data link layer is used for link to
link communication.
Once at packet reaches R and goes up from physical - DL- Network and second time when
packet coming out of router in order Network - DL- Physical
X Y
X - public Y - public
X - private Y - private
Source has to encrypt with its private key for
forming Digital signature for Authentication
Encryption {source has to encrypt the (M,`sigma`) with Y ' s
public key to send it confidentially
Destination Y has to decrypt first
Decryption with its private key, then decrypt
usin g source public key
Clustered index is built on ordering non key field and hence if the index is clustered then the
data records of the file are organized in the same order as the data entries of the index.
Three concurrent processes X, Y, and Z execute three different code segments that access and
update certain shared variables. Process X executes the P operation (i.e., wait) on semaphores
a, b and c; process Y executes the P operation on semaphores b, c and d; process Z executes
the P operation on semaphores c, d, and a before entering the respective code segments. After
completing the execution of its code segment, each process invokes the V operation (i.e.,
signal)
on its three semaphores. All semaphores are binary semaphores initialized to one.
Which one of
the following represents a deadlock-free order of invoking the P operations by
the processes?
Suppose X performs P(b) and preempts, Y gets chance, but cannot do its first wait i.e., P(b),
so waits for X, now Z gets the chance and performs P(a) and preempts, next X gets chance.
X cannot continue as wait on 'a' is done by Z already, so X waits for Z. At this time Z cancontinue
its operations as down on c and d. Once Z finishes, X can do its operations and so Y.
In any of
execution order of X, Y, Z one process can continue and finish, such that waiting is
not circular.
In options (A),(C) and (D) we can easily find circular wait, thus deadlock
Bellman-ford time complexity: `Theta`(lVlxlEl)
For complete graph: l E l = `(n(n - 1))/2`
l V l = n
`:.` `Theta` (n x `(n( - 1))/2`) = `Theta` (`n^3`)
Which of the following statements is/are FALSE?
(1) For every non-deterministic Turing machine, there exists an equivalent deterministic
Turing machine.
(2) Turing recognizable languages are closed under union and complementation.
(3) Turing decidable languages are closed under intersection and complementation
(4) Turing recognizable languages are closed under union and intersection.
(1) NTM `cong` DTM
(2) RELs are closed under union & but not complementation
(3) Turing decidable languages are recursive and recursive languages are closed under
intersection and complementation
(4) RELs are closed under union & intersection but not under complementation
Which of the following statements are TRUE?
(1) The problem of determining whether there exists a cycle in an undirected graph is in P.
(2) The problem of determining whether there exists a cycle in an undirected graph is in NP.
(3) If a problem A is NP-Complete, there exists a non-deterministic polynomial time
algorithm to solve A
1. Cycle detection using DFS: O(V + E) = O(`V^ 2`) and it is polynomial problem
2. Every P-problem is NP (since P `subset` NP)
NP complete `in` NP
Hence, NP-complete can be solved in non-deterministic polynomial time
In a k-way set associative cache, the cache is divided into v sets, each of which consists of k
lines.
The lines of a set are placed in sequence one after another. The lines in set s are
sequenced before
the lines in set (s+1). The main memory blocks are numbered 0 onwards.
The main memory block
numbered j must be mapped to any one of the cache lines from
Position of main memory block in the cache (set) = (main memory block number) MOD
(number of sets in the cache).
As the lines in the set are placed in sequence, we can have the lines from 0 to (K – 1) in each
set.
Number of sets = v, main memory block number = j
First line of cache = (j mod v)*k; last line of cache = (j mod v)*k + (k – 1)