Saturday, February 09, 2008

Intuit.. Applied as a fresher.

It was on Friday at 11AM.. I thought it was a GOOD Friday for me as i was confident that i will clear the interview but unfortunately it wasn't.. I reached the Company at 10.35AM.. Vijay Dixit (contact person whom i had to meet) came at around 10.50AM with a Question paper and the same was asked to complete in 1 hour.. I was left alone in a meeting room..

-----------------------------------------------------------
Round 1) Written Test:

The Question paper consisted of 12 questions which consisted of
1-5 Marks question,
4-3 Marks questions,
1-2 Marks question and
6-1 Mark questions.
-----------------------------------------------------------

I answered almost all the questions except 2-1 Marks questions and 5 Marks question partially.. Anyway, i cleared written round and within 15 minutes i was started off with the technical interview.

Chandru, the guy who came to walk me through the technical interview for me entered the room.. He asked me whether i have some water or coffee.. I replied "Yes, Water would do good as i dint had my breakfast in the morning".. He gave a gentle smile and took me to an area where i had water.. I was relaxed.. Then we went back to the meeting room.. He asked me to take my seat after which i did the same.. He gave a small introduction about himself saying his name is Chandru, joined Intuit recently 2 months before etc..

-----------------------------------------------------------
Round 2) Technical Interview:

There was a question in the written round which asked to give an algorithm to get the mirror tree from the given tree.. Chandru asked me to write a program in any language for the same.. Since i was not sure about the traversing i told him that i am not sure about coding..
Code for Mirror the tree:
-----------------------------------------------------------
/*
Change a tree so that the roles of the
left and right pointers are swapped at every node.

So the tree...
| 4
| / \
| 2 5
| / \
| 1 3

is changed to...
| 4
| / \
| 5 2
| / \
| 3 1
*/
void mirror(struct node* node) {
if (node==NULL) {
return;
}
else {
struct node* temp;

// do the subtrees
mirror(node->left);
mirror(node->right);

// swap the pointers in this node
temp = node->left;
node->left = node->right;
node->right = temp;
}
}

-----------------------------------------------------------
Then he asked me about JVM, i answered.. He was not satisfied.. I din't know what he was expecting me to answer, so i asked him what exactly he was expecting me to answer.. He replied anything.. Next, he asked me to Reverse the words in a given sentence, i repeat he asked me to reverse the words not the character.. Say suppose the given sentence is "India is a great country" the output should be "Country great a is India".. I came up with an answer how to solve the problem.. But he asked me to code it.. Since i had no practice of coding for a long time i couldn't code.. Next i was given a puzzle.. There are 50 floors in a building and i have given with two glass balls, how do i find from which floor the glass balls break when i drop it.. I came up with the answer saying Linear search, Binary search and some more Methodologies.. But he was not satisfied.. I don't know what he thinks about himself.. He was not satisfied with any of my answers.. I wonder whether he was expecting me to be better than him in Coding.. I know he is an X-Employee of Microsoft, but he had no need to show it off..
Anyway, for Reversing the words in a given sentence the code is as follows..

-----------------------------------------------------------
In C:
-----------------------------
#include"stdio.h"
#include"stdlib.h"

int reverse(char *string, char delimiter)
{
char *src, *dest;
char *temp = string;

while( *temp )
{
if (*temp == delimiter)
{
temp++;
continue;
}

src=dest=temp;
while ( (*(dest+1) != delimiter) && ( *(dest+1) != '\0' ))
dest++;
temp=dest+1;
while( dest > src )
{
char tmp = *dest;
*dest = *dest-- *src;
*src = *src++ tmp;
}
}
return 0;
}

int main()
{
char name[] = "India is a great country";
printf("%s\n",name);
reverse(name,' '); /* Space as delimiter, Reverse Words */
printf("%s\n",name);
reverse(name,'\n'); /* Reverse Complete Sentence */
printf("%s\n",name);
}
-----------------------------
In C++
-----------------------------
#include
#include
using namespace std;
int main()
{
char str[]="India is a great country";

string ans;
int n=0;
while(str[n]!='\0')
n++;
bool flag=true;
for(int i=n-1;i>=0;i--)
{
if(str[i]==' ')
{
int m=i+1;
string temp;
while(str[m]!=' ' && m < n)
{
temp+=str[m];
m++;
}
if(flag)
{
ans+=temp;
flag=false;
continue;
}
if(flag==false)
{
ans+=' ';
ans+=temp;
}
}
}

cout << ans;
system("pause");
return 0;
}
---------------------------
In Java
---------------------------
import java.util.*;
public class StringReverseWord {

private static void doStringReverseWord() {

String a = "India is a great Country";
Stack stack = new Stack();
StringTokenizer tempStringTokenizer = new StringTokenizer(a);

while (tempStringTokenizer.hasMoreTokens()) {
stack.push(tempStringTokenizer.nextElement());
}

System.out.println("\nOriginal string: " + a);

System.out.print("Reverse word string: ");
while(!stack.empty()) {
System.out.print(stack.pop());
System.out.print(" ");
}

System.out.println("\n");
}
public static void main(String[] args) {
doStringReverseWord();
}

}

-----------------------------------------------------------
After the Technical round Vijay Dixit came in and told me that i was done with the Interview and i can move.. I just asked him about the Discussion round with the Manager which was mentioned in the mail.. He told me that it has been skipped.. I was sure then that i dint clear.. I was DISAPPOINTED..
I believe in:
"CODING IS NOT THAT IMPORTANT.. PEOPLE WHO KNOW TO CODE MIGHT NOT BE ABLE TO ANALYZE THE PROBLEM AND COME OUT WITH A RIGHT SOLUTION BUT PEOPLE WHO CAN ANALYZE THE PROBLEM CAN CODE IT.."
"WE CAN LEARN CODING BUT NOT THE THINKING CAPACITY AND CAPABILITY"
"CODE CAN BE REUSED BUT WE SHOULD BE KNOWING HOW DO WE DO THAT!!"
I dint even had my lunch as i was feeling low.. Later, Vijay Dixit asked me to stay saying that i would be having Discussion with the Manager.. I got some hopes..
-----------------------------------------------------------
Round 3) Discussion with the Manager.

Balaji, the manager, was looking Handsome and Smart.. We went to a meeting room at about 1:30PM.. He asked me about the work type at Infosys and what do i do there.. He then asked me to pick up a topic so that we can have a great discussion.. I picked JAVA.. As Java is vast, he asked me to pick some particular topic in it.. I picked up Inheritance.. So, he asked me to write a code in Java to connect to the database and execute a simply select query.. I was not sure about the code as i used to reuse the code and never byheart..

Code is as:
---------------------------
Connection connection=null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
connection=DriverManager.getConnection("Host Details","Host Name","Password");
Statement statement = connection.createStatement();

if (connection==null)
{
out.println("error");
}
PreparedStatement preparedStatement = connection.prepareStatement("Query goes here");
ResultSet resultSet = preparedStatement.executeQuery();
}
---------------------------
Then i took Data Structures as a topic.. He asked me when do i use Arrays and when do i use Linked Lists.. I answered, Arrays are used when the data has to be accessed randomly and Linked Lists are used when the data can be accessed sequentially.. But i forgot to mention that Arrays are used for Static declaration and Linked Lists are used for Dynamic declaration.. Finally, i took Virtual functions as a topic for discussion.. I explained him with diagrams.. I explained him about "Diamond of Death", the need for Virtual Functions, Object Infrastructure and Virtual Table.. Then we discussed about a couple of problems from the question paper.. He told he was impressed.. I felt happy.. I forgot to show him couple of Excellent feedbacks which i received from the customer at Infosys which i had it in my file.. He told me that he was done with the interview and do i have anything to ask.. I just smiled and asked him how my performance was.. He replied saying i would be knowing about my performance.. I told, To me i did good but with your perception it might be different.. He just smiled and asked me to wait as Vijay Dixit would be contacting me..
I really enjoyed having discussion with Balaji.. He is really GREAT guy to meet.. I was impressed the way he spoke etc..
-----------------------------------------------------------

I was waiting for Vijay Dixit.. He came and told me that i was done with the interview.. I just asked him when do i get to know about the results, whether they would mail me or they would give me a ring.. He told me that he would let me know about the results by any means of communication on Monday.. I just came out with colors..

But the same night, i got to know that i haven't cleared as i didn't do any of the coding stuff.. I never knew they would expect me to know the coding for a fresher role.. I was disappointed.. Whats in MY hands?? Had a nice Experience, i learnt from it.. Anyways, now BYHEARTING some code snippets so that when i go again i can just put it down on a PAPER.. It MATTERS for them.. ;) WATEVER HAPPENS is for GOOD.. Believe they don't DESERVE ME.. Thats ATTITUTE, Never get it DOWN.. :)