Tuesday, October 9, 2007

MNC October

HCL Technologies is looking for candidates should implementing and supporting various software applications developed in the BAG (Business Application Group).

This candidate should be a self-starter, and should take all the initiatives to troubleshoot functional issues in the applications. This person should have very good understanding of technologies related to Microsoft platforms. This person should be willing to provide excellent support to the client team when needed. Excellent communication, comfortable with client interaction and great team playing skills required. Experience in mentoring a small team is preferred, as this candidate would have assist a support team operating from our Noida office.

Walk in interview for Software Engineer/Senior Software Engineer with HCL Technologies Ltd -BPO Services

Designation : Software Engineer/Senior software Engineer

Skill set : Asp.net, C#, sql server.

Qualification : BCA/BE(CS/EC/EEE/IT)/MSC(IT/CS),MCA

Experience : 6 months to 4yrs



Walk-In Date : October 13, 2007 / 10am to 4pm

Venue : HCL Technologies Ltd., - BPO services,
Block no:1, 84, Greams Road, Thousand Lights, Chennai - 600006.
Land mark : Behind MRF building

Contact person : SUBHA - HR (C2 building - 6th floor)

Selection Process Technical Test / Technical Interview


 

 

Job Description:
ASIFIA COLLEGE OF ENGINEERING & TECHNOLOGY gladly announces OFF CAMPUS RECRUITMENT DRIVE FROM OCT 9TH TO 11TH.

COMPANY PROFILE:
ARYANS INFOWAY (P) LTD


Aryans Infoway (P) LTD is an ISO 9001:2000 certified Multi National Company, strategically located at Technopark Campus Thiruvananthapuram, engaged in Software Research & Development. We have our branch offices at Thampanoor, Cochin, Bangalore, Dubai & US. We provide time tested solutions in a flexible mode, thus ensuring global reach. Our team comprises the best talent available in the industry, where quality is the only criterion.
We belong to one of the leading industrial groups - Aryans Group which has its interests spread across various fields like IT Training and Consultancy, Medicine, Education, Real Estate etc. This kind of exposure provides us an understanding of the nature of challenges experienced by International Companies, which contributes to a more mature and accommodative approach.
Our strength arises from a satisfied client base which cut across continents in diversified industries. The positive feedback from our trusted clients is the driving force to experiment, innovate and explore new paths to bring about solutions which can make their business more effective.

We are always on the lookout of talented manpower, determined to excel, to satisfy the ever increasing demand in our rapid expansion phase worldwide. Aryans Infoway (P) Ltd is planning to absorb more than 2000 skilled professionals for our own upcoming Software Development Centers worldwide by the end of the year 2007.

Terms and Conditions:
The candidate has to undergo rigorous training for six months and will be inducted to our product development team after the training. The candidate will have hardcore theory and practical sessions during the training period. Theory sessions will be handled by global trainers of international repute and practical sessions under the guidance of highly experienced software Professionals. The opportunity to work in real time projects even during the training period is an added advantage for the candidates. Along with intensive technical training the candidate will be undergoing personality awakening program i.e.; a complete approach to transformation of a participant into a total personality. This program is mainly divided into soft skills, speech and activity skills aimed at a positive change in perceptions and attitude.
Selection Criteria: Selection will be based on the performance in two rounds of interview i.e., HR Interview and Technical Interview
.
Stipend: The candidates attending the induction program will be eligible for a stipend of INR 5,000/- per month till successful completion of three months training. There will be definite increase in remuneration on entering probation, depending upon the skill set and caliber of the candidate, with a minimum assured amount of INR 7,000/- per month after training.
Salary: The starting salary on confirmation with other allowances and benefits will not be less than INR 10,000/- per month (T.A & D.A extra). The candidates can be posted any where in Hyderabad (Yet to be launched), Bangalore or Trivendrum, Dubai or USA after the completion of Training. The Salary will be based on his/her location & the cost of living. The cost of living is very less in Trivendrum (Training shall be at  Trivendrum only) compared to other Cities.
Benefits: The candidates will be provided with attractive incentive packages
according to their performance and other assured benefits and allowances in addition to the basic remuneration. Aryans Infoway (P) Ltd, in association with ICICI Bank Ltd, provides its employees with a benefit-rich zero-balance payroll account encompassing a host of e-Age Banking facilities and free Demand Drafts and preferential interest rates on Loans.
Contract: The Candidates have to enter into a contract for a minimum duration of 3 years with a refundable security deposit of INR 1 lakh  & is negotiable with the Company.
 
Registration Process:
The Candidates fulfilling the following criteria are eligible for attending Interviews:
1.                              B.Tech/MCA & Computer Graduates of 2005/2006/2007 passouts of all branches with a minimum 50%.
2.                              Final Year Students are also eligible.
3.                              Good command in  C language.
4.                              Good Communication skills.
Ø      The candidates have to pay Rs 100/- towards Registration fees.
Ø      Candidates have to submit 2 copies of resume & 2 pp photos.
Ø      Special counters have been installed for registration at the following venues. The Counters shall open on 27th of September, 2007. The timings of Registration is 10 am to 4 pm.
Ø      Candidates should submit the above documents & collect the Hall tickets on or before 5th October.
 
Venues for Registration:
  Harrow High School,
 Eden Gardens,
RamKoti, Hyderabad.
 
 
 

  • OUT STATION candidates have to send a request for registration.
  • The Hall tickets for Out station candidates shall be sent by email.
  • The original Hall ticket has to be collected at the Reception Counter on the date of exam after producing the E-Hall ticket & paying the Reg Fees.
  • The Registration Process & Issuing of HALLTICKETS starts on 27th of Sept. & Closes on 5th Oct. 2007. 

 
 
Interview Process:
The Interview Process shall commence on 9th October. The Interviews shall end on 11th of Sept. The scheduling is done as follows:
For 2005/2006 passout candidates: 9th of Oct.
For 2007 Passout candidates: 10nd of Oct.
For 2008 passout candidates: 11th  Oct.
The Offer Letters can be collected after completing the Placement Consultant Formalities after 13th of Oct.

  • Written test:
  •             The I round of Interview is a written test that consists 60 questions & time duration is 30 mins. The topics that shall be covered are Reasoning & Aptitude, Verbal & Non Verbal, and technical questions on C, C++, JAVA for Software Posts. For Electronics Candidates Test Consists of C & Reasoning Aptitude & Basics of EDC. 
  • Technical Interview
  • HR Interview


The Selected candidates have to Pay Ist salary ( Rs 5000/-) as Placement Charges. The payment has to be made in form of Cash/DD in Favor of Consultants.
For further queries feel free to contact:  9440434385.
 
Visit Company Web: www.aryansinfoway.com

Location: Hyderabad

Key Skills: C

How to Apply:

If you dont have a Monster.com account, Post Your FREE Resume , then Click here to Apply

Else, if you have a Monster.com account, Click here to Apply

Google's software engineers

Software Engineer - Bangalore


Position based in Bangalore, India.


The area: Software Engineering


Google's software engineers develop the next-generation technologies for which we've become world-renowned. In addition to revolutionising search technology, we use our world-class programming skills to innovate in a number of other areas as well. Our projects include working on advanced information-retrieval algorithms, massive scalability and storage solutions, and large-scale applications that enrich the user experience. We also work extensively on networking systems, advertising systems and complex transaction systems in consumer applications.

Requirements:

  • University degree in Computer Science with at least 3 years of experience (MS/Ph.D. a plus).
  • Strong C/C++ programming skills.
  • Extensive experience designing and programming large scale, distributed systems, machine learning, information retrieval algorithms, network programming, Linux kernel and/or developing large software systems.
  • Enthusiasm for solving interesting problems.

101 Interview Questions vip

101 Frequently Asked Placement Interview Questions on Programming

Most Important Questions which can

Change your Life !!!


 


 


 

Topics


C and Data Structures


Frequently Asked Programs


C++


Java


 

Most Important C Questions


 

1. What are the Different Types of Programming languages?

2. What is the difference between Pointer of Array and Array of Pointers?

3. What are Macros and Preprocessor ? What is the difference between them?

4. What does Assert Library do?

5. What are the various Storage Classes in C?

6. What is the difference between extern and Volatile variable?

7. Can a Static variable be defined outside the program?

8. What is the difference between malloc() and calloc()?

9. Can we use variables inside a switch statement?

10. What is the difference between enumeration variables and the preprocessor

#defines?

11. What is the difference between gets() and fgets()? What is the correct way to use

fgets() when reading a file?

12. What does Printf and Scanf returns ? What does malloc returns ?

13. Why should one use strncpy() and not strcpy()? What are the problems with

strncpy()?

14. What do setjmp() and longjump() functions do?

15. What is a NULL pointer and how does it work?

16. What's the difference between const char *p, char * const p and const char * const

p?

17. What is a void pointer? Why can't we perform arithmetic on a void * pointer?

18. What is a dangling pointer? What are reference counters with respect to pointers?

19. What do pointers contain?

20. What operations are valid on pointers? When does one get the Illegal use of

pointer in function error?

21. Why is sizeof() an operator and not a function?

22. What are function pointers?

23. How can I return multiple values from a function?

24. What are inline functions?

25. Can we declare a function that can return a pointer to a function of the same type?

26. How can I write a function that takes a variable number of arguments? What are

the limitations with this? What is vprintf()?

27. How can we find out the length of an array dynamically in C?

28. Write a C program to count bits set in an integer?

FAQ on Placements by www.ajay-onlinebooks.blogspot.Com

2

© http:// www.ajay-onlinebooks.blogspot.Com

29. How to reverse the odd bits of an integer?

30. What is GDB? How do you use it?

31. What are makefiles ? Why are they used?

32. What is the difference between statically linked libraries and dynamically linked

libraries (dll) ?

33. What is hashing? What are the different types of Hashing?

34. What are the different sorting algorithms? Tell them with there time complexities.

35. Explain the memory diagram in C? How it memory distributed to a program?

36. What do you mean by scope and duration?

37. How to find whether a machine is a Big Endian or little Endian?

38. What does memmove() and memopy() function do?

39. What is heap sort?

40. How to sort when the objects are bigger than memory? What is external sortying?


 

Frequently Asked Programs in C


 

41. Write a C program to reverse a string

42. Write a C program to swap two variables without using a temporary variable

43. Write a C program to reverse the words in a sentence.

44. Write C code to check if an integer is a power of 2 or not in a single line?

45. Find the duplicate integer in an array in O(1) time

46. Write C code to dynamically allocate one, two and three dimensional arrays

(using malloc())

47. Write C code to implement the Binary Search algorithm.

48. Write your own printf() function in C.


 

Data Structures


 

49. Reverse a singly linked list using only one variable? Reverse it using recursion?

50. Given only a pointer to a node to be deleted in a singly linked list, how do you

delete it?

51. How do you sort a linked list? Write a C program to sort a linked list.

52. How would you detect a loop in a linked list? Write a C program to detect a loop

in a linked list

53. How do you find the middle of a linked list?

54. Write a C program to return the nth node from the end of a linked list

55. How to read a singly linked list backwards?

56. Write a C program to find the depth or height of a tree? Find the nodes of the

tree?

57. Write C code to determine if two trees are identical

58. Write a C program to find the minimum value in a binary search tree

59. Write a C program to compute the maximum depth in a tree?

60. Write a C program to create a copy of a tree

61. What is Preorder, Inorder and Postorder traversal? Print the Tree in all three

orders

62. How many different trees can be constructed using n nodes?

63. Implement Breadth First Search (BFS) and Depth First Search (DFS)


 

C++


 

64. What are Objects? What is Class? What is the difference between structure and

Class?

65. What is Data Abstraction and Data encapsulation?

66. State all the class access modifiers and explain each one of them

67. What are Vectors in C++ and how are they used?

68. What are containers in C++? Which objects are available as containers?

69. What are References in C++ and how are they different from Pointers?

70. What is the Exception Handling mechanism in C++? What is Try and Catch in

C++?

71. What is Operator Overloading in C++?

72. What are Friend Functions and Friend Classes in C++?

73. What are Constructors and Destructors in C++?

74. What is Inheritance? How is a Class Inherited in C++?

75. What are Virtual Functions? Why do we need Virtual Functions? Explain with an

example

76. What are Templates in C++? How are Templates declared and used?

77. What is Polymorphism? How is Polymorphism achieved in C++?

78. What is Multiple Inheritance in C++? Explain with an example

79. How is memory allocation and de-allocation done in C++?

80. What is procedural programming?

81. What is Function Overloading in C++?

82. What is the Difference between Overloaded Functions and Overridden Functions?

83. What are Mutable and Const in C++

84. What is 'this' Pointer (object) in C++

85. What is Scope Resolution Operator?

86. What is a Pure Virtual Member Function?

87. Explain various access specifies like private, public, protected and there scopes in

C++

88. What is a forward reference in C++?

89. What is the difference between a deep copy and a shallow copy?

You can Get Answers of all these C++ Questions at


 

Java


 

90. What is a class and package in Java? Explain difference between them

91. Explain the differences between interface and class in Java

92. Give differences between early binding and late binding in Java?

93. Explain Memory management of Java and How it is different from say C++

94. Can RuntimeExceptions be caught in Java?

95. Explain Serialization mechanism in Java?

96. What are the names of access control specifiers in Java?

97. What are the differences between C++ and Java?

98. What are the advantages of polymorphism in Java?

99. What is multiple inheritance? Does Java Support Multiple Inheritance or not?

100. What is finalize in Java and it's importance?

101. What are the difference between Set and List.in Java ?

You can get Answer to all these Java Questions and Many more at


 

Final Words – These are only very limited set of questions which we feels are very

important and frequently asked but there are many more similar questions which you may

want to know. For that do check www.ajay-onlinebooks.blogspot.Com

You are welcome to tell us how did you liked the book and what else can be added in it.

We will create many such books for your references in coming time.

Cheers

Singly linked lists

This is THE most frequently asked interview question. The most!.

Singly linked lists

Here are a few C programs to reverse a singly linked list.

Method1 (Iterative)


 

#include


 

// Variables

typedef struct node

{

int value;

struct node *next;

}mynode;


 

// Globals (not required, though).

mynode *head, *tail, *temp;


 

// Functions

void add(int value);

void iterative_reverse();

void print_list();


 

// The main() function

int main()

{

head=(mynode *)0;


 

// Construct the linked list.

add(1);

add(2);

add(3);


 

//Print it

print_list();


 

// Reverse it.

iterative_reverse();


 

//Print it again

print_list();


 

return(0);

}


 

// The reverse function

void iterative_reverse()

{

mynode *p, *q, *r;


 

if(head == (mynode *)0)

{

return;

}


 

p = head;

q = p->next;

p->next = (mynode *)0;


 

while (q != (mynode *)0)

{

r = q->next;

q->next = p;

p = q;

q = r;

}


 

head = p;

}


 

// Function to add new nodes to the linked list

void add(int value)

{

temp = (mynode *) malloc(sizeof(struct node));

temp->next=(mynode *)0;

temp->value=value;


 

if(head==(mynode *)0)

{

head=temp;

tail=temp;

}

else

{

tail->next=temp;

tail=temp;

}

}


 


 

// Function to print the linked list.

void print_list()

{

printf("\n\n");

for(temp=head; temp!=(mynode *)0; temp=temp->next)

{

printf("[%d]->",(temp->value));

}

printf("[NULL]\n\n");

}


 

Method2 (Recursive, without using any temporary variable)

#include


 

// Variables

typedef struct node

{

int value;

struct node *next;

}mynode;


 

// Globals.

mynode *head, *tail, *temp;


 


 

// Functions

void add(int value);

mynode* reverse_recurse(mynode *root);

void print_list();


 


 

// The main() function

int main()

{

head=(mynode *)0;


 

// Construct the linked list.

add(1);

add(2);

add(3);


 

//Print it

print_list();


 

// Reverse it.

if(head != (mynode *)0)

{

temp = reverse_recurse(head);

temp->next = (mynode *)0;

}


 

//Print it again

print_list();


 

return(0);

}


 


 

// Reverse the linked list recursively

//


 

// This function uses the power of the stack to make this

// *magical* assignment

//

// node->next->next=node;

//

// :)


 

mynode* reverse_recurse(mynode *root)

{

if(root->next!=(mynode *)0)

{

reverse_recurse(root->next);

root->next->next=root;

return(root);

}

else

{

head=root;

}

}


 

// Function to add new nodes to the linked list.

void add(int value)

{

temp = (mynode *) malloc(sizeof(struct node));

temp->next=(mynode *)0;

temp->value=value;


 

if(head==(mynode *)0)

{

head=temp;

tail=temp;

}

else

{

tail->next=temp;

tail=temp;

}

}


 

// Function to print the linked list.

void print_list()

{

printf("\n\n");

for(temp=head; temp!=(mynode *)0; temp=temp->next)

{

printf("[%d]->",(temp->value));

}

printf("[NULL]\n\n");

}

Method3 (Recursive, but without ANY global variables. Slightly messy!)

#include


 

// Variables

typedef struct node

{

int value;

struct node *next;

}mynode;


 


 

// Functions

void add(mynode **head, mynode **tail, int value);

mynode* reverse_recurse(mynode *current, mynode *next);

void print_list(mynode *);


 


 

int main()

{

mynode *head, *tail;

head=(mynode *)0;


 

// Construct the linked list.

add(&head, &tail, 1);

add(&head, &tail, 2);

add(&head, &tail, 3);


 

//Print it

print_list(head);


 

// Reverse it.

head = reverse_recurse(head, (mynode *)0);


 

//Print it again

print_list(head);


 

getch();

return(0);

}


 


 

// Reverse the linked list recursively

mynode* reverse_recurse(mynode *current, mynode *next)

{

mynode *ret;


 

if(current==(mynode *)0)

{

return((mynode *)0);

}


 

ret = (mynode *)0;

if (current->next != (mynode *)0)

{

ret = reverse_recurse(current->next, current);

}

else

{

ret = current;

}


 

current->next = next;

return ret;

}


 


 

// Function to add new nodes to the linked list.

// Takes pointers to pointers to maintain the

// *actual* head and tail pointers (which are local to main()).


 

void add(mynode **head, mynode **tail, int value)

{

mynode *temp1, *temp2;


 

temp1 = (mynode *) malloc(sizeof(struct node));

temp1->next=(mynode *)0;

temp1->value=value;


 

if(*head==(mynode *)0)

{

*head=temp1;

*tail=temp1;

}

else

{

for(temp2 = *head; temp2->next!= (mynode *)0; temp2=temp2->next);

temp2->next = temp1;

*tail=temp1;

}

}


 


 

// Function to print the linked list.

void print_list(mynode *head)

{

mynode *temp;

printf("\n\n");

for(temp=head; temp!=(mynode *)0; temp=temp->next)

{

printf("[%d]->",(temp->value));

}

printf("[NULL]\n\n");

}

Doubly linked lists

This is really easy, just keep swapping the prev and next pointers and at the end swap the head and the tail:)

#include

#include


 

typedef struct node

{

int value;

struct node *next;

struct node *prev;

}mynode ;


 

mynode *head, *tail;

void add_node(int value);

void print_list();

void reverse();


 

int main()

{


 


 


 

head=NULL;

tail=NULL;


 

add_node(1);

add_node(2);

add_node(3);

add_node(4);

add_node(5);


 

print_list();


 

reverse();


 

print_list();


 

return(1);


 

}


 

void add_node(int value)

{

mynode *temp, *cur;

temp = (mynode *)malloc(sizeof(mynode));

temp->next=NULL;

temp->prev=NULL;


 

if(head == NULL)

{


 

printf("\nAdding a head pointer\n");

head=temp;

tail=temp;

temp->value=value;


 

}

else

{

for(cur=head;cur->next!=NULL;cur=cur->next);

cur->next=temp;

temp->prev=cur;

temp->value=value;

tail=temp;

}


 

}


 

void print_list()

{

mynode *temp;


 

printf("\n--------------------------------\n");

for(temp=head;temp!=NULL;temp=temp->next)

{

printf("\n[%d]\n",temp->value);

}


 

}


 

void reverse()

{

mynode *cur, *temp, *save_next;

if(head==tail)return;

if(head==NULL || tail==NULL)return;

for(cur=head;cur!=NULL;)

{

printf("\ncur->value : [%d]\n",cur->value);

temp=cur->next;

save_next=cur->next;

cur->next=cur->prev;

cur->prev=temp;

cur=save_next;

}


 

temp=head;

head=tail;

tail=temp;

}

WIPRO PATTERN

WIPRO PATTERN AND  INTERVIEW ON 7th AUG UST 2006  AT HYDERABAD

Hi friends,

This is Goutham doing final year B.Tech. I was placed in Wipro.

On Aug 7th Wipro visted our campus (Sreenidhi Institute of Science and Technology, Hyderabad). This was the first time Wipro came to our college.

The selection procedure was like this
PPT started at 10:15 am. Written test at 11:00

Pattern was same as previous

Verbal 15
Analytical 15
Technical 20
no negative marking

Previous questions were not repeated. If ur good at grammer in ur school level its enuf to clear Verbal.

Analytical was really analytical as there were only 3 or 4 questions from quant. They were pretty easy. Rest all depends on ur talent.

As I am from Electrical& Electronics I felt Technical very tuf. I knew only 4q's in tech that too from C. God was with me. So I got thru the written test.

Suggestion for non CSE and it students is dat dont worry u can answer atleast 6 q's confidently in tech as there were some q's where u can eliminate 3 options in the first look itself.

coming to the Tech Interview

We were given only 10 minutes after the results of the written test were announced.

I was the 3rd to my pannel and was the first to be selected by him.
he: give me ur resume
me: gave him the resume
he: tell me abt ur self
me: I was prepared for it.i gave the answer promptly. I couldnt maintain eye contact initialy but i could manage it.

he: wat do u kno in C
me: basics
he: C++?
me: no. and told him the reason y i didnt learn them outside.
   its always better to substantiate such things with a reason.

he: wat is a datatype
me: gave the answer
he: asked something on linked list.
me: I couldnt hear him. so i told him i donno
he: wats the difference bet ms office xp and 2003
me: (i wrote tat in my computer skills) i told him we use only the basic features of ms office. may be there r some internet related features in 2003 which r not there in xp.

the real difference is dat office xp runs in win 98, 2000, and win xp. but 2003 runs only on win xp and win 2000 with servicepack.

he: narrated a big passage. the gist was that whether a file created in office 2003 be opened in office xp.
me: yes sir it can be without a problem
he: r u sure 
me: yes sir. i tol him our college has xp and i have 2003 and we often transfer documents.

he: any questions?
me: asked him two questions related to technical only. dat was a plus point for me.
he: then told me to wait outside and told that he will let me kno
me: thank u sir.he forwarded his hand and i did the same and gave a firm shake hand.

within few min I was given a form for hr interview. It was very lengthy and almost took 20 min to fill. Within next 10 min after filling the form I was called for HR interview.

Interviewer was a lady.
she: tell me abt ur ur self
me: tol her same thin letter to letter as i tol in tech.

this time eye contact was not at all a problem

she: (i told her something on my introspection in my intro) she asked gimme an incident as an example.

me:i didnt expect her to ask it.but suddenly an incident flashed into my mind. it really happened in my first year.i told her dat.

she: tell me abt ur family
me : told her
she: y didnt u get placed in CTS and TCS?
me: (cts and tcs came to our college on 3rd of aug) I told her i didnt clear their written.

she: wat did u learn from dat
me: I was not expecting dat but my mind was alert as I was not at all tensed. I told her tat donot fall for temptation from CTS and do not prepare more than ur caliber from TCS.

she: why wipro?
me: I was perpared for this question. i tol her three points abt wipro in which i gave her a hint tat i prefer working in south india.

she: wat if i place u in gurgoan (wipro is there in gurgoan) 
me: no problem i will work there for a couple of years and take a transfer and come back to south.

she: wat do u think abt ur college:
me: told her all the good things which i knew abt our college (our college is really popular for its placements, thanks to ur placement officer). first i told her tat our college has good placements and good companies r coming and i also told tat Wipro is one such company

its always good to boost abt ur college though u dont like somethings in ur college describe those points in which ur college is different from other colleges.

then she told me "ok u can leave"

i told thank u and left.

interviews for me were over by 4:15 pm

I waited upto 8 :15 then results were announced and my name was there.

Infact the hr was so easy tat all my friends who cleared tech got thru hr. Some of them were asked only one question: why wipro or why shu i hir u? and they were all selected. EEE students gave their best on tat day.

My suggestion to those preparing for campus placements is dat, do not expect much before u get selected. Write the test as if ur writing ur internals. Be practical, be cool.

Never never never loose in hr interview. So donot expect any questions tat u prepared for. Only two things will be looked for: they r confidence and eye contact and truth in ur answers. So donot bluff.

Before u go for interview learn new things abt ur self which u dont kno and try to boost those in the interview and ur resumes. U kno ur self better than others. If u kno ur self better then u will kno wat to answer for wat.

Believe in yr self, believe in god, believe in ur parents then u will definitely get thru the interview.

Sunday, October 7, 2007

Jobs HR GD Gre Gate C C++2

C / C++  Questions

21. What is the ouptut in the following program

main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}

a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these

Ans. (c)

22. What will the following program do?

void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//

a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1

Ans. (b)

23. In the following code segment what will be the result of the function,

value of x , value of y
{unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT

Ans. (a)

24. What will be the result of the following program ?

char *gxxx()
{static char xxx[1024];
return xxx;
}

main()
{char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}

a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these

Ans. (b)

25.  Find the output for the following C program

main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}

 Ans. An empty string

26.  Find the output for the following C program

main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}

Ans. 57 94

27.  Find the output for the following C program

main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}

Ans. 5 20 1

28 Find the output for the following C program

#define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}

Ans. 10 5


29 Find the output for the following C program

main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}

Ans. Samco Systems


30 Find the output for the following C program

#include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}

Ans. Compilation error giving it cannot be an modifiable 'lvalue'


31 Find the output for the following C program

#include<stdio.h>
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}

 Ans. RamcoSystems


32.  Find the output for the following C program given that
[1]. The following variable is available in file1.c
static int average_float;

Ans. All the functions in the file1.c can access the variable


33.  Find the output for the following C program

# define TRUE 0
some code
while(TRUE)
{
some code
}

Ans. This won't go into the loop as TRUE is defined as 0

34. struct list{
       int x;
      struct list *next;
      }*head;

        the struct head.x =100

       Is the above assignment to pointer is correct or wrong ?

Ans. Wrong

35.What is the output of the following ?

      int i;
      i=1;
      i=i+2*i++;
      printf(%d,i);

Ans. 4

36. FILE *fp1,*fp2;
     
      fp1=fopen("one","w")
      fp2=fopen("one","w")
      fputc('A',fp1)
      fputc('B',fp2)
      fclose(fp1)
      fclose(fp2)
     }

     Find the Error, If Any?

Ans. no error. But It will over writes on same file.

37. What are the output(s) for the following ?

38. #include<malloc.h>
      char *f()
      {char *s=malloc(8);
        strcpy(s,"goodbye");
     }

      main()
      {
      char *f();
      printf("%c",*f()='A');     }

 
 

 
 

39. #define MAN(x,y) (x)>(y)?(x):(y)
      {int i=10;
      j=5;
      k=0;
      k=MAX(i++,++j);
      printf(%d %d %d %d,i,j,k);
      }

Ans. 10 5 0

40.
void main()
{
int i=7;
printf("%d",i++*i++);
}

Ans: 56