Previous Year Paper

UGC NET Paper 2: Computer Science 24th June 2019 (Previous Year Paper)

Held in 2019

100 questions120 minutes
With answers
Free

Paper last updated:

Practise under exam conditions

Take this paper as a timed mock test. Review your answers after you submit.

Attempt timed test

Questions & answers

Read the paper at your pace. Open an explanation when you need it.

Computer Science (100 questions)

Question 1

Replacing the expression 4*2.14 by 8.56 is known as

  1. AOption (a)

    Constant folding

  2. BOption (b)

    Induction variable

  3. COption (c)

    Strength reduction

  4. DOption (d)

    Code reduction

View answer & explanation

Correct answer

Answer: (a)A.

Constant folding

Why this answer is correct

Concepts:

Constant folding is compiler optimizations technique used by many modern compilers.

Constant folding is the process of recognizing and evaluating constant expressions at compile time rather than computing them at runtime.

Example:

int var = 4*2.14;

Replace with

int var = 8.56

Since multiplication is costly operation, it has been replaced constant which is more optimized version of previous code

Question 2

Match List-I with List-II

List-IList-II
(a) p → q(i) ¬(q → ¬p)
(b) p v q(ii) p ∧ ¬q
(c) p ∧ q(iii) ¬p → q
(d) ¬(p → q)(iv) ¬p v q

 

Choose the correct option from those given below:

  1. AOption (a)

    (a)-(ii);(b)-(iii);(c)-(i);(d)-(iv)

  2. BOption (b)

    (a)-(ii);(b)-(i);(c)-(iii);(d)-(iv)

  3. COption (c)

    (a)-(iv);(b)-(i);(c)-(iii);(d)-(ii)

  4. DOption (d)

    (a)-(iv);(b)-(iii);(c)-(i);(d)-(ii)

View answer & explanation

Correct answer

Answer: (d)D.

(a)-(iv);(b)-(iii);(c)-(i);(d)-(ii)

Why this answer is correct

p → q ≡ ¬ p ∨ q

∴ (a) → (iv)

¬ (q → ¬p) ≡ ¬ (¬ q ∨ ¬ p) ≡ p ∧ q

∴ (c) → (i)

¬p → q ≡ ¬ (¬ p) ∨ q ≡ p ∨ q

∴ (b) → (iii)

¬ (p → q) ≡ ¬ (¬ p ∨ q) ≡ p ∧ ¬ q

∴ (d) → (ii)

Therefore option 4 is correct

Alternate method:

Truth Table:

pq¬ p¬ qp → qp ∨ qp ∧ q¬ (p → q)¬ (q → ¬ p)p ∧ ¬q¬ p → q¬ p ∨ q
TTFFTTTFTFTT
TFFTFTFTFTTF
FTTFTTFFFFTT
FFTTTFFFFFFT

 

From truth table:

p → q ≡ ¬ p ∨ q

∴ (a) → (iv)

p → q ≡ ¬ p ∨ q

∴ (a) → (iv)

p ∨ q ≡ ¬p → q

∴ (b) → (iii)

p ∧ q ≡ ¬ (q → ¬p) 

∴ (c) → (i)

¬ (p → q) ≡ p ∧ ¬ q

∴ (d) → (ii)

Therefore option 4 is correct

Question 3

Which data structure is used by the compiler for managing variables and their attributes?

  1. AOption (a)

    Binary tree

  2. BOption (b)

    link list

  3. COption (c)

    Symbol table

  4. DOption (d)

    Parse table

View answer & explanation

Correct answer

Answer: (c)C.

Symbol table

Why this answer is correct

Symbol tables are data structures that are used by compilers to hold information about source-program constructs.

The information is collected incrementally by the analysis phases of a compiler and used by the synthesis phases to generate the target code.

Entries in the symbol table contains information about an identifier (variables) such as its character string (or lexeme), its type, its position in storage, and any other relevant information.

Question 4

Consider the equation (146)b​ + (313)​b-2​ = (246)8. Which of the following is the value of b?

  1. AOption (a)

    8

  2. BOption (b)

    7

  3. COption (c)

    10

  4. DOption (d)

    16

View answer & explanation

Correct answer

Answer: (b)B.

7

Why this answer is correct

(146)b + (313)b-2 = (246)8

b2 + 4b + 6 + 3(b-2)2 + (b-2) + 3 = 2× 82 + 4×8 + 6

4b2 – 7b + 19 = 166

 4b2 – 7b – 147 = 0

4b2 – 28b + 21b – 147 = 0

4b(b –  7) + 21(b – 7) = 0

(b – 7).(4b + 21) = 0

∴ b = 7 or b = -21 ÷ 4

Since b cannot be negative or in fraction

∴ b = 7

Alternate Method:

Substitute and check the result

b = 7

(146)7 + (313)7-2 = (246)8

LHS = (146)7 + (317)7-2

 (146)7 = 1 × 72 + 4 ×71 + 6 × 70 = 49 + 28 + 6 = (83)10

(313)5 = 3 × 52 + 1 × 5 + 7× 50 = 75 + 5 + 3 = (83)10

LHS = (83)10 + (83)10 = (166)10  

RHS = (246)8

= 2 × 82 + 4 ×81 + 6 × 80

= 128 + 32 + 6 = (166)10  

LHS = RHS equal only if b is 7.

Question 5

How many different Boolean functions of degree n are there?

  1. AOption (a)

    22n{{2}^{{{2}^{n}}}}

  2. BOption (b)

    (22)2

  3. COption (c)

    22n−1{{2}^{{{2}^{n}}}}-1

  4. DOption (d)

    2n

View answer & explanation

Correct answer

Answer: (a)A.

22n{{2}^{{{2}^{n}}}}

Why this answer is correct

Concepts:

Degree of Boolean function = number variables = n

Variable is of Boolean type

Sequence possible of two Boolean= 2n

Different Boolean function = 22n{{2}^{{{2}^{n}}}}

Example:

By taking n = 2

Different Boolean function = 22n=222=16{{2}^{{{2}^{n}}}}={{2}^{2}}^{2}=16

Therefore 16 Boolean function is possible.

Question 6

Match List-I with List-II

List – IList – II
(a) Disk(i) Thread
(b) CPU(ii) Signal
(c) Memory(iii) File System
(d) Interrupt(iv) Virtual address

 

Choose the correct option from those given below:

  1. AOption (a)

    (a)-(i); (b)-(ii); (c)-(iii); (d)-(iv)

  2. BOption (b)

    (a)-(iii); (b)-(i); (c)-(iv); (d)-(ii)

  3. COption (c)

    (a)-(ii); (b)-(i); (c)-(iv); (d)-(iii)

  4. DOption (d)

    (a)-(ii); (b)-(iv); (c)-(iii);(d)-(i)

View answer & explanation

Correct answer

Answer: (b)B.

(a)-(iii); (b)-(i); (c)-(iv); (d)-(ii)

Why this answer is correct

Concept:

  • File system is the part of the operating system which is responsible for file management. It provides a mechanism to store the data and access to the file contents including data and programs.  The File system takes care of the following issues: File Structure, Recovering Free space, Disk space assignment to the files and Tracking data location.
  • Threads refer to the highest level of code executed by a processor, so with many threads, your CPU can handle several tasks at the same time. All CPUs have active threads, and every process performed on your computer has at least a single thread.
  • A virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process.
  • an interrupt is an input signal to the processor indicating an event that needs immediate attention. An interrupt signal alerts the processor and serves as a request for the processor to interrupt the currently executing code, so that the event can be processed in a timely manner.

Conclusion:

Disk → File system, CPU → Thread, memory → Virtual address space and Interrupt → Signal

Therefore option 2 is correct

Question 7

In the TCP/IP model, encryption and decryption are functions of ____ layer

  1. AOption (a)

    data link

  2. BOption (b)

    network

  3. COption (c)

    Transport

  4. DOption (d)

    Application

View answer & explanation

Correct answer

Answer: (d)D.

Application

Why this answer is correct

TCP/IP model, RFC 1122

LayersFunctions
Application layerAuthentication, Authorization, Encryption, Decryption etc.
Transport layerEnd to end connectivity, Segmentation, Multiplexing demultiplexing, Congestion control etc.
Internet layerHost to host connectivity, Fragmentation etc.
Link layer (data link)Flow control, Framing etc.

 

Therefore option 4 is correct.

Question 8

Suppose that a connected planar graph has six vertices, each of degrees four. Into how many regions is the plane divided by a planar representation of this graph?

  1. AOption (a)

    6

  2. BOption (b)

    8

  3. COption (c)

    12

  4. DOption (d)

    10

View answer & explanation

Correct answer

Answer: (b)B.

8

Why this answer is correct

Data:

vertices = v = 6

degree of each vertices = d = 4

Formula:

Handshaking Lemma:

\(\underset{\text{i}=1}{\overset{\text{n}}{\mathop \sum }},\text{di}=2\text{e}\)

Euler’s formula:

v – e + f = 2.

Calculation:

2e = 6 × 4    (Handshaking Lemma)

∴ e = 12

f = e – v +2

f = 12 – 6 + 2

∴ f = 8

The plane is divided in 8 regions or faces.

Question 9

Match List-I with List-II:

List-I (Software process Models)List-II (Software System)
(a) Waterfall model(i) e-business that starts with only the basic functionality and then moves on to more advanced features.
(b) Incremental development(ii) An inventory control system for a supermarket to be developed in a highway
(c) Prototyping(iii) A virtual reality system for simulating vehicle navigation in a highway.
(d) RAD(iv) Automate the manual system for student record maintenance in a school

 

Choose the correct option from those given below:

  1. AOption (a)

    (a)-(ii), (b)-(iv), (c)-(i), (d)-(iii)

  2. BOption (b)

    (a)-(i), (b)-(iii), (c)-(iv), (d)-(ii)

  3. COption (c)

    (a)-(iii), (b)-(ii), (c)-(iv), (d)-(i)

  4. DOption (d)

    (a)-(iv), (b)-(i), (c)-(iii), (d)-(ii)

View answer & explanation

Correct answer

Answer: (d)D.

(a)-(iv), (b)-(i), (c)-(iii), (d)-(ii)

Why this answer is correct

  • Waterfall model→ Automate the manual system for student record maintenance in a school
  • Incremental development→ E-business that starts with only the basic functionality and then moves on to more advanced features.
  • Prototyping→ A virtual reality system for simulating vehicle navigation in a highway.
  • RAD→ An inventory control system for a supermarket to be developed in a highway

Hence option 4 is correct

Question 10

Consider a disk system with 100 cylinders. The requests to access the cylinders occur in the following sequence:

4, 34, 10, 7, 19, 73, 2, 15, 6, 20

Assuming that the head is current at cylinder 50, what is the time taken to satisfy all requests if it takes 1ms to move from the cylinder to adjacent one and the shortest seek time first policy is used?

  1. AOption (a)

    357 ms

  2. BOption (b)

    238 ms

  3. COption (c)

    276 ms

  4. DOption (d)

    119 ms

View answer & explanation

Correct answer

Answer: (d)D.

119 ms

Why this answer is correct

Concepts:

Sequence: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20

Algorithm: shortest seek time first

Arrange in ascending order: 2, 4, 6, 7, 10, 15, 19, 20, 34, 73

Head is at cylinder: 50

Time taken to move to adjacent cylinder = 1ms

Diagram:

Calculation:

Total Head movements= (50 - 34) + (34 - 20) + (20 - 19) + (19 - 15) + (15 - 10) + (10 - 7) + (7 - 6) + (6 - 4) + (4 - 2) +

Total Head movements to serve all request = 16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71 = 119

The time taken to satisfy all requests = 119 × 1 ms = 119 ms

Tips and Tricks:

Since the direction changes only once:

Total Head movements to serve all request = (50 – 2) + (73 – 2) = 119

Question 11

Consider Euler's Φ function given by Φ(n) = nπp|n(1 - (1/p))

where p runs over all the primes dividing n. What is the value of Φ(45)?

  1. AOption (a)

    3

  2. BOption (b)

    12

  3. COption (c)

    6

  4. DOption (d)

    24

View answer & explanation

Correct answer

Answer: (d)D.

24

Why this answer is correct

Formula:

If p is prime, then Φ(p) = (p - 1)

If p is a prime and it's power is k then

ϕ(pk)=pk(1−1p)\phi \left( {{\text{p}}^{\text{k}}} \right)={{\text{p}}^{\text{k}}}\left( 1-\frac{1}{\text{p}} \right)

Calculation:

Φ(45) = Φ(9 × 5)

= Φ(32) × Φ(5)

=32(1−13)×(5−1)={{3}^{2}}\left( 1-\frac{1}{3} \right)\times \left( 5-1 \right)

= 6 × 4 = 24

the value of Φ(45) is 24

Question 12

Which of the following statements are DML statements?

(a) Update [tablename] Set [columnname] = VALUE

(b) Delete [tablename]

(c) Select * from [tablename]

  1. AOption (a)

    (a) and (b)

  2. BOption (b)

    (a) and (c)

  3. COption (c)

    (a), (b) and (c)

  4. DOption (d)

    (b) and (c)

View answer & explanation

Correct answer

Answer: (c)C.

(a), (b) and (c)

Why this answer is correct

  • A data-manipulation language (DML) is a language that enables users to access or manipulate data as organized by the appropriate model.

Example of DML commands: SELECT, INSERT, DELETE, UPDATE etc.

Therefore a, b and c are DML statements.

  • A database system provides a data-definition language (DDL) to specify the database schema

Example of DDL commands: CREATE, DROP, ALTER, RENAME, TRUNCATE etc.

  • A data control language (DCL) is used to control access (Authorization) to data stored in a database

Example of DCL commands: GRANT and REVOKE

Question 13

Which of the following is principal conjunctive normal form for [(p V q) ∧ ¬ p → ¬ q]?

  1. AOption (a)

    p V ¬ q

  2. BOption (b)

    p V q

  3. COption (c)

    ¬ p V q

  4. DOption (d)

    ¬ p V ¬ q

View answer & explanation

Correct answer

Answer: (a)A.

p V ¬ q

Why this answer is correct

Since p → q = ¬ p ∨ q ≡ p̅ + q

(p V q) ∧ ¬ p → ¬ q

≡(p+q).pˉ‾+qˉ\equiv \overline{\left( p+q \right).\bar{p}}+\bar{q}

≡ppˉ+pˉq‾+qˉ\equiv \overline{p\bar{p}+\bar{p}q}+\bar{q}

≡ p + q̅ + q̅

≡ p + q̅

≡ p ∨ ¬ q

∴ option 1 is correct

Alternate Method:

Truth Table:

pq¬ p¬ qp V q(p V q) ∧ ¬ p(p V q) ∧ ¬ p → ¬ qp V ¬ q
TTFFTFTT
TFFTTFTT
FTTFTTFF
FFTTFFTT

 

From truth table:

(p V q) ∧ ¬ p → ¬ q ≡ p V ¬ q

Question 14

What percentage (%) of the IPv4, IP address space do all class C addresses consume?

  1. AOption (a)

    12.5%

  2. BOption (b)

    25%

  3. COption (c)

    37.5%

  4. DOption (d)

    50%

View answer & explanation

Correct answer

Answer: (a)A.

12.5%

Why this answer is correct

IPv4 address size = 32 bit

Number of IP address possible = 232

Class of IP addressBit reserved for last byteTotal IP address possiblePercentage
Class A1 bit231231232×100=50%\frac{{{2}^{31}}}{{{2}^{32}}}\times 100=50\%
Class B2 bits230230232×100=25%\frac{{{2}^{30}}}{{{2}^{32}}}\times 100=25\%
Class C3 bits229229232×100=12.5%\frac{{{2}^{29}}}{{{2}^{32}}}\times 100=12.5\%
Class D4 bits228228232×100=6.25%\frac{{{2}^{28}}}{{{2}^{32}}}\times 100=6.25\%
Class E4 bits228228232×100=6.25%\frac{{{2}^{28}}}{{{2}^{32}}}\times 100=6.25\%

 

Therefore, Class C address consumes 12.5% of the IPv4 address

Question 15

How many are there to place 8 indistinguishable balls into four distinguishable bins?

  1. AOption (a)

    70

  2. BOption (b)

    165

  3. COption (c)

    8C4

  4. DOption (d)

    8P4

View answer & explanation

Correct answer

Answer: (b)B.

165

Why this answer is correct

Data:

x1 + x2 + x3 + x4 = 8

∴ n = 4 and r = 8

Formula:

Number of ways to place 8 indistinguishable balls in 4 distinguishable bins = n + r - 1 C8

Calculation:

Number of ways to place 8 indistinguishable balls in 4 distinguishable bins = 4 + 8 - 1 C8 = 11C8

=11!8!×(11 − 8!)=11×10×93!=165=\frac{11!}{8!\times \left( 11~-~8! \right)}=\frac{11\times 10\times 9}{3!}=165

∴ option 2 is correct

Question 16

A computer has six tapes drives with n processes competing for them. Each process may need two drives. What is the maximum value of n for the system to be deadlock free?

  1. AOption (a)

    5

  2. BOption (b)

    4

  3. COption (c)

    3

  4. DOption (d)

    6

View answer & explanation

Correct answer

Answer: (a)A.

5

Why this answer is correct

Data:

Available Resources = R = 6 tapes drives

Max need per process = 2 tapes drives

Concepts:

Deadlock can occur If any process gets available resource < needed (requested) resource

Max resource per process to be in deadlock = needed – 1 = 2 – 1 = 1

For n process, max resource to be in deadlock = n× (2 - 1) = n

If one resource (tape drive) is added, any of the 6 processes can take it a finish its execution leaving behind the allocated resource and hence the system will be deadlock free.

Calculation:

For n process, min resource for the system not to be in deadlock state = n + 1 ≤ R

n + 1 ≤ 6

∴ nmax = 5

Tips and Tricks:

n × (m - 1) + 1 ≤ R

where n is the number of processes

m is the maximum resource need per process

R is the available system resources.

Question 17

Which of the following key constraints is required for functioning of foreign key in the context of relational database?

  1. AOption (a)

    Unique key

  2. BOption (b)

    Primary key

  3. COption (c)

    candidate key

  4. DOption (d)

    Check key

View answer & explanation

Correct answer

Answer: (b)B.

Primary key

Why this answer is correct

  • A foreign key means that values in one table must also appear in another table. The referenced table is called the parent table while the table with the foreign key is called the child table. The foreign key in the child table will generally reference a primary key in the parent table.
  • A unique key is a set of one or more than one fields of a table that uniquely identify a record in a database table. Unique key can accept null values and there may be many unique key constraints for one table.
  • A primary key is a specific choice of a minimal set of attributes (columns) that uniquely specify a tuple (row) in a relation (table). Primary key cannot accept null values and there can be only one primary key constraint for one table.
  • A candidate key is a column, or set of columns, in a table that can uniquely identify any database record without referring to any other data. Each table may have one or more candidate keys, but one candidate key is unique, and it is called the primary key.
  • The check constraint is used to limit the value range that can be placed in a column.

 

Since primary key is minimal set in relation having unique values with no null value. Therefore, foreign key of one relation referred to primary key of another relation.

Question 18

At a particular time of computation, the value of a counting semaphore is 7. Then 20 P(wait) operations and 15 V(signal) operations are completed on this semaphore. What is the resulting value of the semaphore?

  1. AOption (a)

    28

  2. BOption (b)

    12

  3. COption (c)

    2

  4. DOption (d)

    42

View answer & explanation

Correct answer

Answer: (c)C.

2

Why this answer is correct

Concepts:

V(S): Signal operation will increment the semaphore variable, that is, S++.

P(S): Wait operation will decrement the semaphore variable., that is, S--.

Data:

Initial counting semaphore = I = 7

Wait operation = 20 P

Signal operation = 15 V

Final counting semaphore = F

Formula:

F = I + 15V + 20P

Calculation:

F = 7 + 15(+1) + 20(-1)

∴ F = 2

the resulting value of the semaphore is 2

Question 19

A fully connected network topology is a topology in which there is a direct link between all pairs of nodes. Given a fully connected network with n nodes, the number of direct links as a function of n can be expressed as

  1. AOption (a)

    n(n+1)/2

  2. BOption (b)

    (n+1)/2

  3. COption (c)

    n/2

  4. DOption (d)

    n(n-1)/2

View answer & explanation

Correct answer

Answer: (d)D.

n(n-1)/2

Why this answer is correct

Concepts:

  • In a full connected network topology, every device has a dedicated point-to-point link to every other device.The term dedicated means that the link carries traffic only between the two devices it connects.
  • In a fully connected network network with n nodes, first, consider that each node must be connected to every other node. Node 1 must be connected to n - 1 node, node 2 must be connected to n - 2 (since 1 link is already included in the 1st case) nodes, and so on.
  • In mess topology, devices are full connected. Therefore, it will require (n × (n - 1)) ÷ 2) physical links.

Example: n = 6

The number of direct links = n(n−1)2=15\frac{{n\left( {n - 1} \right)}}{2} = 15

Question 20

Consider that a process has been allocated 3 frames and has a sequence of page referencing 1,2,1,3,7,4,5,6,3,1. What shall be the difference in page faults for the above string using the algorithm of LRU and Optimal page replacement for referencing the string?

  1. AOption (a)

    2

  2. BOption (b)

    0

  3. COption (c)

    1

  4. DOption (d)

    3

View answer & explanation

Correct answer

Answer: (a)A.

2

Why this answer is correct

Page reference: 1,2,1,3,7,4,5,6,3,1

Page replacement algorithm: Least Recently used (LRU)

page references1213745631
Frames1122137456
211374563
3745631
Page statusMMHMMMMMMM

 

LRU = 9 miss = 9-page faults

Page reference: 1,2,1,3,7,4,5,6,3,1

Page replacement algorithm: Optimal

page references1213745631
Frames1111111411
222745666
3333333
Page statusMMHMMMMMHH

 

Optimal = 7 miss = 7-page faults

LRU – optimal = 9 – 7 = 2

The difference in page faults for the above string using the algorithm of LRU and Optimal page replacement for referencing the string is 2.

Question 21

A processor can support a maximum memory of 4 GB where memory is word addressable and a word is 2 bytes. What will be the size of the address bus of the processor?

  1. AOption (a)

    At least 28 bits

  2. BOption (b)

    At least 2 bytes

  3. COption (c)

    At least 31 bits

  4. DOption (d)

    Minimum 4 bytes

View answer & explanation

Correct answer

Answer: (c)C.

At least 31 bits

Why this answer is correct

1 word = 2 bytes

Maximum Memory = 4GB = 232 bytes = 231 × 2 bytes

Maximum Memory = 231 word

Important Points:

1 G = 230

Question 22

Which of the following are not shared by the threads of the same process?

(a) Stack

(b) Registers

(c) Address Space

(d) Message Queue

  1. AOption (a)

    (a) and (d)

  2. BOption (b)

    (b) and (c)

  3. COption (c)

    (a) and (b)

  4. DOption (d)

    (a), (b) and (c)

View answer & explanation

Correct answer

Answer: (c)C.

(a) and (b)

Why this answer is correct

  • A thread is a lightweight process that can be managed independently by a scheduler.
  • A message queue is a linked list of messages stored within the kernel and identified by a message queue identifier.
  • Threads share the code and data segments and the heap, but they don't share the stack and registers. Message queue comes under data and therefore it is shared by thread.
  • Threads of the same process don’t share stack and register, hence option 3 is correct

Question 23

Consider three intensive processes, which requires 10,20 and 30 units of time and arrive at times 0,2 and 6 respectively. how many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.

  1. AOption (a)

    4

  2. BOption (b)

    2

  3. COption (c)

    3

  4. DOption (d)

    1

View answer & explanation

Correct answer

Answer: (b)B.

2

Why this answer is correct

Scheduling Algorithm:

shortest remaining time first

Gantt chart:

P1P2P3

0               10               30               60

Process table:

Process IdArrival Time (AT)Burst Time (BT)Completion Time (CT)
101010
222030
363060

 

Number of context switches = 2

Important Points:

context switches at time zero and at the end is not considered

Question 24

How many address lines and data lines are required to provide a memory capacity of 16K x 16?

  1. AOption (a)

    10, 4

  2. BOption (b)

    16, 16

  3. COption (c)

    14, 16

  4. DOption (d)

    4, 16

View answer & explanation

Correct answer

Answer: (c)C.

14, 16

Why this answer is correct

Memory capacity =16K × 16 = 214 × 24

Memory Capacity is of the form = 2m × 2n

Address lines required = m = 14

Data Lines required = 2n = 16

Option 3 is correct

Question 25

Consider the following two statements with respect to IPv4 in computer networking:

P: The loopback(IP) address is a member of class B network

Q: The loopback(IP) address is used to send a packet from host to itself

What can you say about the statements P and Q?

  1. AOption (a)

    P-True: Q-False

  2. BOption (b)

    P-False; Q-True

  3. COption (c)

    P-True; Q-True

  4. DOption (d)

    P-False; Q-false

View answer & explanation

Correct answer

Answer: (b)B.

P-False; Q-True

Why this answer is correct

IPv4 address: 32 bits

IP address = Network ID + Host ID

Network ID + Host ID =32

PREFIX is the part of the Network ID

ClassPREFIX (bits reserved from 1st byte)Network ID (bits)Range of 1st byteNo. of IP address consumedNumber of networksIP address per networkHost per networkPercentage of IPV4 address consumed​
Class A080 -12723127224224 – 250%
Class B1016128-191230214216216 – 225%
Class C11024192 -2232292212828 – 212.5%
Class D1110-224- 239228MULTICAST ADDRESS6.25%
Class E1111-240-255228RESERVED FOR FUTURE6.25%

 

The address between the range 127. 0. 0. 0 to 127.255.255.255 (exclude 127. 0. 0. 0 and 127.255.255.255) can be used as a loopback address that falls in the range of Class A network. Therefore, the loopback (IP) address is a member of class A network. Therefore, statement P is false.

A loopback address is primarily used to validate that the locally connected physical network card is working properly and the TCP/IP stack installed. A data packet sent on a loopback address, never leaves the host system and is sent back to the source application (to itself). Therefore, statement Q is true.

Hence option 2 is correct

Question 26

Which of the following has the same expressive power with regard to relational query language?

(a) Relational algebra and Domain relational calculus

(b) Relational algebra and Tuple relational calculus

(c) Relational algebra and Domain relational calculus restricted to safe expression

(d) Relational algebra and Tuple relational calculus restricted to safe expression

  1. AOption (a)

    (a) and (b) only

  2. BOption (b)

    (c) and (d) only

  3. COption (c)

    (a) and (c) only

  4. DOption (d)

    (b) and (d) only

View answer & explanation

Correct answer

Answer: (b)B.

(c) and (d) only

Why this answer is correct

  • Relational algebra is a procedural query language, which takes instances of relations as input and yields instances of relations as output. It uses operators (selection, projection, union etc) to perform queries.
  • Relational calculus consists of two calculi, the tuple relational calculus and the domain relational calculus, that are part of the relational model for databases and provide a declarative way to specify database queries
  • Relational algebra, Domain relational calculus restricted to safe expression and Tuple relational calculus restricted to safe expression have the same expressive power.
<br>

Confusion Points:

Relation algebra’s expressive power is not equal to Domain relational calculus or Tuple relational calculus unless they are restricted to safe operation.

Question 27

What will be the number of states when a MOD-2 counter is followed by a MOD-5 counter?

  1. AOption (a)

    5

  2. BOption (b)

    10

  3. COption (c)

    15

  4. DOption (d)

    20

View answer & explanation

Correct answer

Answer: (b)B.

10

Why this answer is correct

  • MOD-2 counter followed by MOD-5 it denotes cascading of two counters. Therefore, equivalent counter = MOD (2 × 5) counter = MOD-10 counter
  • MOD-10 counter is also called as BCD counter or Decade counter with ten states in its sequence.
  • Hence the number of states when a MOD-2 counter is followed by a MOD-5 counter is 10

Question 28

What is the name of the protocol that allows a client to send a broadcast message with its MAC address and receive an IP address in reply?

  1. AOption (a)

    ARP

  2. BOption (b)

    DNS

  3. COption (c)

    RARP

  4. DOption (d)

    ICMP

View answer & explanation

Correct answer

Answer: (c)C.

RARP

Why this answer is correct

  • The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP), specifically IPv4, to map IP network addresses to the hardware addresses used by a data link protocol, that is, MAC address.
  • DNS is a host name to IP address translation service. DNS is a distributed database implemented in a hierarchy of name servers. It is an application layer protocol for message exchange between clients and servers.
  • The Reverse Address Resolution Protocol (RARP) is a computer networking protocol used by a client computer to request its Internet Protocol (IPv4) address from a computer network, when all it has available is its link layer or hardware address, such as a MAC address. RARP protocol broadcast message with its MAC address and receive an IP address in reply.
  • The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another Host IP address.

Question 29

Following table has two attributes Employee_ID and Manager_id, where Employee_id is a primary key and Manager_id is a foreign key referencing Employee_id with on-delete cascade:

Employee_idManager_id
2040
2540
3035
3520
4045
4525

 

On deleting the table (20,40), the set of other tuples that must be deleted to maintain the referential integrity of table is

  1. AOption (a)

    (30,35) only

  2. BOption (b)

    (30,35) and (35,20) only

  3. COption (c)

    (35,20) only

  4. DOption (d)

    (40,45) and (25,40) only

View answer & explanation

Correct answer

Answer: (b)B.

(30,35) and (35,20) only

Why this answer is correct

Manager_id is foreign Key referring to Employee_ id (primary key) of the same table

Employee_idManager_id
20 (Deleted 1)40 (Deleted 1)
2540
30 (Deleted 3)35 (Deleted 3)
35 (Deleted 2)20(Deleted 2)
4045
4525

 

(20,40) is deleted, that is, Employee_id = 20 is deleted

Therefore Manager_id = 20 should be deleted to maintain the referential integrity of table.

If Manager_id = 20 row is deleted, then Employee_id = 35 is also deleted

Therefore Manager_id = 35 should also be deleted to maintain the referential integrity of table.

If Manager_id = 35 row is deleted, then Employee_id = 30 is also deleted

Since If Manager_id ≠ 35 we stop here

Table after deletion:

Employee_idManager_id
2540
4045
4525

 

Apart from (20,40), (30,35) and (35,20) also gets deleted to maintain the referential integrity of table.

Hence correct option is 2.

Question 30

In the context of 3D computer graphics, which of the following statements is/are TRUE?

P: Orthographic transformations keep parallel lines parallel

Q: Orthographic transformations are affine transformations

Select the correct answer from the options given below:

  1. AOption (a)

    Both P and Q

  2. BOption (b)

    Neither P nor Q

  3. COption (c)

    Only P

  4. DOption (d)

    Only Q

View answer & explanation

Correct answer

Answer: (a)A.

Both P and Q

Why this answer is correct

Concept:

Orthographic projection: In orthographic projection, direction of projection is normal to the plane of projection.

Explanation:

Statement P:

Orthographic projection is a type of parallel projection. Parallel projection preserves the parallel lines. While in case of another parallel projection i.e. perspective projection, parallel lines are skewed towards vanishing points.

Statement Q:

Affine transformation is a method for line preserving or mapping. In this also, parallel remains parallel after transformation. In orthogonal projection, all projection lines are perpendicular to the projection plane due to which it appears an affine transformation. So, we can say that orthographic transformations are affine transformation.

Question 31

Software Reuse is

  1. AOption (a)

    The process of analyzing software with the objective of recovering its design and specification

  2. BOption (b)

    The process of existing software artifacts and knowledge to build new software

  3. COption (c)

    Concerned with reimplementing legacy system to make them more maintainable

  4. DOption (d)

    The process of analyzing software to create a representation of a higher level of abstraction and breaking software down into its parts to see how it works

View answer & explanation

Correct answer

Answer: (b)B.

The process of existing software artifacts and knowledge to build new software

Why this answer is correct

Concept:

Software reuse is the use of existing software after doing some changes in the existing software.

Explanation:

Software reuse helps in reducing the cost of software production by using the existing software with some modification. It means creation of new software by reusing the existing software rather than making new software.

A software cannot be easily reused if it is connected in some complex way to other components in an existing system.

Three requirements for a reusable component are:

  • It provides a useful service
  • It performs a single function
  • It has the minimum of connections to other components.

Question 32

Which type of addressing mode, less number of memory references are required?

  1. AOption (a)

    Immediate

  2. BOption (b)

    Implied

  3. COption (c)

    register

  4. DOption (d)

    indexed

View answer & explanation

Correct answer

Answer: (b)B.

Implied

Why this answer is correct

Immediate addressing mode:

It is the simplest form of addressing mode, in which the operand value is present in the instruction. This mode is used to define and use constants or set initial values of variable. In this, no memory reference other than the instruction fetch is required to obtain the operand.

Implied addressing mode:

In this, operands are specified in the definition of instruction. It is used for zero address instructions.

Register addressing mode:

In register addressing mode, the address field refers to a register rather than a main memory address. In this, only a small address field is needed in the instruction and no time-consuming memory references are required.

Index addressing mode:

In this, operand is the address that is sum of index register and displacement. It needs memory reference.

Question 33

Consider double hashing of the form

h(k,i)=(h​1​ (k)+ih​2​ (k)) mod m

Where h​ 1​ (k)=k mod m

h​2​ (k)=1+(k mod n)

Where n=m-1and m=701

for k=123456, what is the difference between first and second probes in terms of slots?

  1. AOption (a)

    255

  2. BOption (b)

    256

  3. COption (c)

    257

  4. DOption (d)

    258

View answer & explanation

Correct answer

Answer: (c)C.

257

Why this answer is correct

Data:

h(k, i) = (h1(k)+ih2 (k)) mod m

Where h​1​(k)=k mod m, h​2​ (k)=1+(k mod n)

 n=m-1, m=701 and k = 123456

Calculation:

h1(k) = 123456 mod 701 = 80

h2(k) = 1 + (123456 mod 700) = 1 + 256 = 257

1st probe: when i =1

h(k, i) = h1(k) + ih2(k)

h(k, 1) = h1(k) + h2(k) = 80 + 257 = 337

2nd probe: when i =2

h(k,2) = h1(k) + 2h2(k) = 80 + 2257

h(k,2) = 80 + 514 = 594

So, difference between first two probes = 594 – 337 = 257

Question 34

Which of the following problems is/are decidable problem(s) (recursively enumerable) on a Turing machine M?

(a) G is a CFG with L(G) = ϕ

(b) There exist two TMs M​1​ and M2​ such that L(M) ⊆{L(M​1​) U L(M​2​)} = language of all TMs

(c) M is a TM that accepts w using at most 2​|w|​ cells of tape

  1. AOption (a)

    (a) and (b) only

  2. BOption (b)

    (a) only

  3. COption (c)

    (a), (b) and (c)

  4. DOption (d)

    (c) only

View answer & explanation

Correct answer

Answer: (b)B.

(a) only

Why this answer is correct

Statement a: G is a CFG with L(G) = ϕ

It means emptiness problem for context free grammar. For context free language, emptiness problem is decidable. So, this statement is correct.

Statement b: There exist two TMs M​1​ and M2​ such that L(M) ⊆{L(M​1​) U L(M​2​)} = language of all TMs

L(M​1​) U L(M​2​) – it means union of two recursive enumerable languages which is also recursive enumerable.

L(M) ⊆{L(M​1​) U L(M​2​)}, this means subset problem for Turing machine (TM). Subset is undecidable property in Turing machines.

Statement c: M is a TM that accepts w using at most 2​|w|​ cells of tape

It is undecidable, Suppose M accepts w is decidable. Then language is decidable. It means M does not accept w is also decidable. Suppose this complement is decidable by another Turing machine then there comes a contradiction. So, it is not decidable.

Question 35

Software validation mainly checks for inconsistencies between

  1. AOption (a)

    Use cases and user requirements

  2. BOption (b)

    Implementation and system design blueprints

  3. COption (c)

    Detailed specifications and user requirements

  4. DOption (d)

    Function specifications and use cases

View answer & explanation

Correct answer

Answer: (c)C.

Detailed specifications and user requirements

Why this answer is correct

  • Software validation means “are we building the right product”. Validation means that product meets the customers’ expectations. It goes beyond checking it meets its specification as system specifications don’t always accurately reflect the real need of users.
  • Validation refers to the process of evaluating software at the end of its development to ensure that it is free from failures and complies with its requirements. A failure is defined as incorrect product behavior. Often this validation occurs through the utilization of various testing approaches.
<br>

There are two ways to perform software validation: internal and external.

  1. Internal validation assumes that goals of stakeholders were correctly understood.
  2. External validation is performed by asking the stakeholders if the software meets their needs.

Question 36

In relational database, if a relation R is in BCNF, then which of the following is true about relation R?

  1. AOption (a)

    R is in 4NF

  2. BOption (b)

    R is not in 1NF

  3. COption (c)

    R is in 2NF and not in 3NF

  4. DOption (d)

    R is in 2NF and 3NF

View answer & explanation

Correct answer

Answer: (d)D.

R is in 2NF and 3NF

Why this answer is correct

Boyce Codd Normal Form (BCNF): 

  • A relation is said to be in BCNF form, if it satisfied the following property.
  • If there is a functional dependency X → Y, then for relation to be in BCNF, X must be the super key.
  • If a relation is in highest normal form, then it automatically also in the weaker normal forms. It means, if a relation is in BCNF then it is also in 1NF, 2NF, 3NF.
  • Since the requirement of BCNF is left hand side of functional dependency should be the candidate key. So, there is no possibility of partial dependency and transitive dependency in the relation.

Question 37

In relational database management, which of the following is/are property/properties of candidate key?

P: Uniqueness

Q: Irreducibility

  1. AOption (a)

    P only

  2. BOption (b)

    Q only

  3. COption (c)

    Both P and Q

  4. DOption (d)

    Neither P nor Q

View answer & explanation

Correct answer

Answer: (c)C.

Both P and Q

Why this answer is correct

Concept:

Candidate key: It uniquely identifies the tuples in a relation. A candidate key is a super key with no redundant attribute. In a relation, there can be more than one candidate key.

Explanation:

As, candidate uniquely identifies the tuples in a relation. So, first property of the candidate key is its uniqueness. 

Second, candidate key does not contain redundant attribute. We cannot further reduce a candidate key. If a candidate key is reduced, then it can cause partial dependency. Second property is its irreducibility.

Example:

A relation with four attributes: R(A, B, C, D). Function dependencies are:

A → C

B → D

In this, AB is the candidate key.

AB uniquely identifies tuple in relation R also AB cannot be reduced further.

Question 38

Match List-I with List-II:

List-IList-II
(a) Prim’s algorithm(i) O(V3 logV)
(b) Dijkstra's algorithm(ii) O(VE2)
(c) Faster all pairs shortest path(iii) O(ElogV)
(d) Edmonds-karp algorithm(iv) O(V2)
  1. AOption (a)

    (a)-(ii); (b)-(iv); (c)-(i); (d)-(iii)

  2. BOption (b)

    (a)-(iii); (b)-(iv); (c)-(i); (d)-(ii)

  3. COption (c)

    (a)-(ii); (b)-(i); (c)-(iv); (d)-(iii)

  4. DOption (d)

    (a)-(iii); (b)-(i) (c)-(iv); (d)-(ii)

View answer & explanation

Correct answer

Answer: (b)B.

(a)-(iii); (b)-(iv); (c)-(i); (d)-(ii)

Why this answer is correct

Prim’s algorithm:

It is used to find the minimum spanning tree for a weighted undirected graph. It uses the greedy approach to find the MST for a graph. Unlike the Kruskal’s algorithm, we add vertex to growing spanning tree in this. If there are V vertices and E edges in the graph. Then time complexity to search for MST is O(ElogV).

Dijkstra’s algorithm:

It is used to find the shortest path from source vertex to all other vertices in a graph.  Initially, distance from source to source is considered as 0 and to all other vertices is infinity. It uses the condition “current vertex distance + edge weight < next vertex distance” to find shortest distance. Time complexity for this is O(V2).

Faster all pair shortest path: 

It finds shortest the distance from a vertex to all other vertices in a graph. If there are E edges and V vertices in a graph, then it takes O(V3logV) time to find the shortest path.

Edmond-Karp algorithm: It is used to find the maximum flow in a network. It uses BFS in Ford Fulkerson method. Its time complexity is O(V.E2).

Question 39

Suppose that the register A and register K have the bit configuration. Only the three leftmost bits of A are compared with memory words because K has 1's in these positions. Because of its organization, this type of memory is uniquely suited to parallel searches by data association. This type of memory is known as

  1. AOption (a)

    RAM

  2. BOption (b)

    ROM

  3. COption (c)

    Content addressable memory

  4. DOption (d)

    Secondary memory

View answer & explanation

Correct answer

Answer: (c)C.

Content addressable memory

Why this answer is correct

Concept:

The time required to find an item stored in memory can be reduced considerably if stored data is identified for access by the content of the data itself rather than by an address. Memory unit accessed by content is called an associative memory or content addressable memory (CAM).

Explanation:

CAM is accessed simultaneously and in parallel on the basis of data content rather than specific location. When a word is written in CAM, no address is given. Memory is capable of finding an unused empty slot to store the word. When a word is to be read from memory, the content of the word is specified, and memory locates all words which matches the specified content and marks them for reading.

Question 40

In the context of software testing, which of the following statements is/are NOT correct?

P: A minimal test set that achieves 100% path coverage will also achieve 100% statement coverage.

Q: A minimal test set that achieves 100% path coverage will generally detect more faults than one that achieves 100% statement coverage

R: A minimal test set that achieves 100% statement coverage will generally detect more faults than one that achieves 100% branch coverage

  1. AOption (a)

    R only

  2. BOption (b)

    Q only

  3. COption (c)

    P and Q only

  4. DOption (d)

    Q and R only

View answer & explanation

Correct answer

Answer: (a)A.

R only

Why this answer is correct

Statement P:

A minimal test set that achieves 100% path coverage will also achieve 100% statement coverage.

This statement is correct. Statement coverage means executing each statement at least once. Whereas Path coverage is in which every distinct entry – exit path through the code is executed at least once in some test. It is a white box technique. It tells about how well the source code has been made. A minimal test set that achieves 100% path coverage will also achieve 100% statement coverage.

Statement Q:  

A minimal test set that achieves 100% path coverage will generally detect more faults than one that achieves 100% statement coverage

Sometimes, during minimal test it can be the possibility that test suite produce 100% statement coverage will miss certain defects related to control structure. So, this statement is correct.

Statement R: A minimal test set that achieves 100% statement coverage will generally detect more faults than one that achieves 100% branch coverage

Branch coverage means, for each branch is chosen at least once in some test. It includes statement coverage. As, in case of statement coverage, test suite sometimes cannot detect all faults. So, this statement is not correct that a minimal test set that achieves 100% statement coverage will generally detect more faults than one that achieves 100% branch coverage.

Question 41

For a statement

A language L ⊆ Σ* is recursive if there exists some Turing machine M

Which of the following conditions is satisfied for any string w?

  1. AOption (a)

    If w ε L, then m accepts w and M will not halt

  2. BOption (b)

    If w ∉ L, then M accepts w and M will halt by reaching at final state

  3. COption (c)

    If w ∉ L, then M halts without reaching to acceptable state

  4. DOption (d)

    If w ε L, then M halts without reaching to an acceptable state

View answer & explanation

Correct answer

Answer: (c)C.

If w ∉ L, then M halts without reaching to acceptable state

Why this answer is correct

Concept:

A language is recursive if there exists a Turing machine. For strings that are in the language, Turing machine accepts the language and always halts and for strings not in the language, string will halt in the non-final state.

Explanation:

A language L ⊆ Σ* is recursive if there exists some Turing machine M

suppose w is the string.

So, if w belongs to language, then Turing machine M will halt by reaching at final state and if does not belong to L, then M halts without reaching to final state (acceptable state).

Question 42

K-mean clustering algorithm has clustered the given 8 observations into 3 clusters after 1st iteration as follows:

C1 : {(3,3), (5,5), (7,7)}

C2 : {(0,6), (6,0), (3,0)}

C3 : {(8,8),(4,4)}

What will be the Manhattan distance for observation (4,4) from cluster centroid C1 in second iteration?

  1. AOption (a)

    2

  2. BOption (b)

    √2

  3. COption (c)

    0

  4. DOption (d)

    18

View answer & explanation

Correct answer

Answer: (a)A.

2

Why this answer is correct

Concept:

Manhattan distance is the distance between two points measured at right angle along both the x-axis and y- axis.

Formula:

It is calculated as: if there is a point P(x1, y1) and Q(x2, y2). Then Manhattan distance is |x2- x1| + |y2 – y1|.

Calculation:

C1: {(3,3), (5,5), (7,7)}

C2: {(0,6), (6,0), (3,0)}

C3: {(8,8), (4,4)}

First point is (4,4).

We have to find the Manhattan distance for cluster C1 in 2nd iteration:

For 2nd iteration: points will be:

(13(3+5+7)),(13(3+5+7))=(5,;5)\left( {\frac{1}{3}\left( {3 + 5 + 7} \right)} \right),\left( {\frac{1}{3}\left( {3 + 5 + 7} \right)} \right) = \left( {5,;5} \right)

So, Manhattan distance = |5 – 4| + |5 – 4| = 1 + 1 = 2

Question 43

What is the output of the following JAVA program?

public class Good{

Private int m;

Public Good(int m){this.m=m;}

public Boolean equals(Good n){return n.m=m;}

public static void main(String args [ ]){

Good m1=new Good(22);

Good m2=new Good(22);

Object S1=new Good(22);

Object S2=new good(22);

System.out.println(m1.equals(m2));

System.out.println(m1.equals(s2));

System.out.println(m1.equals(s2));

System.out.println(s1.equals(m2));

}

}

  1. AOption (a)

    True, True, False, False

  2. BOption (b)

    True, false, True, false

  3. COption (c)

    True, True, False, True

  4. DOption (d)

    True, False, False, False

View answer & explanation

Correct answer

Answer: (d)D.

True, False, False, False

Why this answer is correct

The correct answer is True, False, False, False

Key Points

  • m1.equals(m2) - This will be True. Both m1 and m2 are instances of Good and their m field is equal to 22.
  • m1.equals(s2) - This will not compile because the Object s2 is not explicitly cast to Good.
  • s1.equals(m2) - This will also not compile because the .equals() method of the Object class is expecting an Object as parameter, but here you're providing it with an instance of Good. Since the equals() method is not overridden in Good class to handle the object class, it is a mismatch.

Question 44

Reinforcement learning can be formalized terms of ___ in which the agent initially only knows the set of possible ___ and the set of possible actions

  1. AOption (a)

    Markov decision processes, objects

  2. BOption (b)

    Hidden states, objects

  3. COption (c)

    Markov decision processes, states

  4. DOption (d)

    Objects, states

View answer & explanation

Correct answer

Answer: (c)C.

Markov decision processes, states

Why this answer is correct

Reinforcement learning:

It is the learning what to do – how to map situations to actions so as to maximize a numerical reward signal. The learner is not told which actions to take, but instead must discover which actions yield the most reward by trying them.

Two most distinguishing feature of reinforcement learning are: trial and error search and delayed reward. The problem of reinforcement learning means using ideas from dynamical system theory as the optimal control of incompletely known Markov decision process. It starts with a complete, interactive and goal –seeking agent. In this agent initially knows the set of possible states and possible actions.

Question 45

Consider the following:

(a) Evolution

(b) Selection

(c) reproduction

(d) Mutation

Which of the following are found in genetic algorithms?

  1. AOption (a)

    (b), (c) and (d) only

  2. BOption (b)

    (b) and (d) only

  3. COption (c)

    (a), (b), (c) and (d)

  4. DOption (d)

    (a), (b) and (d) only

View answer & explanation

Correct answer

Answer: (c)C.

(a), (b), (c) and (d)

Why this answer is correct

Concept:

Genetic algorithms are adaptive methods which may be used to solve search and optimization problems. They are based on the genetic process of biological organisms.

Explanation:

Genetic algorithms use a direct analogy of natural behavior. They work with a population of individuals, each representing a possible solution to a given problem. Each individual is assigned a fitness score according to how good a solution to the problem it is. The highly fit individuals are given opportunities to reproduce, by cross breeding. This produces offspring. Before a GA can be run, a suitable coding and fitness function is required.

Phases that are considered in genetic algorithm are:

  1. Initialize population

  2. Selection

  3. Crossover

  4. Mutation

  5. reproduction

Question 46

Shift-reduce parser consists of

(a) input buffer

(b) stack

(c) parse table

choose the correct option from those given below:

  1. AOption (a)

    (a) and (b) only

  2. BOption (b)

    (a) and (c) only

  3. COption (c)

    (c) only

  4. DOption (d)

    (a), (b) and (c)

View answer & explanation

Correct answer

Answer: (d)D.

(a), (b) and (c)

Why this answer is correct

Concept:

Shift reduce parser is based on the idea of predictive parsing with look ahead. It is a bottom up parser.

Explanation:

A shift-reduce parser indeed consists of an input buffer for holding the input string, a stack for temporarily holding the symbols that are not yet reduced, and a parse table to guide the parsing actions -- it helps determine when to shift (push a symbol onto the stack) and when to reduce (pop symbols off the stack and replace them with a nonterminal).

Example:   E → E – E

E → E × E

E → id

We have to parse the string id – id × id:

StackInput bufferParsing action
$id – id × id $shift
$ id- Id × id $Reduce E -> id
$ E-id × id $shift
$ E -id × id $Shift
$ E – id× id $Reduce E-> id
$ E – E× idShift
$ E – E ×id $Shift
$ E – E × id$Reduce E -> id
$ E – E × E$Reduce E-> E ×E
$ E – E$Reduce E ->E- E
$ E$Accept

Question 47

Which of the following statements is/are true?

P: In a scripting language like JavaScript, types are typically associated with values, not variables.

Q: It is not possible to show images on a web page without the image tag of HTML

Select the correct answer from the given below:

  1. AOption (a)

    P only

  2. BOption (b)

    Q only

  3. COption (c)

    Both P and Q

  4. DOption (d)

    neither P nor Q

View answer & explanation

Correct answer

Answer: (a)A.

P only

Why this answer is correct

Statement P: In a scripting language like JavaScript, types are typically associated with values, not variables.

JavaScript is a client side as well as server-side scripting language.  JavaScript data types are:  number, string, Boolean, object, undefined. Basically, the type of a value determines the operations and methods performed on it. Variables are not directly associated with any particular type; any variable can be assigned values of all type.

Statement Q: It is not possible to show images on a web page without the image tag of HTML

This statement is not correct. As, images can be shown on a web page without the use of image tag of HTML. We can use div by giving the URL of the image in that.

Question 48

Consider the following steps:

S​1​: Characterize the structure of an optimal solution

S2​: Computer the value of an optimal solution in bottom-up fashion

Which of the step(s) is/are common to both dynamic programming and greedy algorithms?

  1. AOption (a)

    Only S​1

  2. BOption (b)

    Only S​2

  3. COption (c)

    both S1 and S2

  4. DOption (d)

    neither S1 nor S2

View answer & explanation

Correct answer

Answer: (a)A.

Only S​1

Why this answer is correct

Dynamic programming approach:

Dynamic programming approach consider the previous steps solution, save them and then use them in future so as to avoid solving same problem again and again. It uses the bottom up approach. Steps that are take in dynamic programming approach are:

  1. Characterize the structure of an optimal solution

  2. Using the previous solved values

  3. Construct the optimal solution for final result.

Greedy programming approach:

It builds the solution step by step. It chooses each step such as the next step gives the best result. Unlike the dynamic programming approach: greedy algorithm solves the problem in top down fashion.  It also characterizes the structure of an optimal solution.

Question 49

Match List-I with List-II:

Where L1: Regular language

L2: Context-free language

L3: Recursive language

L4: Recursively enumerable language

List-1List-2
(a) L'3 U L4(i) Context-free language
(b) L'2 U L3(ii) Recursively enumerable language
(c) L1* ∩ L2(iii) Recursive language

 

Choose the correct from those given below:

  1. AOption (a)

    (a)-(ii); (b)-(i); (c)-(iii)

  2. BOption (b)

    (a)-(ii); (b)-(iii); (c)-(i)

  3. COption (c)

    (a)-(iii); (b)-(i); (c)-(ii)

  4. DOption (d)

    (a)-(i); (b)-(ii); (c)-(iii)

View answer & explanation

Correct answer

Answer: (b)B.

(a)-(ii); (b)-(iii); (c)-(i)

Why this answer is correct

Expression a:  L'3 U L4

L3 is recursive language and L4­ is recursive enumerable language. Complement of recursive language is recursive. So, L’3 is also recursive. Also, union of recursive and Recursively enumerable language is recursively enumerable language. L'3 U L4 is recursively enumerable.

Expression b: L'2 U L3

L2 is context free language. Context free languages are not closed under complement. It is context sensitive. Context sensitive is also considered as recursive language. Union of two recursive languages is also recursive.

Expression c: L1* ∩ L2

L1 is regular language. Regular languages are closed under Kleen closure. So, L1* is also regular. Intersection of a regular and context free language is a context free language. So, L1* ∩ L2 is a context free language.

Question 50

You need 500 subnets, each with about 100 usable host addresses per subnet. What network mass will you assign using a class B network address?

  1. AOption (a)

    255.255.255.252

  2. BOption (b)

    255.255.255.128

  3. COption (c)

    255.255.255.0

  4. DOption (d)

    255.255.254.0

View answer & explanation

Correct answer

Answer: (b)B.

255.255.255.128

Why this answer is correct

  • In class B addressing: 16-bit network ID and 16-bits for host ID.
  • 500 subnets are required and 29 = 512, hence 9 bits are needed from host id part of class B addressing in order to provide 500 subnets.
  • Remaining 7 bits number of host possible per subnet is 128 – 2 = 126
Subnet-id (25 bits)Host-id (7-bits)
<br>

Subnet mask contains 1’s in subnet id part and the 0's in host ID part. Hence subnet mask is:

      1. 10000000

In decimal form it can be represented as:

      1. 128

Question 51

The ability to inject packets into the internet with false source address is known as :

  1. AOption (a)

    Man-in-the-Middle attack

  2. BOption (b)

    IP phishing

  3. COption (c)

    IP sniffing

  4. DOption (d)

    IP Spoofing

View answer & explanation

Correct answer

Answer: (d)D.

IP Spoofing

Why this answer is correct

Man-in-the-Middle Attack:

It is an attack where the attacker secretly relays and possibly alters the communications between two parties who believe they are directly communicating with each other.

Three security issues that are particularly applicable to the IP protocol: packet sniffing, packet modification and IP spoofing.

Packet sniffing:

In packet sniffing, an intruder tries to intercept the IP packet and make a copy of it. It is a passive attack, in which the attacker does not change the contents of the packet.

IP spoofing:

In IP spoofing, an attacker can masquerade (pretense) somebody else and creates an IP packet that carries the source address of another computer. An attacker can send an IP packet to a bank pretending that is coming from one of the customers.

Question 52

Consider the complexity class CO-NP as the set of languages L such that L’ ε NP, and the following two statements:

S1 : P ⊆ CO-NP

S2 : If NP ≠ CO-NP, then P ≠ NP

Which of the following is/are correct?

  1. AOption (a)

    Only S1

  2. BOption (b)

    Only S2

  3. COption (c)

    Both S1 and S2

  4. DOption (d)

    Neither S1 nor S2

View answer & explanation

Correct answer

Answer: (c)C.

Both S1 and S2

Why this answer is correct

NP complete problems:

They are those for which no polynomial time algorithm exists. We can say a problem is NP complete if it is NP and belongs to NP hard.

NP problems:

A problem is a member of NP class if there exists a non-deterministic machine which can solve it in polynomial time.

NP Hard:

A problem is called as NP hard if all the NP class problems are polynomial time reducible to that and as hard as any problem of NP class.

Question 53

There are many sorting algorithms based on comparison. The running time of heap sort algorithm is O(nlogn). Let P, but unlike Q, heapsort sorts in place where (P, Q) is equal to

  1. AOption (a)

    Merge sort, Quick sort

  2. BOption (b)

    Quick sort, Insertion sort

  3. COption (c)

    Insertion sort, Quick sort

  4. DOption (d)

    insertion sort, Merge sort

View answer & explanation

Correct answer

Answer: (d)D.

insertion sort, Merge sort

Why this answer is correct

The question asks specifically for in-place sorting algorithms, which means the algorithms in which only O(1) space is used.  

Insertion sort:

In Insertion sort, the worst-case takes Θ (n2) time, the worst case of insertion sort is when elements are sorted in reverse order.  It is in-place sorting algorithms.

In that case the number of comparisons will be like:

\(\mathop \sum \limits_{P = 1}^{N - 1} p = 1 + 2 + 3 + 4 + \ldots + N - 1 = \frac{{N\left( {N - 1} \right)}}{2}\)

This will give Θ (n2) time complexity.

Merge sort:

In Merge sort, the worst-case takes Θ (n log n) time. Merge sort is based on the divide and conquer approach. It is out of place sorting algorithms

Recurrence relation for merge sort will become:

T(n) = 2T (n/2) + Θ (n)

T(n) = n + Θ (n)

T (n) = n × logn

Quicksort:

In Quicksort, the worst-case takes Θ (n2) time. The worst case of quicksort is when the first or the last element is chosen as the pivot element.

 

\(\mathop \sum \limits_{P = 1}^{N - 1} p = 1 + 2 + 3 + 4 + \ldots + N - 1 = \frac{{N\left( {N - 1} \right)}}{2}\)

This will give Θ (n2) time complexity.

Recurrence relation for quick sort algorithm will be,

T (n) = T (n - 1) + Θ (n)

This will give the worst-case time complexity as Θ (n2).

It is in-place sorting algorithms

Conclusion:

P needs to be an in-place sorting algorithm, and Q needs to be out of place sorting algorithm, Hence option 4 is correct.

Question 54

You are designed a link layer protocol for a link with bandwidth of 1 Gbps (109 bits/second) over a fibre link with length of 800 km. Assume the speed of light in this medium is 200000 km/second. What is the propagation delay in this link?

  1. AOption (a)

    1 millisecond

  2. BOption (b)

    2 millisecond

  3. COption (c)

    3 millisecond

  4. DOption (d)

    4 millisecond

View answer & explanation

Correct answer

Answer: (d)D.

4 millisecond

Why this answer is correct

Data:

Bandwidth = BW = 109 bps

Distance = D = 800 km

Speed = V = 2 × 105 km/s

Formula:

Propagation;Delay=Tp=DV;{\rm{Propagation;Delay}} = {{\rm{T}}_{\rm{p}}} = \frac{{\rm{D}}}{{\rm{V}}}{\rm{;}}

Calculation:

Tp=DV=8002×105=4×10−3=4;ms {{\rm{T}}_{\rm{p}}} = \frac{{\rm{D}}}{{\rm{V}}} = \frac{{800}}{{2 \times {{10}^5}}} = 4 \times {10^{ - 3}} = 4;ms

The propagation delay in this link is 4 ms.

Question 55

Software products need are adaptive maintenance for which of the following reasons?

  1. AOption (a)

    To rectify bugs observed while the system is in use

  2. BOption (b)

    When the customers need the product to run on new platforms

  3. COption (c)

    To support the new features that users want it to support

  4. DOption (d)

    To overcome wear and tear caused by the repeated use of the software

View answer & explanation

Correct answer

Answer: (b)B.

When the customers need the product to run on new platforms

Why this answer is correct

Maintenance:

Maintenance can be referred as a process of enhancement in the software product according to the changing requirements of users.

Four types of maintenance:

  1. Adaptive: modifying the system to cope with changes in the software environment (DBMS, OS).
  2. Perfective: implementing new or changed user requirements which concern functional enhancements to the software
  3. Corrective: diagnosing and fixing errors, possibly ones found by users.
  4. Preventive: Increasing software maintainability or reliability to prevent problems in the future.

Question 56

The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by

  1. AOption (a)

    Page size

  2. BOption (b)

    Physical size of memory

  3. COption (c)

    The instruction set architecture

  4. DOption (d)

    Number of processes in memory

View answer & explanation

Correct answer

Answer: (c)C.

The instruction set architecture

Why this answer is correct

Instruction set architecture:  

  • The Absolute minimum number of frames that a process must be allocated is completely dependent on System architecture.
  • The Number of pages that could be touched by a single instruction.
  • For no indirect addressing, at least two pages in physical memory, that is, one for instruction (code part) and another for if the data references memory.
  • If there is one level of indirection, then it will need at least three pages one for the instruction(code) and another two for the indirect addressing and so on.
  • Therefore, the instruction set architecture determines the minimum number of page frames that must be allocated to a running process in a virtual memory environment.

Question 57

The component M in MVC is responsible for

  1. AOption (a)

    User interface

  2. BOption (b)

    Security of the system

  3. COption (c)

    Business logic and domain objects

  4. DOption (d)

    Translating between user interface actions/events and operation on the domain objects

View answer & explanation

Correct answer

Answer: (c)C.

Business logic and domain objects

Why this answer is correct

Model-View-Controller (MVC):

  • MVC refers to three different realms of responsibility in the design of a graphical user interface.
  • When the MVC pattern is applied to a component, the model consists of the data that represents the current state of the component.
  • The view is simply the visual presentation of the component on the screen.
  • The controller is the aspect of the component that carries out actions in response to events generated by the user (or by other sources such as timers).

The idea is to assign responsibility for the model, the view, and the controller to different objects.

Question 58

Consider the following statements:

S1 : For any integer n>1, aΦ(n) = 1(mod n) for all a ∊ Z*n, where Φ(n) is euler’s phi function.

S2 : If p is prime, then ap = 1(mod p) for all a ∊ Z*p

Which one of the following is are correct:

  1. AOption (a)

    Only S1

  2. BOption (b)

    Only S2

  3. COption (c)

    Both S1 and S2

  4. DOption (d)

    Neither S1 nor S2

View answer & explanation

Correct answer

Answer: (a)A.

Only S1

Why this answer is correct

Statement I:  Correct

Euler's theorem (Fermat–Euler theorem or Euler's totient theorem) states that if ‘n’ and ‘a’ are coprime positive integers, then aΦ(n) = 1(mod n)

Statement II:  Incorrect

According to Fermat's Little Theorem,

Let ‘p’ be a prime and ‘a’ any integer, then ap = a (mod p).

Question 59

A fuzzy conjunction operator denoted as t(x,y) and fuzzy disjunction operator denoted as s(x,Y) form dual pair if they satisfy the condition:

  1. AOption (a)

    t(x, y) = 1 - s(x, y)

  2. BOption (b)

    t(x, y) = s(1 - x, 1 - y)

  3. COption (c)

    t(x, y) = 1 - s(1 - x, 1 - y)

  4. DOption (d)

    t(x, y) = s(1 + x, 1 + y)

View answer & explanation

Correct answer

Answer: (c)C.

t(x, y) = 1 - s(1 - x, 1 - y)

Why this answer is correct

Concept:

Fuzzy set: A fuzzy set is that which allows its members to have different value in the set interval [0,1].

Explanation:

Operations that can be performed on fuzzy set are union, intersection, complement.

Union and intersection operation in fuzzy set are equal to conjunction(AND) and disjunction operation(OR) respectively.

We can consider min for conjunction and max for disjunction. Also, there are various other choices also. Such as to calculate product for conjunction and algebraic sum for disjunction operation.

If fuzzy conjunction operator is denoted as t(x, y) and fuzzy disjunction operator is denoted as s(x, y). Then it forms as dual pair if:

1- t(x, y) = s(1-x, 1-y)

or 1- s(x, y) = t(1-x, 1-y )

Here, it means choice of fuzzy disjunction operator determines the choice of fuzzy conjunction operator and vice versa.

Question 60

Which of the following statements is/are true

P: An XML document with correct as specified by W3C is called “well formed”.

Q: An XML documented validated against a DTD is both “Well-Formed” and “valid”.

R: <xml version=”1.0” encoding =”UTF-8”>

is syntactically correct declaration for the version of an XML document.

Select the correct answer from the options given below:

  1. AOption (a)

    P and Q only

  2. BOption (b)

    P and R only

  3. COption (c)

    Q and R only

  4. DOption (d)

    All of P, Q and R

View answer & explanation

Correct answer

Answer: (a)A.

P and Q only

Why this answer is correct

XML:

XML stands for extensible markup language. It is a meta markup language for text documents/data. It allows to define languages to represent text. It is designed to describe data not to display data. XML tags are not predefined.

Some points in XML are as follows:

  • An XML document is well formed it satisfies rule specified by the W3C.
  • A well-formed XML have a proper starting and closing tag.
  • An XML documented validated against a DTD is both “Well-Formed” and “valid”.
  • Purpose of DTD is to define the structure and legal elements and attributed of a XML document.
  • XML does not require DTD.
  • XML carries the data; it does not represent it.
  • XML can be used for offloading and reloading of databases.
<br>

XML declaration syntax is:

<?xml version =”1.0” encoding=”UTF-8” ?>

Question 61

The STRIPS representation is

  1. AOption (a)

    a feature-centric representation

  2. BOption (b)

    an action-centric representation

  3. COption (c)

    a combination of feature-centric and action-centric representation

  4. DOption (d)

    a hierarchical feature-centric representation

View answer & explanation

Correct answer

Answer: (b)B.

an action-centric representation

Why this answer is correct

STRIPS – It stands for Stanford research institute problem solver. It is an action centric representation in which for each action, it specifies the effect of the action.

In strips representation, there are states and goal and operators. Operator is of three parts :

  1.  Operator name
  2. Precondition: it must occur so that operator can execute.
  3. Effect: it means how the state will change after an action.

In STRIPS, there is state base view of time. Actions are external to the logic. Given a state and an action, STRIPS representation is used to find:

a)  Whether the action can be carried out in the state

b) what is true in the resulting state.

Predicates used in STRIPS are primitive and derived. It is used to determine the truth value of primitive predicates based on the previous state and action.

Question 62

Consider the following methods:

M​1: mean of maximum

M​2: Centre of area

M​3: Height method

Which of the following is/are defuzzification method(s)?

  1. AOption (a)

    Only M​1

  2. BOption (b)

    Only M1​ and M​2

  3. COption (c)

    Only M2 and M​3

  4. DOption (d)

    M​1, M2​ and M​3

View answer & explanation

Correct answer

Answer: (d)D.

M​1, M2​ and M​3

Why this answer is correct

Correct answer is option 4).

Concept:

Defuzzification: It is the reverse of fuzzification in which a fuzzy set is transformed back to crisp set.

Methods:

M​1: mean of maximum

M​2: Centre of area

M​3: Height method

Explanation:

Various defuzzification methods are:

  1. centre of sum method: In this method, it covers the area two times , which is the required area.

  2. centroid method: It provides crisp value by considering the centre of gravity on fuzzy set. It is also known as centre of gravity method. Total area is divided into sub areas in this. Centre of gravity is calculated for each sub area.

  3. centre of area method: It calculates the area under curve. It partitions a region into two regions of same area.

  4. weight average method: In this, membership functions are used. Each membership function is weighted by the maximum membership value.

  5. maxima methods

a) First of maxima : It finds the smallest value of domain with maximum membership value

b) Last of maxima: It finds the largest value with maximum membership value.

c) Mean of maxima: In this, mean of the values is taken with maximum membership value.

Question 63

Consider the following statements regarding 2D transforms in computer graphics:

S1: \(\left[ {\begin{array}{*{20}{c}} 1&0\ 0&{ - 1} \end{array}} \right]\) is a 2 × 2 matrix that reflects (mirrors) only 2D point about the X-axis.

S2: A 2 × 2 matrix which mirrors any 2D point about the X-axis, is a rotation matrix.

What can you say about the statement S1 and S2?

  1. AOption (a)

    Both S1 and S2 are true

  2. BOption (b)

    Only S1 is true

  3. COption (c)

    Only S2 is true

  4. DOption (d)

    Both S1 and S2 are false

View answer & explanation

Correct answer

Answer: (b)B.

Only S1 is true

Why this answer is correct

Statement S1: TRUE

Let the mirror image co-ordinate be [x’, y’]

\(\left[ {x',;y'} \right] = \left[ {x,;y;} \right]\left[ {\begin{array}{*{20}{c}} 1&0\ 0&{ - 1} \end{array}} \right]\)

[x’, y’] = [x, -y]

Mirror image of co-ordinate (x, y) is (x, -y)

Therefore, statement I is correct

Statement S2: FALSE

A 2 × 2 matrix which mirrors any 2D point about the X-axis, is not a rotation matrix

Question 64

Consider the following pseudo-code fragment in which an invariant for the loop is " m*xk =pnand k ≥ 0 " (Here, p and n are integer variables that have been initialized):

/* Pre-conditions:p ≥ 1 ∧ n ≥ 0 */

/* Assume that overflow never occurs */

int x=p; int k=n; int m=1;

while(k< >0)

{

if(k is odd) then m=m*x;

x=x*x;

k=⌊(k/2)⌋; /* floor(k/2) */

}

Which of the following must be true at the end of the while loop?

  1. AOption (a)

    x=pn

  2. BOption (b)

    m=pn

  3. COption (c)

    p=xn

  4. DOption (d)

    p=mn

View answer & explanation

Correct answer

Answer: (b)B.

m=pn

Why this answer is correct

Initially consider p = 8, n = 7 and m = 1

Iteration 1:

int x=p; int k=n; int m=1;            // So, x = 8, k =7

while(k< >0)                                   // condition true as k is not equal to zero

if(k is odd) then m=mx;               // as 7 is odd, then m = 18 = 8

x=x*x                                              // x = 64

k=⌊(k/2)⌋;                                      // k = 7/2 = 3

Iteration 2:

while(k< >0)                                   // condition true as k is not equal to zero

if(k is odd) then m=mx;               // as 3 is odd, then m = 864 = 512

x=x*x                                              // x = 4096

k=⌊(k/2)⌋;                                      // k = 3/2 = 1

Iteration 3:

while(k< >0)                                   // condition true as k is not equal to zero

if(k is odd) then m=mx;               // as 1 is odd, then m = 5124096 = 221

x=xx                                              // x = 40964096 = 224

k=⌊(k/2)⌋;                                      // k = 1/2 = 0

Next while loop false

∴ m = 221

Option 2:  Correct answer

pn = 87 = (23)7 = 221

∴ m = pn

Question 65

Consider the game tree given below:

Here ∘ and □ represents MIN and MAX nodes respectively. The value of the root node of the game tree is

  1. AOption (a)

    4

  2. BOption (b)

    7

  3. COption (c)

    11

  4. DOption (d)

    12

View answer & explanation

Correct answer

Answer: (b)B.

7

Why this answer is correct

Start from bottom to top:

  1. First it finds the minimum value from the given values.

  2. At next step, max value is considered.

  3. Then again min value is considered.

  4. Then at the root, we have to consider the maximum value.

Question 66

Suppose that a computer program takes 100 seconds of execution time on a computer with multiplication operation responsible for 80 seconds of this time. How much do you have to improve the speed of multiplication operation if you are asked to execute this program four times faster.

  1. AOption (a)

    14 times faster

  2. BOption (b)

    15 times faster

  3. COption (c)

    16 times faster

  4. DOption (d)

    17 times faster

View answer & explanation

Correct answer

Answer: (c)C.

16 times faster

Why this answer is correct

Formula:

Total execution time = time to execute multiplication operation + time for other operations

Calculation:

Total execution time = 100 seconds

Time to execute multiplication operation = 80 seconds.

Then time to execute other operation = 100 – 80 = 20 seconds.

To execute the program four times faster, we have to improve the multiplication operation according to the question.

To execute the program four times faster: Total execution time will become = 100/ 4 = 25 seconds

New time to perform multiplication operation = new total execution time – time for other operations

New time to perform multiplication operation = 25 – 20 = 5 seconds

So, speed of multiplication operation is improved by = 80/5 = 16 times

Speed becomes 16 times fast.

Question 67

The value of the derivative of the sigmoid function given by

f(x) = 1 / (1 + e(-2x)) at x = 0 is

  1. AOption (a)

    0

  2. BOption (b)

    1/2

  3. COption (c)

    1/4

  4. DOption (d)

    ∞

View answer & explanation

Correct answer

Answer: (b)B.

1/2

Why this answer is correct

ddx(11+e−2x)\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right)

Differentiating with respect to x

ddx(11+e−2x)=(1+e−2x)ddx(1)−(1)ddx(1+e−2x)(1+e−2x)2\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right) = \frac{{\left( {1 + {e^{ - 2x}}} \right)\frac{d}{{dx}}\left( 1 \right) - \left( 1 \right)\frac{d}{{dx}}\left( {1 + {e^{ - 2x}}} \right)}}{{{{\left( {1 + {e^{ - 2x}}} \right)}^2}}}

ddx(11+e−2x)=0−(1)ddx(1+e−2x)(1+e−2x)2\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right) = \frac{{0 - \left( 1 \right)\frac{d}{{dx}}\left( {1 + {e^{ - 2x}}} \right)}}{{{{\left( {1 + {e^{ - 2x}}} \right)}^2}}}

ddx(11+e−2x)=−(1)e−2x(−2)(1+e−2x)2\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right) = \frac{{ - \left( 1 \right){e^{ - 2x}}\left( { - 2} \right)}}{{{{\left( {1 + {e^{ - 2x}}} \right)}^2}}}

ddx(11+e−2x)=2e−2x(1+e−2x)2\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right) = \frac{{2{e^{ - 2x}}}}{{{{\left( {1 + {e^{ - 2x}}} \right)}^2}}}

take x = 0

ddx(11+e−2x)=2e−2×0(1+e−2×0)2=2(1+1)2=24=12\frac{d}{{dx}}\left( {\frac{1}{{1 + {e^{ - 2x}}}}} \right) = \frac{{2{e^{ - 2 \times 0}}}}{{{{\left( {1 + {e^{ - 2 \times }}0} \right)}^2}}} = \frac{2}{{{{\left( {1 + 1} \right)}^2}}} = \frac{2}{4} = \frac{1}{2}

Question 68

Consider the poset ({3, 5, 9, 15, 24, 45}, |).

Which of the following is correct for the given poset?

  1. AOption (a)

    There exists a greatest element and a least element

  2. BOption (b)

    There exists a greatest element but not a least element

  3. COption (c)

    There exists a least element but not a greatest element

  4. DOption (d)

    There does not exist a greatest element and a least element

View answer & explanation

Correct answer

Answer: (d)D.

There does not exist a greatest element and a least element

Why this answer is correct

Concept:

Greatest element:

It is the maximum element i.e. element succeeding all other elements.

Least element:

It is the minimum element i.e. element preceding all other elements.

Explanation:

poset: {3, 5, 9, 15, 24, 45}

Hasse diagram for this poset is:

There are two maximal elements in this Hasse diagram: 24 and 45

Also, there are two minimal elements: 3 and 5

Both the maximal elements are at the same level. They are not dividing each other. So, there is no maximum or greatest element here.

Also, both the minimal elements are at the same level. There is no minimum element.

Question 69

Find the zero-one matrix of the transitive closure of the relation given by the matrix A:

\(A = \left[ {\begin{array}{*{20}{c}} 1&0&1\ 0&1&0\ 1&1&0 \end{array}} \right]\)

1. \(\left[ {\begin{array}{{20}{c}} 1&1&1\ 0&1&0\ 1&1&1 \end{array}} \right]\) 2. \(\left[ {\begin{array}{{20}{c}} 1&0&1\ 0&1&0\ 1&1&0 \end{array}} \right]\) 3. \(\left[ {\begin{array}{{20}{c}} 1&0&1\ 0&1&0\ 1&0&1 \end{array}} \right]\) 4. \(\left[ {\begin{array}{{20}{c}} 1&1&1\ 0&1&0\ 1&0&1 \end{array}} \right]\)

  1. AOption (a)

    1

  2. BOption (b)

    2

  3. COption (c)

    3

  4. DOption (d)

    4

View answer & explanation

Correct answer

Answer: (a)A.

1

Why this answer is correct

Matrix: \(A = \left[ {\begin{array}{*{20}{c}} 1&0&1\ 0&1&0\ 1&1&0 \end{array}} \right]\)

Consider, matrix starts from 0

i.e. from 0 to 2

Relation of matrix is: {(0, 0), (0, 2), (1, 1), (2, 0), (2, 1)}

In this we have an edge from 0 to 2 and from 2 to 1. So, there should be an edge from 0 to 1 also.

Also, there is an edge from 2 to 0 and 0 to 2. So, there must be an edge from 2 to 2 also.

Pairs that should be added to make the transitive closure of the matrix: {(2, 2), (0, 1)}.

After adding these pairs, matrix will become:

\(A = \left[ {\begin{array}{*{20}{c}} 1&1&1\ 0&1&0\ 1&1&1 \end{array}} \right]\)

Question 70

Which of the following are the primary objectives of risk monitoring in software project tracking?

P: To assess whether predicted risks do, in fact, occur

Q: To ensure that risk aversion steps defined for the risk are being properly applied

R: To collect information that can be used for future risk analysis

  1. AOption (a)

    Only P and Q

  2. BOption (b)

    Only P and R

  3. COption (c)

    Only Q and R

  4. DOption (d)

    All the P, Q, R

View answer & explanation

Correct answer

Answer: (d)D.

All the P, Q, R

Why this answer is correct

  • Risk monitoring and control in software engineering ensures the execution of risk plans and help in reducing the risk in software projects.
  • It keeps track of identifies risks. It monitors the already occurring risks and can identify new risks in project execution.

Primary objectives of risk monitoring are:

  1. To assess whether predicted risks do occur.
  2. To ensure that risk aversion steps defined for the risk are being properly applied
  3. To collect information that can be used for future risk analysis.
  4. To verify that risk actions are as effective as expected
  5. Proper procedures are followed or not.
  6. To identify the new risks that were not occurred previously
  7. To identify whether the risk has changed or declined.

Risk monitoring helps in identifying the events that has a serious effect in controlling the risks. It can produce alternate path for execution of events. It provides a good quality software after monitoring and controlling all the risks that can occur during the execution of software project.

Question 71

On translating the expression given below into quadruple representation, how many operations are required? (ij)+(e+f)(a*b+c)

  1. AOption (a)

    5

  2. BOption (b)

    6

  3. COption (c)

    3

  4. DOption (d)

    7

View answer & explanation

Correct answer

Answer: (b)B.

6

Why this answer is correct

Concept:

Quadruple representation is the three-address code representation. In this, each instruction is spitted into four fields which are operator, argument1, argument 2, and result.

Explanation:

Expression: (ij)+(e+f)(a*b+c)

T1 = (i * j)

T2 = (e + f)

T3 = (a * b)

T4 = T3 + c

T5 = T2 * T4

T6 = T1 + T5

Table Form:

OperatorArgument1Argument2result
1)*ijT1
2)+efT2
3)*abT3
4)+T3cT4
5)+T1T2T5
6)*T5T4T6

 

So, total 6 operations are required.

Question 72

Which of the following UNIX/Linux pipes will count the number of lines in all the files having .c and .h as their extension in the current working directory?

  1. AOption (a)

    cat *.ch | wc -l

  2. BOption (b)

    cat *.[c-h] | wc -l

  3. COption (c)

    cat *.[ch] | ls -l

  4. DOption (d)

    cat *.[ch] | wc -l`

View answer & explanation

Correct answer

Answer: (d)D.

cat *.[ch] | wc -l`

Why this answer is correct

Concept:

Pipes in Linux/Unix: Pipe is a command which produces an output which serves as input for next command. It works as a pipeline structure in computer.

Explanation:

We have to find the number of lines in all the files having .c and .h as their extension in the current working directory.

wc – in unix/linux , “wc” is used for word count.

cat – it is used to display the content of the file

Option 4:

cat *.[ch]              // it represents the content of files having .c and .h extension

Option 2:

cat *.[c-h] | wc –l      // it also includes the files with .c and . h extension but it also considers the other extensions that come between because it is a range which is not required in this question.

So, cat *.[ch] | wc -l

It will count the number of lines in all the files having .c and .h as their extension in the current working directory.

Question 73

The parallel bus arbitration technique uses an external priority encoder and a decoder. Suppose, a parallel arbiter has 5 bus arbiters. What will be the size of priority encoder and decoder respectively?

  1. AOption (a)

    4x2, 2x4

  2. BOption (b)

    2x4, 4x2

  3. COption (c)

    3x8, 8x3

  4. DOption (d)

    8x3, 3x8

View answer & explanation

Correct answer

Answer: (d)D.

8x3, 3x8

Why this answer is correct

Concept:

Arbiters:  arbiter is a device used in digital electronics to access the shared memory.

Encoder: Encoder is a combinational circuit that take the binary input in the form of 2n input lines and convert it into the n output lines.

Decoder: Decoder is the reverse process of encoder which takes the n inputs and convert to 2n output lines.

Explanation:

Here, it is given that a parallel arbiter has 5 bus arbiters.

For 5 bus arbiters, 3 bits are required.

For priority encoder:

With 3 bits, number of input lines are 23 = 8

Number of output lines = 3

Size of priority encoder will be: 8 × 3

For decoder:

With 3 bits, number of inputs = 3

Number of output lines = 23 = 8

Size of decoder is: 3 × 8

Question 74

Which of the following is best running time to sort n integers in the range 0 to n2-1

  1. AOption (a)

    O(log n)

  2. BOption (b)

    O(n)

  3. COption (c)

    O(n log n)

  4. DOption (d)

    O(n2)

View answer & explanation

Correct answer

Answer: (b)B.

O(n)

Why this answer is correct

Sort the integers in the range from 0 to n2 -1.

If we take any comparison-based sorting algorithms for this, it will take O(nlogn) time.

Comparison based sorting algorithms are merge sort, quick sort, heap sort etc.

Radix sort is used for sorting this range of integers. Radix sort takes O(n) time for this.

Algorithm:

For any digit in the integer, varies from least significant digit to the most significant digit of the number. Sort the input array using count sort algorithm according to the digit.

Note:

Radix sort depends on digits. It is more flexible than comparison based sorting algorithms. It solve the given problem in linear time.

Question 75

 Which of the following is an application of depth-first search?

  1. AOption (a)

    Only topological sort

  2. BOption (b)

    Only strongly connected components

  3. COption (c)

    Both topological sort and strongly connected components

  4. DOption (d)

    Neither topological sort not strongly connected components

View answer & explanation

Correct answer

Answer: (c)C.

Both topological sort and strongly connected components

Why this answer is correct

Depth first search:

Depth first search algorithm is used to traverse the vertices of a graph. It uses the concept of back tracking. Depth first search uses a data structure for its implementation which is known as stack.

Application of depth first search:

  1. It is used to find the strongly connected components.

  2. It helps in topological sorting.

  3. to check the bipartiteness of a graph.

  4. It helps in detecting cycles in a graph.

  5. To find articulation points in a graph.

Example:

DFS traversal for this: 1 2 4 5 3 6 7

Question 76

Consider the following grammar:

S → XY

X → YaY | a and y →  bbX

Which of the following statements is/are true about the above grammar?

(a) Strings produced by the grammar can have consecutive three a's

(b) Every string produced by the grammar have alternate a and b

(c) Every string produced by the grammar have at least two a's

(d) Every string produced by the grammar have b's in multiple of 2.

  1. AOption (a)

    (a) only

  2. BOption (b)

    (b) and (c) only

  3. COption (c)

    (d) only

  4. DOption (d)

    (c) and (d) only

View answer & explanation

Correct answer

Answer: (d)D.

(c) and (d) only

Why this answer is correct

S → XY

X → YaY | a and y →  bbX

Strings that are produced by this grammar are:

S → XY → abbX → abba

S → XY → YaYY

→ bbXabbXbbX → bbaabbabba

S → XY → YaYY

→ bbXabbXbbX  →bb YaY abbXbbX

→ bbbbXabbXabbXbbX → bbbbaabbaabbabba

So, strings that are accepted by this language are in the form of :

{abba, bbaabbabba, bbbbaabbaabbabba,……….}

Smallest string contains two a and all other contains more than two a’s

It means every string must contains at least two a’s. Also, number of b’s in the string is multiple of 2.

Question 77

Consider a raster system with resolution 640 by 480. What size is frame buffer (in bytes) for this system to store 12 bits per pixel?

  1. AOption (a)

    450 kilobytes

  2. BOption (b)

    500 Kilobytes

  3. COption (c)

    350 kilobytes

  4. DOption (d)

    400 kilobytes

View answer & explanation

Correct answer

Answer: (a)A.

450 kilobytes

Why this answer is correct

Concept:

Raster scan system; In this, electron beam move on the screen from top to bottom covering each row one by one.

Explanation:

Given resolution of the system is: 640 × 480

We have to store 12 bits per pixel.

Frame buffer size = resolution (number of pixels) × number of bits per pixel

Frame buffer size = (640 × 480) × 12 = 3686400 bits

Convert it into bytes.

Frame buffer size = 3686400/8 = 460800 Bytes = 460 .8 KB

It is approximately equal to 450KB which is option 1)

Question 78

Let Aα0 denotes the α-cut of a fuzzy set A at α0. If α1 < α2, then

  1. AOption (a)

    Aα1 ⊇ Aα2

  2. BOption (b)

    Aα1 ⊃ Aα2

  3. COption (c)

    Aα1 ⊆ Aα2

  4. DOption (d)

    Aα1 ⊂ Aα2

View answer & explanation

Correct answer

Answer: (a)A.

Aα1 ⊇ Aα2

Why this answer is correct

Concept:

Alpha cut in a fuzzy set:

An α cut of a fuzzy set A is a crisp set that contains all elements in U that have membership value in A greater than or equal to α.

Explanation:

Aα0 = α-cut of a fuzzy set A at α0

If we take α1 < α2.

Consider an example for this:

Fuzzy set A on interval x[1, 5], membership function(uA) is = x/x + 2

Case 1: First find α0.2

x can be 1, 2, 3, 4 and 5

when x = 1, uA = 1/1 + 2 = 1/3 = 0.33

When x = 2, uA = 2/2 + 2 = ½ = 0.5

When x = 3, uA = 3/3 + 2 = 3/5 = 0.6

When x = 4, uA = 4/4 + 2 = 4/6 = 0.66

When x = 5, uA = 5/7 = 0.71

Alpha cut for α = 0.2 is {1, 2, 3, 4, 5}

Case 2: Take α0.5

Alpha cut for this set is {2, 3, 4, 5}

From here it is clear that set 2 is subset of set 1. i.e. Aα1 ⊇ Aα2

Question 79

A web application and its support environment has not been fully fortified against attack. Web engineers estimate that the likelihood of repelling an attack is only 30 percent. The application does not contain sensitive or controversial information, so the threat probability is 25 percent. What is the integrity of the web application?

  1. AOption (a)

    0.625

  2. BOption (b)

    0.725

  3. COption (c)

    0.775

  4. DOption (d)

    0.825

View answer & explanation

Correct answer

Answer: (d)D.

0.825

Why this answer is correct

Concept:

Integrity of web application:

Integrity of web application can be found out using the security and threat in that.

Formula:

Integrity = [1 - threat (1- security)]

Calculation:

It is given that, probability or likelihood of repelling an attack = 30%

I.e. probability of security = 0.30

Threat probability is given as 25% or 0.25

So, integrity = [1- 0.25 (1- 0.30)]

Integrity = [1- 0.25 (0.70)]

Integrity = 1 - 0.175 = 0. 825

Question 80

For a magnetic disk with concentric circular tracks, the seek latency is not linearly proportional to the seek distance due to

  1. AOption (a)

    Non-Uniform distribution of requests

  2. BOption (b)

    arm starting or stopping inertia

  3. COption (c)

    higher capacity of tracks on the periphery of the plate

  4. DOption (d)

    use of unfair arm scheduling policies

View answer & explanation

Correct answer

Answer: (b)B.

arm starting or stopping inertia

Why this answer is correct

Concept:

Seek latency: It is the time required to move the disk arm to the required track.

Explanation:

As, seek latency is depending on the movement of the disk arm, when read -write head moves from one track to other track to reach the desired track, there is a change in the speed and direction of read write with every change in the track. This is known as inertia. Due to this inertia, seek latency cannot remain linearly proportional to the seek distance.

Seek time is not linearly compared with seek distance because of start and stooping inertia of disk arm. (acceleration and deceleration of arm).

Question 81

How many states are there in a minimum state automata equivalent to regular expression given below?

Regular expression is a * b(a + b)

  1. AOption (a)

    1

  2. BOption (b)

    2

  3. COption (c)

    3

  4. DOption (d)

    4

View answer & explanation

Correct answer

Answer: (c)C.

3

Why this answer is correct

Regular expression: a * b(a + b)

Language that is accepted by this expression is of type: {ba, bb, bab, aba, abb, abab, aabab, ……..}

Smallest string length is 2, that is, we need at least 3 states for this.

NFA for this regular expression is:

So, number of states required in this NFA are 3.

Question 82

The fault can be easily diagnosed in the microprogram control unit using diagnostic tools by maintaining the contents of

  1. AOption (a)

    Flags and Counters

  2. BOption (b)

    Registers and counters

  3. COption (c)

    Flags and registers

  4. DOption (d)

    Flags, registers and counters

View answer & explanation

Correct answer

Answer: (d)D.

Flags, registers and counters

Why this answer is correct

Concept:

Control unit: It provides control signals for the operation and coordination of all processor components. Traditionally, microprogramming implementation has been used, in which major components are control memory, microinstruction sequencing logic and registers.

Explanation:

Within the computer, a control unit manages the computer’s resources and orchestrates the performance of its functional parts in response to the instructions.

Microprogrammed control unit operates by executing instructions that define the functionality of the control unit. In this, set of microinstructions is stored in the control memory. The control address register contains the address of the next microinstruction to be read. When a microinstruction is read from the control memory, it is transferred to a control buffer register. Next element is sequencing unit that loads the control address register and issues a read command.

Question 83

Using the phong reflectance model, the strength of the specular highlight is determined by the angle between

  1. AOption (a)

    The view vector and the normal vector

  2. BOption (b)

    The light vector and the normal vector

  3. COption (c)

    The light vector and the reflected vector

  4. DOption (d)

    the reflected vector and the view vector

View answer & explanation

Correct answer

Answer: (d)D.

the reflected vector and the view vector

Why this answer is correct

Phong reflectance model:

  • It is local illumination model. In real world, light is shown with the help of its spectrum. In computer graphics, light color is made of a triplet that is of three colours RGB(red, green and blue).
  • The reflectance spectrum is a triple of percentage. The light seen on a surface can be divided into four components such as : emissive component, ambient component, diffusive component, specular component.

Specular component:

This component shows the reflected light in a specific direction. It reflects on the basis of refection of incident light. The specular light depends on the position of observer with respect to the surface.

Specular component finds the strength of specular height by using a formula which is the multiplication of specular surface constant with specular intensity and with dot product of reflection direction and the direction of surface towards the view. It means it is determined by the angle between reflected vector and view vector.

Question 84

With respect to relational algebra, which of the following operations are included from mathematical set theory

(a) join

(b) Intersection

(c) Cartesian product

(d) Project

  1. AOption (a)

    (a) and (b)

  2. BOption (b)

    (b) and (c)

  3. COption (c)

    (c) and (d)

  4. DOption (d)

    (b) and (d)

View answer & explanation

Correct answer

Answer: (b)B.

(b) and (c)

Why this answer is correct

Concept:

Relational algebra: It is a procedure-oriented language. In this, we use relation as values instead of numbers. It works on relational model. Main work is to retrieve data, perform operations such as insert, delete, update etc.

Explanation:

  • Basic operations in relational algebra are: Select, project, union, set difference, Cartesian product, rename.
  • Other operations are natural join, intersection, division.
  • From the above options, operator that are included from mathematical set theory are intersection and Cartesian product.
  • In mathematical set theory, intersection is used to find the common elements between two sets. It works same in relational algebra.
  • Cartesian product is used to find the multiplication of two sets by including common elements only once.

Question 85

Which of the following is an example of unsupervised neural network?

  1. AOption (a)

    Back propagation network

  2. BOption (b)

    Hebb network

  3. COption (c)

    Self-organizing feature map

  4. DOption (d)

    Both 2 & 3

View answer & explanation

Correct answer

Answer: (d)D.

Both 2 & 3

Why this answer is correct

Concept:

Unsupervised neural network:

  • Unsupervised learning is used when there is no knowledge of the system or the cost of knowledge of the system is high.
  • It is not guided network. There are unlabelled data sets in this.

Explanation:

Hebb Network:

  • This is an unsupervised learning algorithm. It follows Hebb's rule, which updates weights based on the correlation between input and output neurons without requiring labeled data.

Self - organizing feature map:

  • It is a type of artificial neural network that is trained using unsupervised learning to produce low dimensional representation of the input space of samples called a map.
  • They apply competitive learning as opposed to error – correction learning.
  • Self-organizing maps starts from initializing the weight vectors. In this, a sample vector is selected randomly, and map of weight vectors is searched to find which weight best represents the sample.

 

Backpropagation Network:

  • This is a supervised learning algorithm. It requires labeled data to train the network by minimizing the error between the predicted output and the actual output.

Question 86

Consider the following properties with respect to a flow network G = (V, E) in which a flow is a real-valued function f :

V × V → R

P1: For all u,v ε V, f(u, v) = -f(v, u)

P2: Σv ε V f(u, v) = 0 for all u ε V

Which one of the following is/are correct?

  1. AOption (a)

    Only P1

  2. BOption (b)

    Only P2

  3. COption (c)

    Both P1 and P2

  4. DOption (d)

    Neither P1 nor P2

View answer & explanation

Correct answer

Answer: (a)A.

Only P1

Why this answer is correct

Flow for a real valued function f: V x V → R should satisfy following two properties:

  1. skew symmetry property: i.e. f(u, v) = -f (v, u)

  2. capacity constraint means flow should be less than the capacity of the. It cannot exceed the capacity i.e. f(u, v ) < = c(u, v)

  3. Flow conservation: It means no vertex except the source and destination creates or store the flow. Net flow should be 0.

i.e. for all u ϵ V - {s, t}, ΣvεV f(u, v) = 0.

Question 87

Which of the following statements is/are true with regard to various layers in the Internet stack?

P: At the data link layer, a packet of transmitted information is called a frame

Q: At the network layer, a packet of transmitted information is called a segment

  1. AOption (a)

    P only

  2. BOption (b)

    Q only

  3. COption (c)

    P and Q

  4. DOption (d)

    Neither P nor Q

View answer & explanation

Correct answer

Answer: (a)A.

P only

Why this answer is correct

Concept:

OSI model is a layered framework for the design of network systems that allows communication between all types of computer systems. It consists of seven layers but related layers each of which defines a part of the process of moving information across a network.

Explanation:

The seven layers from bottom to top are as follows: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer.

But here we have to focus only on data link layer and network layer.

Data link layer:

This layer is responsible for moving frames from one hop to next. Data link layer divides the stream of bits received from the network layer into manageable units called frames. It adds a header to the frame to define the sender and receiver of the frame. It provides a flow and error control mechanism.

Network layer:

It is responsible for the delivery of individual packets from source host to the destination host. When two systems are attached to different networks with connecting devices between them, there is a need for the network layer to accomplish source to destination delivery of packets. Smallest unit of data that is transmitted is known as packet in network layer.

Question 88

Consider an LPP given as

Max Z = 2x1 - x2 + 2x3

Subject to the constraints

2x1 + x2 ≤ 10

x1 + 2x2 - 2x3 ≤ 20

x1 + 2x3 ≤ 5

x1, x2, x3 ≥ 0

What shall be the solution of the LPP after applying first iteration of the Simplex Method?

  1. AOption (a)

    x1 = 5/2, x2 = 0, x3 = 0, Z = 5

  2. BOption (b)

    x1 = 0, x2 = 0, x3 = 5/2, Z = 5

  3. COption (c)

    x1 = 0, x2 = 5/2, x3 = 0, Z = -5/2

  4. DOption (d)

    x1 = 0, x2 = 0, x3 = 10, Z = 20

View answer & explanation

Correct answer

Answer: (b)B.

x1 = 0, x2 = 0, x3 = 5/2, Z = 5

Why this answer is correct

Given max z = 2x1 - x2 + 2x3 + 0s1 + 0s2 + 0s3

2x1 + x2 + s1 = 10

x1 + 2x2 - 2x3 + s2 = 20

x1 + 2x3 + s3 = 5

Initial simplex table:

Cj = 2-12000Theta
CBBaseX1X2X3S1S2S3b
0S121010010ND
0S212-201020-10
0S310200155/2
Zj = ∑cBxj\sum {c_B}{x_j}000000
Cj = cj- zj2-12000

 

Here in Cj, we have two numbers which are highest (i.e 2 in column 1st and 2 in column 3rd)

So, we can choose any column to begin with :

So, lets start with column 3rd for convenience.

Hence column 3rd become key column.

Now, we find Theta = b/corresponding key column element.

Now choose the lowest positive number including zero in Theta and mark it key row.

Intersection on key column and key row is key element

Key column is xu

Key row is the minimum value in theta i.e. 1st row. Key element is 2(S1x1).

But key element should be 1 so, divide the complete row by 2.

Cj2-12000
CBBaseX1X2X3S1S2S3b
0S121010010
0S202001115
2X3½0100½5/2
Zj = ∑cBxj\sum {c_B}{x_j}0000005
CJ = Cj- zj2-12000

 

Hence 1st Iteration table is prepared.

  • b indicates value of variables which is corresponding in column cj (only take the give Xi variables).Therefore, x1 = 0, x2 = 0, x3 = 5/2
  • b indicated values of ZMax in Row CJ and therefore Zmax = 5

Question 89

Which of the following terms best describes Git?

  1. AOption (a)

    Issue Tracking System

  2. BOption (b)

    Integrated Development Environment

  3. COption (c)

    Distributed Version Control System

  4. DOption (d)

    Web-Based Repository Hosting Service

View answer & explanation

Correct answer

Answer: (c)C.

Distributed Version Control System

Why this answer is correct

Git is an open source distributed version control system. Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

  • Local version control system: In this, files are copied into another directory. This approach is very common. In this, it is easy to forget which directory you are in and accidentally write to the wrong file.
  • Centralized version control system: The next issue people encounter that they need to collaborate with developers on other systems. These systems have a single server that contains all versioned files and number of clients that check out file from central place. Main disadvantage is that a single point of failure can cause the entire system down.
  • Distributed version control system: In this, client do not just check out the latest snapshot of the files, they fully mirror the repository. Thus, if any server dies, and these systems were collaborating via it, any of the client repositories can be copied back up to the server to restore it. Every clone is fully backup of all the data.

Diagram:

Question 90

For which values of m and n does the complete bipartite graph km, n have a Hamilton circuit?

  1. AOption (a)

    m ≠ n, m, n ≥ 2

  2. BOption (b)

    m ≠ n, m, n ≥ 3

  3. COption (c)

    m = n, m, n ≥ 2

  4. DOption (d)

    m = 2, m, n ≥ 3

View answer & explanation

Correct answer

Answer: (c)C.

m = n, m, n ≥ 2

Why this answer is correct

Concept:

Complete bipartite graph : In this graph, vertices are partitioned into two sets, such that no vertices are connected in the same set and all vertices of one set are connected to all other vertices of different set. All possible pairs of edges are considered except edges in the same set.

Explanation:

Hamiltonian circuit: In this circuit, every vertex is visited only once. It must start and end at the same vertex.

In complete bipartite graph Km, n, when m = n, then in that case, it has a Hamiltonian circuit.

Consider m = n = 3.

Hamiltonian circuit possible in this is: {1, 4, 2, 6, 3, 5, 1}

Question 91

The RSA encryption algorithm also works in reverse, that is, you can encrypt a message with the private key and decrypt it using the public key. This property is used in

  1. AOption (a)

    Intrusion detection systems

  2. BOption (b)

    Digital signatures

  3. COption (c)

    Data Compression

  4. DOption (d)

    Certification

View answer & explanation

Correct answer

Answer: (b)B.

Digital signatures

Why this answer is correct

RSA encryption algorithm when works in reverse, it uses digital signature technique. Step by step method of this is as follows :

  1. Sender (A) uses the SHA -1 message digest method to calculate the message digest over the original message (M).

  2. Sender now encrypts the message digest with his/her private key and that output is called as digital signature of sender.

  3. Now, sender sends the original message along with digital signature to receiver B.

  4. After that, when it reaches to the receiver, receiver decrypts this using the sender’s public key.

Question 92

Which of the following features is supported in the relational database model?

  1. AOption (a)

    Complex data-types

  2. BOption (b)

    Multivalued attributes

  3. COption (c)

    Association with multiplicities

  4. DOption (d)

    Generalization relationship

View answer & explanation

Correct answer

Answer: (c)C.

Association with multiplicities

Why this answer is correct

Concept:

RDMS (Relational database management system) is structured in database tables. It stores the data into collection of tables which are related by some fields. Goal of RDBMS is to generate a set of relation schema that allows us to store information without unnecessary redundancy and to retrieve information easily.

Explanation:

Composite data types:

Those data types that are composed of other existing data types such as date, images, time etc. They are used as objects. Complex data types are not allowed in RDBMS. These are stored in LOB, they cannot be accessed directly in RDBMS.

Multivalued attributed:

An attribute that contains more than one value for with it. It is not allowed in RDBMS. An attribute can contain only one value at one time.

Association with multiplicities:

Multiplicity means the cardinality of a particular entity which can be associated with other entities. In terms of database, it means participation and cardinality of the relation. It is allowed in RDBMS.

Generalization relationship:

Generalization means combination of lower entities to form a higher entity. Entities are combined which have common attributes.

Question 93

How many bit strings of length ten either start with a 1 bit or end with two bits 00?

  1. AOption (a)

    320

  2. BOption (b)

    480

  3. COption (c)

    640

  4. DOption (d)

    768

View answer & explanation

Correct answer

Answer: (c)C.

640

Why this answer is correct

Strings of length 10 with starting bit as 1:

As, 1 bit is fixed, we have left with 9 positions, bit used are 2(0&1). So, total possible strings with this are 29.

Strings of length 10 that end with 00:

In this, 2 position are fixed, we are left with only 8 positions. Total possible strings with this are 28.

Strings of length 10 that starts with 1 and end with 00:

In this, 3 position are already fixed, and we have only 7 positions. Total strings possible are 27.

Now strings possible that starts with 1 or end with 00:

A U B = A + B - A ꓵ B

A U B = 29 + 28 - 27 = 512 + 256 - 128 = 640

Question 94

How many cards must be selected from a standard deck of 52 cards to guarantee that at least three hearts are present among them?

  1. AOption (a)

    9

  2. BOption (b)

    13

  3. COption (c)

    17

  4. DOption (d)

    42

View answer & explanation

Correct answer

Answer: (d)D.

42

Why this answer is correct

Total cards = 52

There are 13 cards of each type i.e. 13 of spade, 13 of diamond, 13 of club, 13 of hearts.

Worst case is when we select all other before any hearts.

It means select 13 spade, 13 diamond, 13 clubs. Total 39 cards.

To guarantee at least 3 hearts are chosen, 39 + 3 = 42 cards should be selected.

Question 95

Hadoop (a big data tool) works with number of related tools. Choose from the following, the common tools included into Hadoop:

  1. AOption (a)

    MySQl, Google API and Map reduce

  2. BOption (b)

    Map reduce, Scala and hummer

  3. COption (c)

    Map reduce, H base and Hive

  4. DOption (d)

    Map reduce, hummer and Heron

View answer & explanation

Correct answer

Answer: (c)C.

Map reduce, H base and Hive

Why this answer is correct

  • Hadoop is an open source platform providing highly reliable, scalable, distributed processing of large data sets using simple programming models.
  • Hadoop provides a reliable shared storage and analysis system. In this, storage is provided by HDFS (Hadoop distributed file system) and analysis by MapReduce.
  • HDFS breaks a file into chunks and distributed them across the nodes of the cluster. It stores large amount of data on local disks across a distributed cluster of computers. It is written in java.
  • Hadoop work with the tools: Map Reduce, H base, hive.

Hbase:

It is a distributed, column- oriented database. HBase uses HDFS for its underlying storage and supports both batch style computations using Map Reduce and point queries.

Map Reduce:

A distributed data processing model and execution environment that runs on large clusters of commodity machines.

Hive:

It is a distributed data warehouse. Hive manages data stored in HDFS and provides a query language based on SQL.

Question 96

Consider the following C-code fragment running on a 32-bit x86 machine:

typedef struct

{

union

{

unsigned char a;

unsigned short b;

}

unsigned char c;

}S;

S B[10];

S *p = &B[4];

S *q = &B[5];

p → U.b = 0x1234;

/* structure S takes 32-bits */

If M is the value of q-p and N is the value of ((int) & (p→ c))-((int)p), then (M, N) is

  1. AOption (a)

    (1, 1)

  2. BOption (b)

    (3, 2)

  3. COption (c)

    (1, 2)

  4. DOption (d)

    (4, 4)

View answer & explanation

Correct answer

Answer: (c)C.

(1, 2)

Why this answer is correct

In this, size of short int = 4 bytes

S *p = &B[4]; // p is having the address of B[4]

S *q = &B[5]; // q is having the address of B[5].

Suppose B[4] address is 116 [take base address as 100].

So, B[5] will come as, 120

q - p will be = (address of B[5] - address of B[4])/ 2

q - p = (120 - 116)/ 4 = 4/4 = 1

Also, M is equal to q - p (given in the question). So, M = 1

Now, we have to find the value of N = ((int) & (p → c))-((int)p),

Here, c is a char and it is type casted to int.

((int) & (p → c)) - ((int)p // address difference between p’s starting address and c address will be of 2 bytes only.

So, N becomes 2.

∴ (M, N) = (1, 2)

Question 97

How can the decision algorithm be constructed for deciding whether context-free language L is finite?

(a) By Constructing redundant CFG in CNF generating language L

(b) By constructing non-redundant CFG G in CNF generating language L

(c) By constructing non-redundant CFG in CNF generating language L-{∧} (∧ stands for null)

Which of the following is correct?

  1. AOption (a)

    (a) only

  2. BOption (b)

    (b) only

  3. COption (c)

    (c) only

  4. DOption (d)

    None of (a), (b) and (c)

View answer & explanation

Correct answer

Answer: (c)C.

(c) only

Why this answer is correct

We can check that whether a context free language L is finite or not by contracting non redundant context free grammar in which there are no null productions, no unit productions and no useless productions.

Steps that are used in deciding whether a context free language is finite or not?

  1. Construct the context free grammar corresponding to that language.

  2. Reduce the grammar by removing null, unit and useless productions.

  3. Construct the directed graph of that grammar.

  4. If that graph contains a cycle, then that language is infinite.

  5. If graph does not contain cycle, it means language is finite.

Example:

S - > XY/ x

X -> YZ/ y

Y -> ZZ /z

This grammar is already reduced.

Graph for this is:

This graph does not contain any cycle, so language is finite for this.

Question 98

Which of the following statements is/are TRUE?

P: In software engineering, defects that are discovered earlier are more expensive to fix

Q: A software design is said to be a good design, if the components are strongly cohesive and weakly coupled

Select the correct answer from the options given below:

  1. AOption (a)

    P only

  2. BOption (b)

    Q only

  3. COption (c)

    P and Q

  4. DOption (d)

    Neither P nor Q

View answer & explanation

Correct answer

Answer: (b)B.

Q only

Why this answer is correct

Statement P: In software engineering, defects that are discovered earlier are more expensive to fix

This statement is not correct. In software engineering, defects which are early detected are easier to fix. It reduces error fixing cost. It increases the productivity. Early defect detection improves the overall quality of software.

Statement Q: A software design is said to be a good design, if the components are strongly cohesive and weakly coupled.

Coupling: Coupling in software engineering mean interdependence between the modules. Cohesion means how the elements of one module are related with each other. It means intra-dependency between the module. For a good software design, low coupling and high cohesion is desired. So, this statement is correct.

Question 99

Consider the following C++ function f() :

unsigned int f(unsigned int n)

{

unsigned int b=0;

while(n)

{

b+=n&1;

n>>=1;

}

return b;

}

The function f() returns the int that represents the___p___in the binary representation of positive integer n, where P is

  1. AOption (a)

    number of 0's

  2. BOption (b)

    number of bits

  3. COption (c)

    number of consecutive 1's

  4. DOption (d)

    number of 1's

View answer & explanation

Correct answer

Answer: (d)D.

number of 1's

Why this answer is correct

b += n&1;               // it performs the binary AND operation and then add result with b

Consider n as 5;

So, binary representation of n is 101

Initially b= 0

B += n&1;       // it means b= 0 + 101 & 001 ; b = 0 + convert to decimal (001) ; b= 1

n>> 1;             // n is right shifted to 1

So, n becomes 010

b += n&1;

this gives b = 1 + 010 & 001; b = 1 + 0; b= 1

Again, n is right shifted; n becomes 001

b+=n&1;            // b = 1 + 001 & 001; b = 1 + 1 = 2

Again, n is right shifted, n becomes 000

while(n)                  // it becomes false

Program will return the final value of b; which is 2.

which is equal to the number of 1’s in the binary representation of n.

Question 100

Match List-I with List-II:

List-IList-II
(a) Greedy best-first(i) Minimal cost (p)+h(p)
(b) Lowest cost-first(ii) Minimal h(p)
(c) A* algorithm(iii) Minimal cost (p)
<br>

Choose the correct option from those given below:

  1. AOption (a)

    a)-(i); (b)-(ii); (c)-(iii)

  2. BOption (b)

    (a)-(iii);(b)-(ii); (c)-(i)

  3. COption (c)

    (a)-(i); (b)-(iii); (c)-(ii)

  4. DOption (d)

     (a)-(ii); (b)-(iii); (c)-(i)

View answer & explanation

Correct answer

Answer: (d)D.

 (a)-(ii); (b)-(iii); (c)-(i)

Why this answer is correct

Greedy best first search: 

  • It always finds the path that appears best at that time.
  • It uses both the depth first search and best first search algorithms.
  • In this, at each step, a best node is chosen and with this we reach to the goal of the problem.
  • Cost is estimated with the use of heuristic function. Cost of greedy best first search is h(p).

Lowest cost first:

  • It aims to find the solution such that no other solution has lower cost than that.
  • It uses the breadth first search algorithm.
  • It does not expand the path; it directly finds a path with the lowest cost.
  • Cost for this algorithm is (p).

A search algorithm:*

  • A* search algorithm minimizes the total cost of the solution.
  • It uses the cost to reach a node and cost to reach the goal from that node.
  • Overall cost of A* search algorithm is the addition of both these costs, that is, Minimal cost (p) + h(p).

100 questions in the full paper