HCL Placement Papers
HCL Placement Papers
Ans: (a)
Ans: (b)
3. For a 25MHz processor , what is the time taken by the instruction which needs 3 clock
cycles,
(a)11
(b)16
(c)22
(d) 24
Ans. (b)
5. Semaphore is used for
(a) synchronization
(b) dead-lock avoidence
(c) box
(d) none
Ans. (a)
Ans. (a)
8. OLE is used in
(a)recursion
(b)varying no of arguments
(c)hypochecking
(d)type declaration
Ans. (c)
a) Flow control
b) Sequence
c) Acknowledgement
d) retransmition
Ans. (c)
13. In signed magnitude notation what is the minimum value that can be represented with
8 bits
(a) -128
(b) -255
(c) -127
(d) 0
14. There is an employer table with key fields as employer number data
in every n'th row are needed for a simple following queries will get required results.
(a) select A employee number from employee A , where exists from employee B where A
employee no. >= B
employee having (count(*) mod n)=0
(b) select employee number from employe A, employe B where A employe number>=B
employ number
group by employee number having(count(*) mod n=0 )
(c) both (a) &a
4.output
main()
{
int I;
char *p;
i=0x89;
p=(char *)i;p++;
printf("%x\n"p);
}
a)0x8c b)0x4566788A c)0x8A d)0x8B e)none
5.which of the following is not an ANSI c language
keyword?
a)volatile b)function c)default d)const e)void
ans; (b)
9. x= b>8?b<<3:b>4?b>>1:b;
ans: x=3
10.output:
main()
{
int n=2;
printf("%d %d\n"++n,n*n);
}
a)3,6 b)3,4 c)2,4 d)cannot determine
ans :( b)
11.output:
int x=0x65;
main()
{
char x;
printf("%d\n",x);
]
a)compilation error b)'A' c)65 d)undefined
12.output
main()
{
int a=10;
int b=6;
if(a=3)
b++;
printf("%d %d",a,b++);
}
a)10,6 b)10,7 c)3,6 d)3,7 e)none
13.main()
{
15.main()
{
int i=6;
switch(i)
{
default: i+=2;
case 4;i=4;
case 5:i++;
break;
}
printf("%d",i);
}
a)8 b)6 c)5 d)4 e)none
16.main()
{
int x=20;
itn y=10;
swap(x,y);
printf("%d %d",y,x+2);
}
swap(int x,int y)
{
int temp;
temp=x;
x=y;
y=temp;
}
a)10,20 b)20,12 c)22,10 d)10,22 e)none
}
a)4 b)5 c)6 d)compilation error e)runtime
error
18.struct node{
char *word;
int count;
struct node left;
struct node right;
};
a)incorrect definiton
b)structures cannot refer to other structrues
c)structures can refer to themselves.Hence the
statement is ok
d)structures can refer to maximum of one other
structure
19.what is the size of the following union
union tag{
int a;
float b;
char c;
};
a)2 b)4 c)1 d)7
ans :( b)
20. main()
{
char s[]="hello world";
printf("%15.10s",s);
}
a)hello,.world...
b).....hello world
c)heloo,.wor.....
d)none of the above
ans: (b)
1)struct dlink{
int nodeid;
struct dlink *next;
struct dline *prev;
} dlink_t;
A pointer to the head of tha linked list is
maintained
as a global variable whose definition is
dlink_t *head;
The first node's prev and the last node's text are
NULL
remove_element (dlink_t *rp)
{
rp->prev->next =rp->next;
rp->next->prev =rp->prev;
if(head ==rp)
head =rp->next;
}
which of the following statement is true about the
function remove_element
a)it works when head is the same as rp;
b)it does not work whe rp is the last element on the
list
c)it sets the head of the list correctly
d)it works in all cases
ans:( b)
2.#define NULL 0
char *
index (sp,c)
register char *sp,c;
{
do {
if(*sp==c)
return(sp);
}while (*sp++);
return (NULL);
}
The first argument sp,is a pointer to a C string.
The
second argument c is a character. This function
searches for the character c in the string . If it
is
found
a pointer to that location is returned ,else NULL is
returned
3.main()
{
printf("%d\n",f(7));
}
f(x)
{
if(x<=4)
return x;
return f(--x);
}
a)4
b)5
c)6
d)7
5.which is correct?
7.int
func(int x)
{
if(x<=0)
return (1);
return func(x-1)+x;
}
main()
{
printf("%d",func(5));
}
a)12 b)16 c)15 d)11
9. void
funca(int *k)
{
*k+=20;
}
void
funcb(int *k)
{
int m=*x,*n=&m;
*n+=10;
}
main()
{
int var=25,;
*varp=&var;
funca(varp)
*varp+=10;
funcb(varp);
printf("%d%d,var,*varp);
}
(a) 20,55(b) 35,35(c) 25,25(d)55,55
ans : (d )
9. #include <stream.h>
class x{
public :
int a;
x();
};
x::x() { a=10;cout<< a ;}
class b:public x {
public :
b(); x();
};
b::b() { a=20;cout<<a;}
main()
{
b temp;
}
what will be the output of the following program?
a)10 b)20 c)20 10 d)10 20
ABCDE X4=EDCBA
Which digit does E represent?
a)4 b)6 c)8 d)7 e)insufficient data provided
Qestions 16-20
Six knights - P,Q,R,S,T and U - assemble for a long
journey in two travelling parties. For security,
each
travelling party consists of at least two knights
.The two parties travel by separate routs,northern
and
southern .After one month ,the routes of the
northern
and southern groups converge for a brief time and at
that point the knights can if they wish ,rearrange
their travelling parties before continuing, again in
two parties along separate northern and southern
routes. Throughout the entire trip , the composition
of travelling parties must be in accord with the
following conditions:
P and R are deadly enemies and although they may
meet briefly can never
travel together.
P must travel in the same party with S
Q cannot travel by the southern route
U cannot change routes
SECTION ONE
A supplier of animals to zoos has the following animals in stock:
three females of L,
one female and one male of R,
one female and three males of T,
and two males of M.
conditions: a male and female of same species cannot be placed
in the same cage.
a male M and male T cannot be placed in the same cage.
questions 6 & 7.
x=1;
a=0; b=1; c=0;
if((x) || (c=a+b)){
b=2;
c=c+b;
}
8. In the complete binary tree of n nodes, how many nodes have a parent
as
well as children?
a] [n+1]/2-1 b] [n-1]/2-1 c][n-1]/2+1 d] [n-1]/2 e][n+1]/2
20. Assume a table exam has a column marks. Which of the following
queries
will return the second highest mark in the table.
a] select marks from exam where marks <> (select max(marks)from exam)
b] select max(marks)-1 from the exam
c] select max(marks)from exam where marks<>(select max(marks) from exam)
d] select max(marks)from exam where marks<(select max(marks)from exam)
e] c and d.
------------------------------------------------------------------------------
SECTION - V ("ANALYSING " C" PROGRAM SEGMENTS)
------------------------------------------------------------------------------
1) Consider the following program
main()
{ int y=7;
if(y++>6 && y++!=8 && y++>7)
printf("%d\n",y);
else
printf("%d\n",y);
}
what is printed when this program is executed?
a] 7 b] 8 c] 9 d] 10.
2)consider the following program
main()
{ int i=4;
switch(i) {
case 1: i++;
default: i +=2;
case 2: i++;
break;
case 3: i++;
}
printf("%d\n",i);
}
what is the value printed when the above program is executed.
a] 5 b] 6 c] 7 d] 8.
3)what is printed when this program is executed?
main()
{
printf("%d\n",f(7));
}
f(x)
{
if (x <= 4)
return x;
return f(--x);
}
a] 4 b] 5 c] 6 d] 7.
4)on a machine where pointers are 4 bytes long,
what happens when the following code is executed?
main()
{ int x = 0, *p = 0;
x++; p++;
printf("%d and %d\n",x,p);
}
a] 1and1 are printed b] 1and4 are printed c] 4and4 are printed
d] causes an exception.
5)which of the following is the wrong code for strcpy,that is
used to copy the contents from src to dst
(a) strcpy(char *dst, char *src)
{ while (*src)
*dst++ = *src++;
}
(b) strcpy(char *dst,char *src)
{
while(*dst++ = *src++);
}
Simillarly some segements for (c) and (d) were given.
the choices for answers were 1] a only 2] a and b only 3] a,b and c
4]all of the above
HCL TECHNOLOGIES
Q)x=2,y=6,z=6
x=y==z;
printf(%d",x) ?
*****
HCL-TECH (MADURAI)
Section II - C Programming
Choice :
a) Both are identical
b) The first is a correct declaration and the second
is wrong
c) The first declaraion is a function returning a
pointer to an
integer and the second is a pointer to function
returning int
d) Both are different ways of declarin pointer to a
function
main()
{
int x=7;
int y=3;
dprintf(x/y);
}
Choice:
a) #2 = 2 b) expr=2 c) x/y=2 d) none
Answer: c)x/y=2
main()
{
int i;
char *p;
i=0X89;
p=(char *)i;
p++;
printf("%x %x\n",p,i);
}
*
ans:0X8A
5.
which of the following is not a ANSI C language
keyword?
ans:Function.
choice:
a) The function can change values in the original
array
b) In C parameters are passed by value. The funciton
cannot
change
the original value in the array
c) It results in compilation error when the function
tries to
access the
elements in the array
d) Results in a run time error when the funtion tries
to access
the elements
in the array
Answer : d)float
a) 3 b) 5 c) 6 d) a+18 e) None
Answer : 5
a) 7 b) 28 c) 3 d) 14 e) None
ans: 3;
Answer : b) 3,4
11. What is th output of the following program?
int x= 0x65;
main()
{
char x;
printf("%d\n",x);
}
if(a=3)
b++;
printf("%d %d\n",a,b++);
}
Answer : d) 3,7
Answer: d) NULL
main()
{
int l=6;
switch(l)
{ default : l+=2;
case 4: l=4;
case 5: l++;
break;
}
printf("%d",l);
}
a)8 b)6 c)5 d)4 e)none
Answer : c)5
Answer:d)10,22
struct Node {
char *word;
int count;
struct Node left;
struct Node right;
}
a) Incorrect definition
b) structures cannot refer to other structure
c) Structures can refer to themselves. Hence the
statement is OK
d) Structures can refer to maximum of one other
structure
Answer :c)
a)Hello,.World...
b)....Hello,.Wor
c)Hello,.Wor....
d)None of the above
SECTION C
Answer:d)10
15. If taxi fares were Rs 1.00 for the first 1/5 mile
and Rs
0.20
for each 1/5 miles thereafter. The taxi fare for a
3-mile ride
was
(A)Rs 1.56 (B)Rs 2.40 (C)RS 3.00 (D)Rs 3.80 (E)Rs 4.20
Answer : A) (99.10)
Answer: c)50
Application software
Two section were there one section is aptitude ( 35 questions 35 minutes ) and other is
general technical awareness ( 25 qus-25 min)
Each qus have 1 mark for correct and -1/4 for incorrect answer .
General technical awareness is very very simple need not to be
send .It was based on c, c++ and computer awareness.
Q1. In a island there are people of two community type 'A' and type 'B'.
people of this island can ask question only. Questions asked by type 'A'
have correct answer YES and question asked by type 'B' have correct
answer 'NO'.
Q2 . There are six people A,B,C,D,E,F and five cars .cars are stand in
sequence numbered 1 to 5 and each car can be share by two persons
only.and conditions are
'A' will share car
'B' will sit alone
'F' will not share car with 'D' and 'E'
'D' will drive car 3rd or 4th car
'E' will drive a car which is behind
the car with vacant seat.
Q3
DATA SUFFICIENCY
13. Is X =Y?
(1) X-Y=X^2-Y^2 ans:( )
(2) X and Y are greater than 1.
14. Is CAB a code word in language Q?
(1) ABC is the base word.
(2) If c immediately follows B, then C can be moved to the front of
the code word to generate another word?
ans:( )
15. A dress was initially listed at a price that would have given the
store a profit of 20 percent of the wholesale cost. What was the
wholesale cost of the dress?
(1) After reducing the asking price by 10 percent, the dress sold for a
net profit of 10 dollars.
(2) The dress sold for 50 dollars.
ans:( )
16. If X and Y do not equal 0, is X/Y an integer?
(1) X is prime
(2) Y is even ans:( )
17. What is the price of a banana?
(a) 14 banana and 35 oranges cost Rs. 84
(b) with a 50% discount on banana, Rs. 12 can buy 4 bananas and 5
oranges.
ans:( )
Q.NO.1&2
A FACTORY produces a product (measured in cubic feet) over seven days as
per the following schedule:
6.if a+d=b+c,a+e=c+d,2cb+d,then
(a) a>b>c>d>e
(b) b>a>d>c>e
(c) d>b>c>a>e
(d) b>c>d>e>a ans:( )
(e) none of these
Q21. three students appear in a test but no one write there name on
answer sheet .and they submitted their sheet to teacher . when teacher
distributed their answer sheet . what is probability that no one get
their own answer sheet.
8. OLE is used in
a) inter connection in unix
b) interconnection in WINDOWS
c) interconnection in WINDOWS NT
9. Convert a given HEX number to OCTAL
13. In signed magnitude notation what is the minimum value that can be
represented with 8 bits
(a) -128
(b) -255
(c) -127
(d) 0
14. There is an employer table with key fields as employer number data
in every n'th row are needed for a simple following queries will
get required results.
(a) select A employee number from employee A , where exists from
employee B where A employee no. >= B
employee having (count(*) mod n)=0
(b) select employee number from employe A, employe B where A employe
number>=B employ number
group by employee number having(count(*) mod n=0 )
(c) both (a) &a
HCL TECHNOLOGIES
Section II - C Programming
1. Which of the following about the following two
declaration is true
i ) int *F()
ii) int (*F)()
Choice :
a) Both are identical
b) The first is a correct declaration and the second
is wrong
c) The first declaraion is a function returning a
pointer to an integer and the
second is a pointer to function returning int
d) Both are different ways of declarin pointer to a
function
Answer : c
main()
{
int x=7;
int y=3;
dprintf(x/y);
}
Choice:
a) #2 = 2 b) expr=2 c) x/y=2 d) none
Answer: c
main()
{
char *c;
int *p;
c =(char *)malloc(100);
ip=(int *)c;
free(ip);
}
ans: The code functions properly releasing all the
memory allocated
main()
{
int i;
char *p;
i=0X89;
p=(char *)i;
p++;
printf("%x\n",p);
}
ans:0X8A
5.
which of the following is not a ANSI C language
keyword?
ans:Function.
choice:
a) The function can change values in the original
array
b) In C parameters are passed by value. The funciton
cannot change the original
value in the array
c) It results in compilation error when the function
tries to access the
elements in the array
d) Results in a run time error when the funtion tries
to access the elements in
the array
Answer: a
7. The type of the controlling statement of a switch
statement cannot be of the
type
Answer : d
a) 3 b) 5 c) 6 d) a+18 e) None
Answer : b
a) 7 b) 28 c) 3 d) 14 e) None
ans: c
Answer : b
if(a=3)
b++;
printf("%d %d\n",a,b++);
}
Answer : d
Answer: b
Answer: may be d
main()
{
int l=6;
switch(l)
{ default : l+=2;
case 4: l=4;
case 5: l++;
break;
}
printf("%d",l);
}
a)8 b)6 c)5 d)4 e)none
Answer : c
Answer:d
Answer : d
struct Node {
char *word;
int count;
struct Node left;
struct Node right;
}
a) Incorrect definition
b) structures cannot refer to other structure
c) Structures can refer to themselves. Hence the
statement is OK
d) Structures can refer to maximum of one other
structure
Answer :c
may be b
a)Hello,.World...
b)....Hello,.Wor
c)Hello,.Wor....
d)None of the above
may be c
9)
(1) The combined length of the longer two pieces of
rope is 12 metres.
(2) The combined length of the shorter two pieces of
rope is 11 metres.
SECTION C
Answer:d
15. If taxi fares were Rs 1.00 for the first 1/5 mile
and Rs 0.20 for each 1/5
miles thereafter. The taxi fare for a 3-mile ride was
(A)Rs 1.56 (B)Rs 2.40 (C)RS 3.00 (D)Rs 3.80 (E)Rs 4.20
Answer :d
(A) (99.10) (B) (85.9) (C) (50.7) (D) (1.1) (E) (1.0)
Answer : A
Answer: c
Answer :E
Answer :A
Answer :(300+k)/97 * 60
Answer :c
Answer :c
23) How many integers n greater than and less than 100
are there such that, if
the digits of n are reversed, the resulting integer is
n+9 ?
Answer :D
Answer :B
Answer :c
Answer :E
Answer :C
struct dlink {
int nodeid;
struct dlink *next;
struct dlink *prev;
} dlink_t;
The first node's prev and the last node's next are
NULL.
remove_element(dlink_t *rp)
{
rp->prev->next = rp->next;
rp->next->prev = rp->prev;
if( head == rp)
head = rp->next;
Answer :B
#define NULL 0
char *
index(sp,c)
register char *sp,c;
{
do {
if(*sp == c)
return (sp);
} while (*sp++);
return NULL;
}
a) 4
b) 5
c) 6
d) 7
answer: a
main()
{
int i=20,*j=&i;
f1(j);
*j+=10;
f2(j);
printf("%d and %d",i,*j);
}
f1(k)
int *k;
{
*k +=15;
}
f2(x)
int *x;
{
int m=*x,*n=&m;
*n += 10;
}
int
func (int x)
{
if (x<=0)
return(1);
return func(x -1) +x;
}
main()
{
printf("%d\n",func(5));
}
a) 12
b) 16
c) 15
d) 11
a.c
___
int i;
main()
{
i = 30;
f1();
printf("%d\n",i)
}
b.c
___
static int f1()
{
i+=10;
}
answer: e
a) 2k+s
----
q
b) 2sk
----
q
c) 2(k-s)
-----
q
d) 2k+sq
-----
q
e) 2(k+s)
------
q
answer: e
ans: b
answer: c
answer: a
answer: e
1) OS Concepts
2) C Programming skill
3) OOPs concepts
4) Basics of Networking
5) Data structures
Only basic QP like
1) What is fragmentation? How do overcome?
2) What is semaphore?
3) What are the IPC Mechanism available? Illustrate
with example
4) What is structure and union in c? write the code
and explain
how they are storing in the memory?
5) They will ask to write one c program ?
6) Explain the data struture (code) for the data
structures
i) Double linklist
ii) Minimum spanning tree
iii) BFS and DFS
iv) AVL tree
v) Reverse the linklist
7) Difference between malloc and calloc?
8) write a prg in macro in c?
9) Write a simple MFC program to create a window?
(They aaked me
write a prg to create a window)
10) Tell about the existing scheduling algorithm?
11) what are all E.F.Codd rule?
12) what is bit slice processor?
13) what is a deadlock? explain it?
14) what is virtual memory?
15) what is circuit switching and packet switching
16) What is the significance of friend keyword in C++?
17) Different types of inheritance?
18) do u want to ask anything from us?
HR interview
This ranges from 20 min to 45 min. They expecting ur
i) Focussing towards the technology
ii) Adaptability
iii) Family Background
iv) Team spirit
9.
20 ? 15
0 18 11
Ans(6)
12 The distance between two pts is 335 kms.A car starts from a point
A towards
B with a speed of 65 km/hr at 8.00 am.Another car started from B
towards A at
9.00 am at a speed of 70km/hr.When will they meet each other.
a)11.00 am(ans) b)11.30am c)12.00 pm d)1.00 pm e)10.30 am
A,B,C,D,E are travelling in a car.Three of them are drivers.there is
one
couple,B is wife of D and is a Driver. A is the brother of D .Of them
only one
lady can drive.A drove for a while followed by A and then by E.
21.In a clock how many times does the hands of a clock are at right
angle in a
day?
Ans(44 times)
Those who qualified from section I were shortlisted to sit for the
second test
on techinal questions.The second test consists of two parts Section I
consists
of Only Operating system and the Section II consists of only Cand C++
fundamentals
I got HCL full paper. I am mailing it. The quetions are in order.
So you no need to prepare answers and mugging that quetions. Just
Jyou mug that answers which are in order or you write all these
answers on the hand compactly while you are going to exam.
Paper Model:
-ve marks: -1
Section IV: Analytical Q.20 each quetion -> 2 marks.
VIJAYA from each section Iam giving one are to quetions also because
for checking whether the same paper or not. And for doubtful
answers also I am writing quetions but not writing
answers for these quetions.
SECTION-I
ans: b application
5) c 20
6) a 120
8) a system call
10) a 177333
SECTION-II
3) x=2,y=6,z=6
x=y==z;
printf(%d",x) ?
4) if(x>2)?3:4
5)
6)
8) ----
---
---
--
14) c : class A,B and C can have member functions with same name.
SECTION-III
2) ans: a always
3) ans: b 13
4) ans: b 16
5) ans: d 55,55
6) ans: c 5,10,10,3
7) ---
8) ans:d 4
9) ans: c 5
SECTION-IV
6. 10 in 4 seconds,
? in 6 minutes = 10x6x60/4 = 900 ans: (a)
I. F & G
II. E and H
III. D
(a) I only (b) II only (c) III only (d) I,II, & III
(e) I & II (or) II & III but not both ans: (e)
(a) D (b) D and G (c) G and H (d) F and G (e) J ans: (a)
a) E (b) either B or C (c) both E & F (d) B (e) both B & C ans: (b)
(a) 1 only (b) 2 only (c) 1 & 2 (d) 2 & 3 (e) 1,2,3 ans: (c)
15. E occurs which one cannot occurs
e
a
c
a
section 1.
ans : a
8. OLE is used in
ans: c
SECTION B
2.main
{
int x,j,k;
j=k=6;x=2; ans x=1
x=j*k;
printf("%d", x);
3. fn f(x)
{ if(x<=0)
return; ans fn(5) ....?
else f(x-1)+x;
}
4. i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
5. int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i); ans i=20
6. int x=5;
y= x&y
( MULTIPLE CHOICE QS)
ans : c
7. Y=10;
if( Y++>9 && Y++!=10 && Y++>10)
printf("........ Y);
else printf("".... )
ans : 13
8. f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
d) ........
ans : a
9. if x is even, then
(x%2)=0
x &1 !=1
x! ( some stuff is there)
a) <=
b)?:
c)==
d)*
ans: b and d
_______________________________________________________________________
_
P AND R-ARE ENEMIES, Q DOES NOT GO SOUTH
P&S-ARE WILLING TO BE TOGETHER
______________________________________________________________________
main()
{
int var=25,varp;
varp=&var;
varp p = 10;
fnc(varp)
printf("%d%d,var,varp);
}
(a) 20,55(b) 35,35(c) 25,25(d)55,55
[ c++,c,dbms interview]
[fundamentals]
this is new paper
application -software
part-1:
28-questions
(5)ingless ans:RDMS
(1)bit program-ans d
(2)c ans
(3)+ 0 ans
(4)00p--ans linking
(5)------
(6)-------
(9)25--45 even no. ans--10
(10) >10 <100 ---ans=n+9