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

Assistant Scientist (Server & Data Security)

Uploaded by

kanishk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Assistant Scientist (Server & Data Security)

Uploaded by

kanishk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Squ/t/v 4 D^16, U-L'"JJ t"

2023 J
HPSC

Time:3hours] tMaximumMarks:l5O
't

I
I

QUESTTON pApER SPECTFTC TNSTRUCTTON9

{ Pleaseread each of the following instructions carefully before attempting


questions )

0 There are eighteen (18| questions, all printed in English only.

(iil Candidate has to attempt any fifteen (15f questions in all.

(iii) Each question carry ten marks.

(tu) Word limit in questions, wherever specified should be adhered to. r

(u) Attempts of questions shall be counted in sequential order. Unless


struck off, attempt of a question will be counted even if attempted
partly. Any page or portion of the page left blank in the question-cum-
answer booklet must be clearly struck off

(ui) Answer to the questions must be confined only to the space provided
for each question. No extra/additional sheet will be provided.

(uiil Answer must be written in the authorized medium. No marks will be


given for answers written in a medium other than the authorized
one.

rpsc/658 lP.T.O.
1. (a) Show that any finite integral domain is a field'

(b) A biased coin with probability of obtaining head equal to p ' 0, is tossed
repeatedly and independently until the first head is observed. Calculate
the probability that the first head appears at an even numbered
toss.

2. Show that a connected graph is bipartite if and only if all the cycles are of
10
even length.

g. (a) Design a minimum state Definite Finite Automata (DFA) for the following
language :

L= {w € {0, } | ur has both an even number of 0's and an even


number of l's )

(b) State whether the following statements are true or false. Give
justifications :

(t) o.bibick 1,. J) Ut.{aiAic. li. t} is a DCFL (Deterministic Context-


Free Language).

@ ltiuickl,.r) U{',ibickli'k} is a DCFL (Deterministic


Context-Free Language). 5

4. Consider the following NFA. Draw the corresponding transition table for the
NFA and then appty subset construction on the same' 10

,1

Figure 1. NFA for the above problem'

5. Suppose you are given an array All..rl with n entries, with each entry A[ i]
holding a distinct number. You are told that there is some index p between
1 and n, such that the values in the afiay entries decrease up to position p
in A and then increase the remainder of the way until position n. show how
to find the index p by reading at most Qlog n) entries of A. 10

npsc/658
6. (a) Give an expression for the minimum number of nodes, s(h), in an AVL
tree of height h- Also, prove that the expression is correct.

(b) Show how to implement a queue using two ordinary stacks so that the
amortized cost of each ENQUEUE and each DEeUEUE operation
is o(1).

7. (a) Give 2's complement and 1's complement representations for the
following (assume 8 bits machine) : 4

(i) _1

(iil -o
(b) List out some major differences between the two representations. G

8. Write a function in C programming language which reverses the input string


s in place. To be precise, complete the following C-code :
#include<stdio.h>
#include<string.h>
void reverse(char s[])
f
I

Complete this function


t
I

int mainfi
{

char vJ1:"abcdefgh";
reverse(v);
printf("reverse of v is %os", v);

return 0;

Output : reverse of v is hgfedcba. 10

HPsc/658
lP.T.O.
9. Describe relational databases in detail along with examples. 10

10. Consider the set of 7 processes whose arrival time and burst time are glven
in Figure 2. Assuming that the CPU scheduling policy is Shortest Job First
(SJF), draw.

Process ID Arrival Time Burst Time


Pt o 8
P2 1 6
Ps 2 4
P4 -
J 1

Pb 5 2
P6 6 1

ry 7 3

Figure 2. Table for problem (10)


the Gantt chart. What is the waiting time of process Pr? Now assume that
the CPU scheduling policy is Shortest Remaining Job First (SRJF). Again
draw the Gantt Chart. Now what is the waiting time of the process Pr?
5+5:10

11. Write the major differences between transport layer and data link layer.
10

t2. Suppose that the stop-and-wait protocol is used on a link with a bit rate of
64 kbps and 20 ms propagation delay. Assume that the transmission delay
for the acknowledgement and processing time at nodes are negligible. Then
what is the minimum frame size in bytes to achieve a link utilization
of at least SOVy? 10

13. Construct LL(1) parsing table for the grammar given below : 1O

E -+ TB'
E' -+ +TE' f e
T -+ FT'
T' --> *FT' /t
F -+ id l{E)

xpsc/65B 4
L4. Consider the following recursive function :
int X(int N)
{
if(iv < 3)
return L;
else
return X(iV- 1) + XUV- 3) + 1;

)
How many invocations of the function X are there, while evaluating X(X(s))? 10

15. Consider the below 9 bits register where the mantissa is normalized fraction
which is denoted in signed magnitude form. The excess-8 (biased = 8) exponent
is used along with mantissa to denote the floating point number. If the base
of the system is 2, what is the value represented by (605)8 in the below
register? 10
, Normalized ,

k-,;#ff"1+3?#"',;
I
urauisd
I
'e
I
S

1 1 0 0 olo 1 o 1

Figure 3. 9 bits register containing (605)8 for Q. No. (15).

15. Consider the following C code :

#include<stdio.h>
void YYZ(char *s, char *t)
{
'I

while(*s+1 = *1++);
I
I
int mainfl
tt

char s[] ='I am okay!";


char t[] : "Fine"i
XYZ(s, t);
printf("s:7os\n", s);
printf("t:7os\n", t);
return 0;
)
What is the output of this code? Explain precisely the function X{2. 10
rpsc/65B 5 [p.T.O.
17. (a) What is regression testing? Explain how the use of automated tests and
a testing framework such as J unit simplilies regression testing' 5

(b) write a scenario that could be used to help design tests for the wilderness
5
weather station sYstem'

1g. What is d,efuzz:.fication? Describe few strategies and analyze their main
10
properties and interrelationships'

***

rpsc/658 6
HPsc/658 7 lP.T.O.

You might also like