GeekInterview.com
Submitted Questions

Hcl placement paper part iii

Asked By: suji | Asked On: Nov 14th, 2005

Section C – analysing program segements1)struct dlink{int nodeid;struct dlink *next;struct dline *prev;} dlink_t;a pointer to the head of that linked list is maintained as a GLobal variable whose definition is dlink_t *head;the function remove_element(dlink_t*rp), needs to remove the node pointed to...

Answered by: Renu Saini on: Aug 11th, 2006

hi,i want to know the place where HCL company is now going for recuitment.what is the crieteria for the company of B.TECH.

Answered by: anil on: Jul 21st, 2006

its good

8?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)undefined12.outputmain() {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)none13.main() {enum months {jan=1,feb,mar,apr};months x=jan;if(x==1)printf(“jan is the first month”); }a)does not print anything b)prints : jan is the first monthc)generates compilation error d)results in runtime error (ans. (c))14.what is the output of the following program?Main() {char *src=”hello world”;char dst[100];strcpy(src,dst);printf(“%s”,dst); }strcpy(char *dst,char *src) {while (*src) *dst++=*src++; }a)”hello world” b)”hello” c)”world” d)NULL e)undefined (ans. (e))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 (ans. (c))16.main() {int x=20;int 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)none17.#define INC(x) x++main() {int x=4;printf(“%d”,INC(x++)); }a)4 b)5 c)6 d)compilation error e)runtime error (ans.(d))18.struct node{ char *word; int count; struct node left; struct node right; };a)incorrect definiton b)structures cannot refer to other structruesc)structures can refer to themselves. Hence the statement is okd)structures can refer to maximum of one other structure19.what is the size of the following unionunion 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))" href="http://www.geekinterview.com/question_details/18221">Hcl placement paper collection part ii

Asked By: suji | Asked On: Nov 14th, 2005

Section 2 – C programming1.Which of the following about the following two declarations is true i) int *f(); ii)int (*f)(); a)both are identical b)the first is a correct declaration and second is wrong c)the first declaration is a function returning a pointer to an integer and the second is a pointer...

Answered by: murali_hd on: Aug 16th, 2007

Nay. I dont think it works that way. I really dont know what compiler you been using. But with VC++ it sure does throw some errors. I would post those errors.D:MSDev98MyProjectsapti_4apti_4.c(64) : e...

Answered by: murali_hd on: Aug 16th, 2007

struct node{
char *word;
int count;
struct node *left;
struct node *right; };

Well machismo.Even this code is throwing me linker errors.Could you know why?

Hcl placement paper collection part I

Asked By: suji | Asked On: Nov 14th, 2005

· written testthe written test consists of 60 questions which are divided into 4 sections .The total duration of the test is 90 minutes. There is negative marking .The sectionwise distribution of the questions is as follows: section#1this section consisting of 15 questions is based on general computer...

Answered by: raghavendra on: Apr 21st, 2006

thx

Which scheduling algorithm has shortest turn-around time?A) shortest job firstb) round-robinc) preemptive-priority

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: kannugo on: Aug 12th, 2010

Shortest job first is theoretically the fastest algorithm, but in real world round robin is the best scheduling algorithm. Preemptive priority is a bit faster but it is also a bit costly to maintain few register for storing the information about unfinished processes.

Answered by: prashanthkumar103 on: Aug 10th, 2010

b) Round-Robin

In ethernet, preample field is used toa) for synchronizationb) as a boundaryc) to give info. About no. Of data

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: rahulrajurkar on: Jul 11th, 2009

a) For synchronization

Answered by: supreet tare on: May 6th, 2006

the ans is A preamble has data bits which are used for addressing as well as synchronization

What is the minimum depth of a tree with 18 nodes?A) 2b) 3c) 4

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: deepasinha on: Apr 12th, 2010

ans is c)4

since depth=2^n-1,,where n=level of tree

Answered by: pvaidarsu on: Jun 10th, 2008

c)4

In queue using linked-list, during an insertion in to the queue?A) only rear end changesb) only front end changesc) both changesd) no change for both

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: raka_00786 on: Jun 4th, 2008

The answer is "a" because Queue follow FIFO Data Structure.       Front---------A  B  C  D  E-----REAR        &nbs...

Answered by: AMISH on: May 25th, 2006

ANS : 'd' due to insertion in a linklist we may insert after the rear node or bfore the front node that's why there is no change in the rear or front so alsowe see int the linklist the first node(rear) is fixed. and the last node set to be null.

3) van hanman bottleneck ness (something like that) occurs whena)slow io devicesb)delay bw primary and secondary memoryc)delay bw cpu and primary memory

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: deepak narang on: Apr 4th, 2006

hello frnds,

Ans---> C

Whenever there is delay b/w CPU and memory....thats why ans is C



bye dee...

Gold is added to the pn junction for?A)to increase hole-elec. Recombinationb)to reduce the same.

Asked By: suji | Asked On: Nov 11th, 2005

Answered by: neha on: Apr 19th, 2006

a) increase recombination

Answered by: kiran talawai on: Mar 1st, 2006

the answer is (b.).....coz the element gold has the highest density of all the elements...n hence more number of electrons n holes...so their will be increase in both electrons n holes...

Infosys placement paper: 11th september 2005,

Asked By: suji | Asked On: Sep 19th, 2005

1. A cube has its 6 faces painted red. It is cut by 6 straight lines into 27 smaller cubes. Find how many smaller cubes are there having: (i) 3 faces painted red. (ii) 2faces painted red. (iii) 1 face painted red. (iv) 0 faces painted red??? 2. There are two different temperature...

Answered by: raviteja on: Mar 4th, 2007

no . of  cubes having  0 faces painted-----1
 no of cubes having 1 face painted red ----6
no of cubes having 2 faces painted red-----12
no of cubes having 3 faces painted red-----8

Answered by: avinash on: Mar 3rd, 2007

YOu have a simple formula
n = we can write 27 as 3^3 3*3*3
n = 3
 no of sides having zero color = (n-2)^3 = 1
 no of sides having 1 color  = (n-2)^2 * 6= 6
 no if sides having 2 color = (n-2)*12 = 12
 3 sides = 8

What is a "rtti"?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: mohit12379 on: Apr 20th, 2006

Run-time type information (RTTI) is a mechanism that allows the type of an object to be determined during program execution. RTTI was added to the C++ language because many vendors of class libraries ...

Answered by: A on: Jan 28th, 2006

In case of Virtual function we are responsible for deciding the function at run time. Its our logic that reflects and no one does any thing.

Where as in case of RTTI TYPE is found of object. We dont do any thing for that. We simply use that.

Have you heard of "mutable" keyword?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: vladatzar on: Oct 29th, 2010

The mutable storage class specifier is used only on a class data member to make it modifiable even though the member is part of an object declared as const.
You cannot use the mutable specifier with names declared as static or const, or reference members.


Answered by: erahul.ag on: Jul 2nd, 2010

Answer are correct but not perfect.The Crux is:Purpose of 'mutable' is not changing some member's values of a const object at all. (Its a side bug which comes free with functionality.)You may use muta...

What is "strstream”?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: vijayan on: Aug 13th, 2007

strstream is the class that specializes iostream to use a strstreambuf for input and output with arrays of characters in memory. You can create an strstream object by associating the object with a pre...

Answered by: test on: Nov 1st, 2005

Class that reads and writes to an array in memory

What are inline functions?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: Saranga Amarasinghe on: Jul 19th, 2007

By adding key word inline before the function name in the declaration, allows the function to be defined in the same file, in most case the header or the .h file without doing so in .cpp file.

Eg:-

inline LONG GetSeedValue(CEndUserRec* record)
{
    return record->ENDUSERSID;
}

Answered by: amit mahajan on: Oct 5th, 2005

inline functions are the functions with the keyword inline written prior to their declaration in a class.it has the advantage that if a function is made inline than the code of the called function is ...

Can we generate a C++ source code from the binary file?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: vladatzar on: Oct 29th, 2010

It is NOT possible!Binary file can be ONLY dissasembled to Assembler Source Code.C# CAN be decompiled and can give proper C# Source code, but this is because C# is more like interpreter and .NET ...

Answered by: sanjay Maheshwari on: Sep 17th, 2010

It is possible technically, because high level language codes converted into low
level, so there are some ways to converts this low level to high level..
For
Example
2 - 0000 0010
so it can be converted 0000 0010..
There
are some software which are used in private areas.

Explain "passing by value", "passing by pointer" and "passing by reference"

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: pramay on: Mar 10th, 2006

Pass By Value example:The function receives a copy of the variable. This local copy has scope, that is, exists only within the function. Any changes to the variable made in the function are not passed...

Answered by: rahultripathi on: Sep 24th, 2005

There  is major defference between these three are when we want to avoid making the copy of variable and we want to change value of actual argument on calling function. there are we use passing by pointer,passing the reference. We can not perform arithmentic operation on reference.

How to write a program such that it will delete itself after execution?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: tahoekid on: Jun 13th, 2011

The Richter method does delete the original file, but the temporary file remains behind.  I compiled this as-is, and on Windows Server 2003, and 64 bit Windows 7, the temp file is not deleted. Presum...

Answered by: kumar on: Mar 18th, 2006

if the solution is needed for the unix platform. Then you can create a pthread at the bottom of the program, take the current process id of the parent and make it a deamon by using the standard unix c...

Difference between "vector" and "array"?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: sivakumar.v on: Jul 3rd, 2008

Hi, for the above answer, i am little bit disagreeing, like VECTOR is UNIDIRECTIONAL ?? what does that mean ?? exactly, you mean to say that we cannot have multidimensional vectors ?? if that is ...

Answered by: bhradwj on: Apr 4th, 2006

The main difference between vector and array is

Always vector is represented as uni-dimensional (ie., one dimensional) but whereas Array can be represented by both one-dimensional as well as two dimensional.

Thanks....

What are the types of stl containers?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: srinu5019 on: Mar 21st, 2011

Sequential containers-> vectors,Deque,list

Assosiative containers->set,multiset,map,multimap
Derived containers->stack,queue,priority queue

Answered by: burraganesh on: Dec 7th, 2008

Sequence containers and
Associative containers

What is namespace?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: visekhar on: Jan 18th, 2006

Namespace is simply a declarative region.The purpose of namespace is to localize the names of identifiers to avoid name collisions ...

Answered by: vivek singh on: Sep 27th, 2005

Namespace is a collection of Classes and the classes can be predefined or it can be use defined.we can also defined the Namespace.

Difference between a "assignment operator" and a "copy constructor"

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: Indrajit Paul on: Jul 13th, 2007

Inspite of repeated requests by some (few) sensible people to everybody to read the question properly before responding, nobody listens.For doreen, the question does not ask you to explain deep copy a...

Answered by: Doreen on: Jun 14th, 2006

If a class contains members that are pointers initialized by new, then you should define a copy constructor that copies the pointed-to data instead of copying the pointers themselves. This is termed d...

Can we have "virtual constructors"?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: priya on: Mar 4th, 2006

we can have virtual destructor but we cant have virtual constructor.

Answered by: Dhiraj Nadgouda on: Dec 2nd, 2005

Yes we cannot have virtual constructors.  But if the need arises, we can simulate the implementation of virtural constructor by calling a Init method from the constructor which, should be a virtual function.

What are the different types of storage classes?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: prerna chavan on: Jul 25th, 2011

External,
Register,
Static,
Automatic

Answered by: srivallabh on: Jul 24th, 2011

extern,auto,register,static.

What are virtual functions? How to implement virtual functions in "c"

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: kamranahmad on: May 25th, 2008

Hi here i have more simplified example Hope this will give you clear view and check this linkhttp://www.codersource.net/published/view/325/virtual_functions_in.aspx#include <stdio.h>#include <...

Answered by: SomGollakota on: Apr 21st, 2008

Sukesh, Your response is essentially correct if we are talking about pure virtual functions. However, when we talk about virtual functions, then we perhaps need to make a distinction between regu...

What are the different types of polymorphism?

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: naina verma on: Aug 15th, 2011

Types of Polymorphism:
1. Static / Compile time / Early binding polymorphism :
a. Function overloading
b. Operator overloading

2. Dynamic / Run time / Late binding:
a. Virtual function

Answered by: Vinay on: Jul 20th, 2011

There is only one type of polymorphism & that is run time polymorphism.

Refer advance text like Kathy Sierra books on Java & Grady Booch books on OOP's they explained why compile time polymorphism is not actually polymorphism

Explain the need for "virtual destructor".

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: Niranjan.ambati on: Apr 9th, 2009

Virtual destructor makes sure that all derived objects are deleted first before deleting the base class objects. When base class pointer assigned with Derived class objects, the virtual destructor of ...

Answered by: jezpops on: Jul 7th, 2008

Virtual destructor is used when deleting an object explicitly using the delete[] keyword. The Virtual destructor ensures that derived classes take on the implicit destructor method. 

What is the difference between "overloading" and "overriding"?

Asked By: suji | Asked On: Sep 19th, 2005

Star Read Best Answer

Editorial / Best Answer

Answered by: Richa

Answered On : Sep 28th, 2005

Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.

Answered by: swarn kant on: Mar 13th, 2006

All the above answers are right this is one more refinement.

overridding is runtime polymorphism while overloading is compile time polymorphism. 

Answered by: priya on: Mar 4th, 2006

overloading: the same function can perform different operations.overridding: the derived class can rewrite the content of the base class.

Difference between "c structure" and "c++ structure".

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: sachin_mundhra on: Dec 18th, 2009

No concept of encapsulation, code is different than the data in case of C structure. This is possible in C++ structure.

Answered by: samitriani on: Jul 8th, 2008

C does not have limitation access. Structures in C are used to regroup data from different types.

In C++ structure have limitation access propreties (private,public protected) with public access as default, can contain methods and can be used as a class.

What will happen if I say delete this

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: Faramarz Rabii on: Oct 22nd, 2010

The danger only exists if you do a stack variable. There is no problem if you use a "new" ed object.

Answered by: sachin_mundhra on: Dec 18th, 2009

Memory corruption/exception. In case object is local(stack) this will corrupt the stack.

What is the output of printf ("%d")

Asked By: suji | Asked On: Sep 19th, 2005

Answered by: rahulsahu2455 on: Oct 7th, 2011

it will take top element of stack which use for allocate memory for variables, so it ll print the value of last declared variable

Answered by: shibshankar on: Sep 6th, 2011

it will print 0.

A doctor and nurse gave birth to a child. The child becomes 15 years of age then one day teacher asked the child about their parents and she said that his father is not a doctor and his mother was not...

Asked By: suji | Asked On: Sep 15th, 2005

The doctor and nurse processed the delivery of child and not they are the father and mother of the child.

Answered by: mon24 on: Mar 17th, 2008

when the child was of 2yrs 3months  and 8 dayz his father and mother died in the road accident ...after wich he was adopted by an engineer

Answered by: sridhar.k on: Nov 16th, 2007

that is an test tube baby

There are two vessels of same size with water in it and one is 20 degree celsius and other is 20 degree fahrenheit. When a coin is put in both vessel which will reach bottom first.

Asked By: suji | Asked On: Sep 15th, 2005

As 20 degree fahrenheit is definitely a freezing pt, at this time none can be be immersed so at 20 degree celsius the coin will immerse first

Give a situation were you can work as a team and alone?

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: nolloyd on: Jun 14th, 2008

anybody can give an answer on an example for this question please ?

What is your role in your project?

Asked By: suji | Asked On: Sep 15th, 2005

What is your father?

Asked By: suji | Asked On: Sep 15th, 2005

You are looking different from the photo and real (as I was wearing GLass on the time of interview and not in the photo)

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: chetan20 on: Nov 16th, 2005

You are looking different from the photo and real (as I was wearing glass on the time of interview and not in the photo)

Two persons were talking themselves with out knowing that that tower clock is set one hour back coz of the summer days.Person a; when shall we meet again?Person b: it takes 10 seconds for the tower clock...

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: swamysagar on: Jan 2nd, 2008

at 13 hour

Answered by: shyam_et@rediffmail.com on: Nov 18th, 2005

Question: Two persons were talking themselves with out knowing that that tower clock is set one hour back coz of the summer days.Person A; when shall we meet again?Person B: it takes 10 seconds for th...

Husband says if we sell 75chicken of what we have we can feed 20 days more . His wife says if we buy another 100 chicken the feed will get over 15 days earlier. Find the number of chiken they have. ...

Asked By: suji | Asked On: Sep 15th, 2005

300 chicken, 60 days they can feed

Answered by: sreenath on: Apr 8th, 2006

let x be total no of chicken and y be total no. of days that these chickens can be feed.then xy=(x-75)(y+20)=(x+100)(y-15)solve this you will get ans as 300 chicken and 60 days

Answered by: punneet on: Dec 28th, 2005

hello

everybody

for me....d no of chickens are 770.

well for d detailed ans contact me on my id

A person is 80 years old in the year 490 and 70 years old in the year 500. Wat is his year of birth?

Asked By: suji | Asked On: Sep 15th, 2005

570 bc

Answered by: vr4indian on: Jun 28th, 2006

perfect logicits BC so we are talking of era before 0000 (like minus year)not AC

5+5+5 , u have 2 make just a slight change and make it 550

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: dpsrathore on: May 22nd, 2008

put these two "+" on the right side five as +5+ and come close thes Pluse slowly so this figer convert in a rectangle which diveded by a horizotal line... and delet now this horizontal line automatic it will change in 550

Answered by: karthika on: Jul 13th, 2006

remove + symbols and then subract 5 u get 550

They gave me 5 new one rupee coins and asked me 2 arrange in such a way that each and every coin 2 touch other 4 coins

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: JILANI.SHAIK on: Jul 27th, 2006

  

 FIRST KEEP 4 CIONS TO TOUCH EACHOTHER AND THEN THE 5th ON THEM AT CENTER

Answered by: deepak on: Nov 30th, 2005

u first put 1 coin downthen put 3 coins on top of itthen put another coin over this

They gave me 6match sticks and asked 2 construct 6 equilateral triangles

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: Carebear on: Jul 5th, 2006

Can you help me with the answer to this problem?

Answered by: noname on: Nov 19th, 2005

Arrange then in star formation...?

They asked me to prove half of 12 is 7

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: Gizzy on: May 31st, 2006

What is the answer?

Answered by: bird650 on: May 16th, 2006

roman numerals.xll<---- draw a line through the middle deviding 12(xll) in half =7(vll)

They gave me 2 paper cutting of tringale shapes and asked me 2 construct pyramid without folding( I couldn't answered this)

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: santhosh on: Feb 3rd, 2006

 I think it is possible in the 3D dimension view

60-60=60 what can you derive from it?

Asked By: suji | Asked On: Sep 15th, 2005

Answered by: hariprasad on: Nov 20th, 2005

RE: 60-60=60 what can you derive from it?

Answered by: hariharan on: Oct 4th, 2005

hey guys....i guess u guys know how shakuntala devi has proved 2=1in her book.now on similar lines........

a^2=b^2

a=+b or -b

a+b=0 a-b=0

take a=-b

a^2=-ab

a^2-b^2=-ab-b^2

(a+b)(a-b)=-b(a+b)

a-b=-b

a-b=a ; a=-b

a=b=60

so...60-60=60

These questions a very routine one , but I wondered that they not even asked me usual questions like describe urself?And briefly describe ur project ectthey asked mehow was the day?Did you had a nice...

Asked By: suji | Asked On: Sep 15th, 2005

Finally they said we will inform u through mail in 4 weeks whether you are seleclted or rejected

Answered by: phani on: Nov 27th, 2005

how was the day?Did you had a nice lunch?Tell us about your family backgroundHow can you maintain consistency in your academics?Did u learn anything New recently?Speak on any topic for 2 minutes (I ch...

Answered by: vikram on: Oct 20th, 2005

these questions r good for anyone opting for infosys placements

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: