Google
 

Sunday, May 6, 2007

HUGHES @ IITK 25/08/97

****************************************************************************
HUGHES
****************************************************************************
Source : iit k ( this paper is got from rookee and same is given in iitk)
Dated :25/08/97

section A 30m (Compulsary)
section B or C 20 m(changed )m
Attempt either B or C sec B contains CST
C E&C
Better to attempt Electronics paper
(Those who are having electronics background)
----------------------------------------------------------------------------
SECTION A

1. Which of the folowing is not correct
a. (x+y)'=x'.y' b. (x'+y')'=x.y
c. (x'.y')'=x+y d. (x'+y')'=x'.y' [d]

2. Question on logic ckt. U have to find the output
ans. AB'+CD'+EF'

3. Output of MUX
_________
c-----| |
c'----| |-------Y
c'----| | ans. A xor B xor C
c-----| |
---------
| |
A B (select lines)

4.If X and Y are two sets. |X| and |Y| are corresponding
coordinates and exact no.of functions from X to Y is 97
then
a. |X|=97 |Y|=1 b. |X|=1 |Y|=97
c. |X|=97 |Y|=97 d. .....

5. If two dies are thrown simultaneously what is the prob.
of one of the dice getting face 6 ?
a. 11/36 b. 1/3 c. 12/35 d. 1/36 [a]

6. The relation ,<,on reals is
a. a partial order because of symmetric and reflexive
b. ... antisymmetric and ....
c. not ...... .. asymmetric and non reflexive
d. ... .... not anti-symm and non reflexive

7. In C language the parameters are passsed by
a. values b. name c.referrence d....

8. Advantage of SRAM over DRAM
ans. faster

9. Diasy chaining related question (refer Z80)
a. uniform interrupt priority
b.non .... ....
c.interfacing slower peripherals
d.....

10. RAM chips arranged in 4X6 array and of 8kX4bit capacity
each. How many address lines reqd. to access each byte
a. 12 b. 16 c.15 d. 17

11.Question related to AVL trees regarding how many no.of
nodes to be changed to become balanced after addition of
a leaf node to a particular node.
ans . 3

12.When following sequence is insertedin the binary search tree
no.of nodes in left and right subtrees
52 86 64 20 3 25 14 9 85

13.Method used for Disk searching..
a.linked list b.AVL c.B-tree d. binary tree

14. Which of the following is correct statement.
a. 1's complement can have two zero re[resentations
b.2's ... ... represent an extra neg. number
c.2's & 1's have no difference in representing 16-bit no.
d.......

15. AX=B where A is mXn ,b&X are column matrices of order m
a. if m LESS THAN n, X has infinite solutions
b.if m=n, rank of A c.... d....

16. The option avialable in C++, not C:
a.dynamic scoping
b.declaration in the middle of code block
c.seperate compiled and linked units
d. ....

17. int a[4]={1,2,3,4};
int *ptr;
ptr=a;
*(a+3)=*(++ptr)+(*ptr++);
A part of code is shown. The elements in A after
the execution of this code.
a.1 2 3 4 b. 1 2 3 6
c. compilation error d.1 2 2 4 [a]

18. Critical section program segment is
a. enclosed by semaphores with P & V operations
b. deadlock avoidance
c. where shared resources are accessed
d. ...


19. when head is moving back and forth, the disk scheduling
algorithm is _____
a) scan b) sstf c) fcfs d).....

20. how many times the loop will execute

LOOP LXI B,1526H
DCX B
JNZ LOOP
a)1526H times b) 31 c)21 d)38

21. the addressing mode in which the address of the operand is
expressed explicitly within the instruction
a)index addressing b)absolute c)indirect d) immediate

22. (A - B) U (B - A) U (A ^ C) = ?
where A,B are two sets A' , B' are compliments of A and B
a) A U B b) A ^ B c).... d).....

23. the network that does not use virtual circuit
a) IP b) X.25 c).... d).....

24. source routing bridge
a)source will route the frame
b)frame will routed with info in header
c).... d).....

26. cache access time 100 msec. main memory access time 800 msec
if the hit ratio is 95% , what is mean access time ...

27. the module that should be always reside in main memory is
a) loader b)link module c)... d)....

.... and some questions related to

1. addressing mode 2.assembler passes 3.linking and loading
4. file directory search 5. turning machine
6. finite state machine 7. daisy wheel

28. The order of algorithm to merge the two sorted lists of
lengths m and n is
a. O(m) b. O(n) c. O(m+n) d. O(log(m)+log(n))
29.A chocolate block is of 4 X 4 size.How many cuts are needed
to make 1 X 1 size blocks. No simultaneous vert. & horz. cuts.

30. Which among the following is not correct
a. O(n) > O(log n) .. likewise
-----------------------------------------------------------------------------

HUGHES PAPER

Hughes paper:
total 50 questions (1 hour).
Paper is like GAte CS .

section A : compulsory for CS and Comm students.
section B : for CS only
section C : for comm only.


questions :

1. given a digital ckt with nand gates. what is o/p Ans. nor gate
2. given an logical expr. x,y,z. simplify ans. xz
3. It is recommended to use which type of variables in a recursive module.
Ans. static variables.
4. which one of following is not memory management model?

given buddy system, monitors, paging, swapping Ans. monitors
5. what m/c is used to recognize context free grammar ? Ans. pushdown automata
6. Which type of grammar can be recognized by finite state m/c Ans. right linear
grammar.

7. proc() {

static i=10;
printf("%d",i);
}

If this proc() is called second time, what is the o/p Ans. 11

8. int arr[] = {1,2,3,4}
int *ptr=arr;

*(arr+3) = *++ptr + *ptr++;

Final contents of arr[] Ans. {1,2,3,4}

9. TCP/IP hdr checksum : what method is used ?
Ans. one's complement of sum of one's complement.

10. CSMA/Cd is used in which lan Ans. ethernet

11. 8085 pgm : LXI sp, 2021,
LXI b, 1234 (??)

push b

contents of stack after pushing ?

12. One question on synchronous transmission :

ans. Timing info is embedded in data itself
13. What for start bit is used in RS232 transmission.

14. One solution for deadlock prevention for dining philosopher's problem

Ans. Allow one person to take first left stick and then right stick
and remaining persons in reverse order.

15. 4bit seq no in sliding window protocol with selective repeat.
what is the max no. of acks that can be held at transmitter
ans. 8
16. given a height balanced tree. If we add one more node , how
many nodes gets unbalanced ? Ans. 3

17. Given a arbitrary pointer to an element in a singly linked list?
what is the time complexity for its deletion . Ans. O(n)
18. what is the diff b/n c and c++

a. dynamic scoping
b. nested switching
c. declaration of variables in any code block
d. separation of compilation and linking

Ans. c (??)
19. which one is false ?

a. 0 LESS THAN x LESS TAHN y, n power x = O(n power y)
b. root of log(n) = O(log logn)
c. O(logn/100) = O(100 logn)
d. 2n not = O(n power k);

Ans. b or a. (??)
20. S->S+S; s->s*s; s->a

how many parse trees possible : a+a*a+a Ans. 5
21. 4-1 demultiplexer is to be implemented using a memory chip.
how many address lines and word length required Ans. 4, 1

22. Vector intr mechanism. in 8085.

Ans. fixed locations in memory when an intr comes.
23. ARP is used for : Ans. IP to MAC addr conversion.
24. given 100 to 999 nos. Probability of picking a no. with out
digit 7. Ans. 18/25.
25. Ten film rolls. 3 defective, prob. of picking up 2 defective
rolls with out replacement Ans. 6/90
26. The purpose of hashing is :
Ans. O(1) complexity

27. Given adjacency matrix for a directed graph with n vertices
and e edges. How much time will it take to find out indegree
of a vertex Ans. O(n)
28. No. of nodes of degree 2 in a binary tree with n leaf nodes.
Ans. n-1

HUGHES PAPER

++++++++++++++++++++++++++++++++++++++++++
1. CSMA/Cd protocol used in
Ans : Ethernet
2. Checksum in IP packet is
Ans : Sum of the bits and 9's complement of sum
3. Inselective repeat Max Seq is given find windowsize
i.e. Ans : (15+1)/2 = 8
4. Main memory cache direct mapping
Ans : 64
5. Address lines and data lines for 4K x 16
Ans : Addr 12, Data 16
6. Infix to postsize commession uses
Ans : operator stack
7. Printing ofstatic variable
Ans : 11
8. Ans : 1,2,3,4 ( Program is given
array[0] = 1;
array[1] = 2;
array[2] = 3
array[3] = 4
ptr = array[0]
*(arr+3) = *(++array ) + *(array-1)++)
)
There may me some mistique in writing
the program. Check it out.
Answer is correct
9. One Question on Scheduling
Preemptive
10. Which of the following is not memory model
(1) buddy system (2) monitor (3) virtual ... etc.
11. Hight balancing AVC time
Ans : 3
12. Virtual to physical address mapping
page table given
13. regular expression of identifier
L(LUD)*
14. Simplification in boolean Algebra
Ans : xz
15. Logical gate is given we have to find what is that
Ans : NOR
16. Solution for Diriving philofphing
Ans : d
17. The feature C++ have and c donot have
Ans : Variables can be declared inside also.
18. Number of nodes with degree two in a binary tree of n leaves
Ans : n-1
19. Difference between syachronous and asynchronous transmission

20. The question on RS232
(Use of sfart bit in Rs 232 protocal)
21. Floating point representation
Ans : 2's complement
1 more negitive number
Two simple probability questions are also there

Section A : 30
Section B : 20

Total 50 questions in 1 hours
P.S. Paper may change. Delhi question paper is not given here.


HUGES
-----

> > (A)Aptitude :25 Qns, 20 Minutes
> >
> > 1. 2 x 4 analytical GRE type qns
> > 2. 2-3 Reasoning qns (GRE type)
> > 3. Probability of getting a sum of 7 when two dices are thrown together
> > 4. Rest quantitative questions
> >
> > (B) Technical: 50 Qns, 45 Minutes
> >
> > 1. 3 qns on operating systems. I qn on dijkestra algorithm
> >
> > 2. Using which pin it's possible to address 16 bit addresses even though there
> > are only 8 address bits in 8085? Ans: ALE
> > 3. Voltage gain for an amplifier is 100 while it is operating at 10 volts.
> > What is the O/P voltage wen i/p is 1 volt
> > 4. Quality factor indicates a0 Quality of inductor b) quality of capacitor
> > c) both
> > 5. Qns related to bridges, routers and generators, which OSI layer they
> > corresspond to. (Refer to stevens 4th chapter)
> > 6.OPAmp's I/P ciurrent, O/p current and CMRR is given, what is the voltage
> > gain
> > 7. 2-3 qns on scope of static variables in C. Qn to view o/p odf a C static
> > var
> > 8. Qn to print a value of a pointer
> > 9.resistance increases with temperature in a) Metal b) semiconductor
> > 10. A qn to find the physical address from a given virtual address, virtual
> > to physical address table was provided
> > 11. 16 bit mantissa and 8 bit exponent can present what maximum value?
> > 12. 4 bit window size in sliding window protocol, how many acknowledements can be held?
> > 13. Security functionality is provided by which layer of OSI
> > 14. Frequency spectrums for AM, FM and PM (figure given, u'veto tell which
> > Kind of modulation it belongs to)
> > 15. Among AM and FM which is better and why?
> > 16.LASt stage of TTL NAND gate is called: Ans: Totem Pole Amplifier
> > 17. SR to JK flip flop conversion. Ans: S=JQ', R=KQ
> > 18. LSB of a shift register is connected to its MSB, what is formed: Ans:
> > RING Counter
> > 19. 2-3 Qns based on Demorgan's laws (identiies: (A+b)' = A'b', etc)
> > 20. 2 qns on Logic gates (O/p of logic gates)
> > 21. Diff in IRET and RET statements of 8086
> > 22. How many address bytes are required to address an array of memory chips
> > (4 * 6), each chip having 4 memory bits and 8k registers.
> > 23. Diff. in memory mapped and I/P O/P mapped Input/Output (Refer a book on Microprocessor)
> > 24. Qn on pipeline architecture
> > 25 QN on LAPB protocol

Iam really sorry for responding so late.
I wanted to sit with your work but I could not ( because of some problems )
I remember very little about the Dharma test pattern.
There was an Apptitude test. Quantitative and Analytical.
The Quantitative is very easy. You should prepare from GRE or any CAT
Material.
The Analytical part is mostly from Barrons Guide. I remember two questions .
they are from Barron's guide. It is something about a village called "kaya-kaya
" where half the people speak truth and half lies. There was one more about set
of houses of itallian,germans,romman etc in a row whose chimmney colours were
given, their favoritr drinks were given. I hope you will find these questions
in Barron's guide. I did not get a Barron's guide to search them for you. The
interview was mostly about C , C++ . They are mostly working on C++. That will
help if you know. They are working on their own SQL. You should brush up your
fundas in DBMS. In interview there are questions in UNIX Internals also. Hope
this info is of some use to you. Good Luck. Keep me informed on the proceedings
of the campus.

HUGHES @ IISc 2000

HUGHES at IISC 2000

q1) special charracter of c++ regarding oop;
a) funs overloading, b?) polymerisation vc) virtual funs d) data
encapsulation
{
int i=4000;
int j=9000;
main()
{
printf(,i,j);
f(&i,&j);
printf((i,j);
f1(&i,&j);
printf(i,j);



f( int *a, int *b)
{
int *temp;
temp=a;
a=b;
b=temp;
}
f1(int *a,int *b)
{
*b=*a;
*a=500;
}
3) using delaration ---- namespace funda;
4) few questions on inheritence including protcted --- pointer to base
derived class.


5) port address is unique at
a)globaly, b)...
6) ((5+4)*8)*(16+9)*5) convert to prefix
7) there r 2 dices. probabilty to get 7
a) 5/36 b) 7/36 c) 1/36 d) 9/36

8) 4R balls, 5G , 6Y,5O balls. no. of balls are kept linearly . no
of
permutayion that similar color balls will be together.
20! , 6!5!, 4!5!, none

9) a man has color blindness then what will be permutations. ans
may be
24,2,10, none


10_ if the man has closes his eye and arranges then what is the
probability
20,12,24, none


11 3 boys: 3 girls a,b,c: x,y,z a,c unmarried , a& b have a dog. a
thinks
the dog will be with his wife. B's wife thinks that her dog is with
his
husband. they r seated in a line c can sit near x but not near y,z.
now
they have to sit like the distace between dogs is near.
no. of seats between dogs
( one dog is at first other is at 5th)

12) tell the sequence azcxyb
13) X.42 is in which layer
14) TCMP or somewhat like this protocol
15) -------!---------!--------
! !
! R
Z(diode)!
______!______!____

ans) clipper , damper, rectifier, trigger ckt


16
flush as in toilet can be considered electricallyas
a) capaciter b) inductor c) trigger ckt


17) haruard code is
a) orthogonal b) 1

18) which is better
1)semaphore,2) monitor c).....


19 single bit parity checketr can detect
1) 1 bit error 2) 2 bit error etc

20motion estimation is used in
1) satellite 2) communication 3) video




1. What does compiler do? (b is correct)
a. memory management b. symbol table c. -- d.-
2. Kerberos used for- Authentication and security.
3. RSA Algorithm
4. One digital ckt.(simple)
5. One K-map (simple)
6. Min no. of operations in worst case input for - Heap Sort
7. 3 device serially connected, each having a probability of 0.9 of
not
failing. Combined prob. Of the entire ckt to work-0.729 (according
to
me)
8. CONNECT BY command in DBMS
9. Projection in DBMS
10. Program Counter incremented in - Fetch Phase
11. You have to delete a given node in a singly connected link list.
What is
the order of no. of nodes to be traversed - O(n) (acc. To me)
12. Hit ratio for first level cache is 0.9 and access time 100ns, for
second level cache is 0.9 and access time 400ns, memory access
time
is
1000ns. Find time to access an address- 140ns
13. Ping is in - ICMP
14. Def. of Coupling
15. Function pts used in - Software analysis
16. Can DFDs be used in OO Model
17. Protected members in Public class can be accessed by - Don't
remember
the choices.
18. Message to A from B, So B will use- A's private key or A's public
key or
B's private key or B's public key.
19. No. of lines req. to completely connect n nodes - O(n*n)
20. Something on NFS
21. Something on Threaded trees
22. N=2 exp(p) routers, what is the max. hops req. to send a message
between
the farthest two
23. Diff between 3rd and @nd normal form
24. Which is not client server- email access, web access, NFS,
telephone
25. Data structure used to sort direct access or disk files.
26. Least avg waiting time - Shortest job first algo
27. Something on JAVA interface
28. For arithmetic expression evaluation using stack- postfix
29. For diskless systems - RARP
30. Something on dirty bits
31. Something on downloading of Java
32. Bubble sort
33. How to define constant pointer in C
34. Char*(*(*A[X])())() is what
35. Every shared resource has a colocated resource manager for -
concurrency
control,location transparency,replication transparency
36. Can a computer have more than one Domain address and more than one
IP
address
37. Which searches best in binary tree- ht. Balancing, wt. Balancing,
both,
none
38. Heap management is done by library routine - user procedure in user
mode, user proc. In kernel mode, kernel,
39. Something on regression testing
40. IPV6 address bits -128 bits
41. Something on raw IP
40 questions in all, +3 for correct ans ; -1 for wrong one;

1)Question on probability: whats prob that a no b/w 100 & 999(both
inclusive) will not have 7?

2)A question on RARP protocol

3)An algo was given and it was asked as to what does it do??
Ans: evaluate GCD of two numbers

4)a question on cache memory: Disadv of Direct mapped cache memory

5) One question on digial circuits. There were two input variables and
u've
to assign them some values to get the output to be X' + Y;

6)If X'*Y = X+Y and z=X*Y then what is z*X
my answer was not matching any of the alternatives

7)If A and B r two sets then (A-B) U (B-A) U (A intersection B) is:
A U B

8)One question on newton Raphson method find solution to X(square) -
1=0
with initial itertion x=-1

9)A procedure was written and it was asked what will be the result if
procedure calling is call by value, call by reference, call by name etc

10)One question on Page replacement algorithm asking which algo is most
efficient
Ans: The one where the page that will not be used for max time in
future is
replaced

11)An IP packet can get struck into a circular loop while travelling,
which
field in IP header can prevent this::
(i)Source address (ii) destination address (iii) TTL(Time to live)
correct answer(iii)

12)In order to get numbers in sorted order out of a binary tree
Ans: we should do inorder traversal

13) There was a set of data given. U had to tell that How many nodes
will be
there on left and right subtrees, if they were inserted in given order

14) what tree has all the child nodes less than itself
Ans:Heap

15)Which type of data structures can have hetrogeneous elements
(i) array (ii) records (iii) file
Ans (iii)

16)Given bandwidth = 3000 and no of bits transferred per level =8 what
is
Nyquist's max bit rate?
Ans: use formula bitrate = 2*Bandwidth*log(to base 2)of no of bits per
level, therefore Ans=18000bps

17)One question on pulse code modulation. If i remember correctly it
was :
why is it used or when is it used??

18)One question on Graphs, as i haven't done graphs i don't exactly
remember
the question. I guess it was degree of graph given no of nodes and
edges.

19)Given a recursive function
function X(int A)
{
If (A<3)
X=1;
else
X=X(A-1) + X(A-3) + 1
}

U had to tell how many calls does X(X(5)) will make??
Don't remember the answer exactly, but u can work it out!!

20)How many 4 input multiplexers u need to make a 16 input
multiplexer??
Ans: 8

21)What is the worst case for Booth's multiplication algo?

22)SOme question regarding size of ROM:If i remember correctly, it was:
For
multiplication of two 8-bit numbers, what should be the size of ROM?

This is all i could recollect!!

Interview:
Difference between C and C++.
Interrupts, what r they and whats their significance.
C++: inheritance, polymorphism, friend classes etc.
Write an algo to insert a node into singly linked list at a given
location.
B+ tree.
Difference between Win 95 and Win NT.
Regarding the project i m doing in my training.
difference b/w token bus, token ring and ethernet
Multithreading and multitasking.
A few questions on tree balancing , AVL trees and Red Black trees
A question on pointers to pointer,
what do u mean by char ** a[35]
Also asked what is hash table and where it is used??

General:
In OS , semaphores (Ch 6) is most important, and then process
management,
memory management is what u should be thorough with (Ch 4, 8 & 9) Ch 5
is
easy and least important!!

HUGHES SOFTWARE SYSTEMS

_____________________________________________________________________________

Q1)there was a circuit given using three nand gates with two inputs and one output .you have to find the output.
a)or
b)and
c)xor
d)
ans- a) or
Q2)suggest a sorting algo whic is efficient( in worst case) to 10 values
a)binary tree
b)selection
c)bubble
d)any of the above
Q3)what is the number of comparisons in the worst case to merge two sorted lists containing n elements each.
a)2n
b)2n-1
c)2n+1
d)2n-2
Q4)integrated check value(ICV) are used as follow
ans- the client computes the ICV and then compares it with that send
Q5)one question on client server system using asyn. request from the client
Q6)if a binary tree is constructed using nodes with two pointers each ,how many null pointers does a tree with N nodes have
a)n-1
b)n
c)n+1
d)depends on the number of edges
Q7)which of statement about heap is wrong
a)n element heap has height log n(base of log is 2)
b)smallest element of heap is always a leaf
c)a array in reverse sorted order is a heap
d)a heap can't contain any element more than once
Q8)when applets are downloaded from web sites , a byte verifier performs status check, which of following is not true
Q9) void insert(key,r)
typekey key,data array r;
{
extern int n;
if(n>=max) /*error table if full */
else r[n++].k=key;
}
enables a
a)basic sequential search
b)binary search
c)interpolation search
d)none
ans-interpolation search
Q10) void f(char *p)
{
p=(char *) malloc(6);
strcpy(p,"hello");
}

void main( )
{
char *P="bye";
f(p);
printf("%s',p);
}
Q11)time taken to access cache is 100ns and to access memory is 1000ns. hit ratio given you have to find the average access time
ans-take care of the fact that every data transfer takes place through the cache,even if in memory
Q12)path testing is
a)black box testing strategy
b)white box testing strategy
c)an installation .........
d)...... enviornment
Q13) X:'verification" asks are we building the right product
Y:validation' asks are we building the product right
Q14)which one of the following can't be used to find an internet address given the domain name
a)/etc/host
b)NIS yellow pages
c)DNS
d)ARP
Q15)flow control is necessary for the t.p layer due to the following reasons
a)ureliable link
b)congestion at receiver
c)packets out of sequence
d)none of these
Q16)in public key encryption , if A wants to send a message to B so that no one else can read the message then A encrypts the message using
a)A's public key
b)A's private key
c)B's public key
d)B's private key
Q17)which of the following is not condition having a deadlock resource previous granted can be forcebly taken away from a process
a)resources need to be used in mutually exclusion fashion
b)process can request new resources, as they continue to hold on to old ones
c)here is a cycle in the resource allocation graph
Q16)a IP/IPX packet received by a computer using... having IP/IPX both how the packet is handled.
ans-read the ,field in the packet header with to send IP or IPX protocol.
Q17)the range of the 32 bit number in two's complement form is
ans- -31 31
2 to 2 -1
Q18) cyclomatic complexity
{
if((x=0) or (y=0))
p=0;
else {
p=x;i=1;
while(i!=y) {
p=p+x;
i=i+1; }
}
}
Q19)activation record will contain the
a)storage for simple names
b)information about attributes for local names
c)return address
d) all of the above
Q20) global static variable within a file is intended to
a)localize swap
b)retain value persistently
c) define constant
d)fixed address in memory
Q21)why thread switch is faster than a process switch
Q22)what is the binary equivalent of 41.6875
Q23)checkpoint value will be calculated in
Q24)DHCP is used for
a)IP address allocation
b)dynamic host configuration protocol
Q25)int x(char *a)
{
a=(char *) malloc(10*sizeof(char));
*a="hello";
}
main()]
{
char *a="new";
x(a);
printf("%s",a);
}
a) hello
b)new
c)hello new
d)run time error

HUGHES TECHNICAL QUESTIONS

There were ten questions in the software section
give the output of the following programs
there were no options given, you have to fill in the given blanks
__________________________________________________________

given A=65
double is 4 byte,int is 2 byte

Q1) this question was based on swaping two varibles

swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}

main()
{
int a=3;
int b=4;
printf("%d %d\n",a,b);
..............

printf("%d %d",a,b);
}

ans-4 3
4 3
Q2) this question was based on switch statement,break+continue
main()
{
int a=1,b=4;
for (i=0;i<2;i++)
{
switch (a) {
case 1: if (b!=4)
break; // watch out for these
else continue; // two lines
b=....
a=.....
case 2: ....
........
..........
}
}
printf("Output is %d %d",a,b);
}

ans- Output is 1 4
Q3) third question was based on macros
#define dcm(a) a*a
main()
{
int first=3,second=2,var1;
var1=dcm(first+1);
printf("output is %d %d\n",var1++,var1++);
var1=dcm(first++);
printf("output is %d %d",var1++,var1++);
}
ans- output is 8 7
output is 10 9
Q4) what is the output
main()
{
int d;
d=(a&b) ~(~0 ... &c); //there was an expression like this
printf("%d",d);
}
ans- 5

Q5)
fun(char *p1,char *p2)
//this function was displaying the position
{ //the position of DCM in the string
.............
.............
...........
.............
...............
}
main()
{
printf("%d",fun("datasystem","DCM");
printf("%d",fun("DCMDELHI","DCM");
}

ans- -1 ... (for the second answer count the position of DCM in the string)

Q(6)
funct(int var)
{
static int s;
if(var=3) return var;
else { s=s+7;
var=var+1;
funct(var);
}
s=s-var;
return s;
}
main()
{
int munx,munz;
numx=funct(1);
numz=funct(0);
printf("numx=%d numz=%d",numx,numz);
}
ans- numx=9 numz=24



Q9) this question was based on printing char variable using %d flag which prints the ascii value

#include
char a;
func(.......)
{
.........
........
.........
printf("%c",a);
}
main()
{
char a='B';
printf("%d",a);
...........;
printf(................);
.................;
printf(...............);
}
ans- 66BAA66

Q10)
int mask,nbits;
funct(int a) //this function was same as that given
{ //in page 433 in schaum series // c programming book
// this function prints the binary //equivalent of the number passed
for(count=1;count<=nbits;count++) // in blocks of four bits
{ b=(a & mask) ? 1:0;
printf("%x",b);
if(count %4 ==0)
printf(" ");
mask>>1;
}

main()
{
nbits=8*sizeof(int);
mask=0x1 << (nbits -1);
funct(32767);
funct(-32768);
}

ans- 0111 1111 1111 1111 1000 0000 0000 0000

HUGHES 25/07/97

****************************************************************************
HUGHES
****************************************************************************
Dated :25/07/97

section A 30m (Compulsary)
section B or C 20m
Attempt either B or C sec B contains CST
C E&C
Better to attempt Electronics paper
(Those who are having electronics background)
----------------------------------------------------------------------------
SECTION A

1. Which of the folowing is not correct
a. (x+y)'=x'.y' b. (x'+y')'=x.y
c. (x'.y')'=x+y d. (x'+y')'=x'.y' [d]

2. Question on logic ckt. U have to find the output
ans. AB'+CD'+EF'

3. Output of MUX
_________
c-----| |
c'----| |-------Y
c'----| | ans. A xor B xor C
c-----| |
---------
| |
A B (select lines)

4.If X and Y are two sets. |X| and |Y| are corresponding
coordinates and exact no.of functions from X to Y is 97
then
a. |X|=97 |Y|=1 b. |X|=1 |Y|=97
c. |X|=97 |Y|=97 d. .....

5. If two dies are thrown simultaneously what is the prob.
of one of the dice getting face 6 ?
a. 11/36 b. 1/3 c. 12/35 d. 1/36 [a]

6. The relation ,<,on reals is
a. a partial order because of symmetric and reflexive
b. ... antisymmetric and ....
c. not ...... .. asymmetric and non reflexive
d. ... .... not anti-symm and non reflexive

7. In C language the parameters are passsed by
a. values b. name c.referrence d....

8. Advantage of SRAM over DRAM
ans. faster

9. Diasy chaining related question (refer Z80)
a. uniform interrupt priority
b.non .... ....
c.interfacing slower peripherals
d.....

10. RAM chips arranged in 4X6 array and of 8kX4bit capacity
each. How many address lines reqd. to access each byte
a. 12 b. 16 c.15 d. 17

11.Question related to AVL trees regarding how many no.of
nodes to be changed to become balanced after addition of
a leaf node to a particular node.
ans . 3

12.When following sequence is insertedin the binary search tree
no.of nodes in left and right subtrees
52 86 64 20 3 25 14 9 85

13.Method used for Disk searching..
a.linked list b.AVL c.B-tree d. binary tree

14. Which of the following is correct statement.
a. 1's complement can have two zero re[resentations
b.2's ... ... represent an extra neg. number
c.2's & 1's have no difference in representing 16-bit no.
d.......


16. The option avialable in C++, not C:
a.dynamic scoping
b.declaration in the middle of code block
c.seperate compiled and linked units
d. ....

17. int a[4]={1,2,3,4};
int *ptr;
ptr=a;
*(a+3)=*(++ptr)+(*ptr++);
A part of code is shown. The elements in A after
the execution of this code.
a.1 2 3 4 b. 1 2 3 6
c. compilation error d.1 2 2 4 [a]

18. Critical section program segment is
a. enclosed by semaphores with P & V operations
b. deadlock avoidance
c. where shared resources are accessed
d. ...


19. when head is moving back and forth, the disk scheduling
algorithm is _____
a) scan b) sstf c) fcfs d).....

20. how many times the loop will execute

LOOP LXI B,1526H
DCX B
JNZ LOOP
a)1526H times b) 31 c)21 d)38

21. the addressing mode in which the address of the operand is
expressed explicitly within the instruction
a)index addressing b)absolute c)indirect d) immediate

22. (A - B) U (B - A) U (A ^ C) = ?
where A,B are two sets A' , B' are compliments of A and B
a) A U B b) A ^ B c).... d).....

23. the network that does not use virtual circuit
a) IP b) X.25 c).... d).....

24. source routing bridge
a)source will route the frame
b)frame will routed with info in header
c).... d).....

26. cache access time 100 msec. main memory access time 800 msec
if the hit ratio is 95% , what is mean access time ...

27. the module that should be always reside in main memory is
a) loader b)link module c)... d)....

.... and some questions related to

1. addressing mode 2.assembler passes 3.linking and loading
4. file directory search 5. turning machine
6. finite state machine 7. daisy wheel

28. The order of algorithm to merge the two sorted lists of
lengths m and n is
a. O(m) b. O(n) c. O(m+n) d. O(mn)
29.A chocolate block is of 4 X 4 size.How many cuts are needed
to make 1 X 1 size blocks. No simultaneous vert. & horz. cuts.

30. Which among the following is not correct
a. O(n) > O(log n) .. likewise

**************** WISHING YOU THE BEST OF LUCK ********************