Wednesday, June 23, 2010

My Interview With Google

Today I had an interview with Google at their Gurgaon office.
The position was that of a Tools Developer.Skills they were looking for were CoreJava,XML,Ajax.Not to mention they were looking for Data Structures , Algorithms and Analytical Skills.
It was a client hiring.So basically my employer would be another company Rofous Software and I would be working with Google on a project.

Round 1(This was with Rofous software)
It was very simple.They asked about OOPS concepts, Serialisation, bit of threading,bit of OS process scheduling,some javascript questions and some questions on AJAX.
I cleared this round and was informed about it the next day.

Round 2(With Google at Google Gurgaon)
This was a face to face techinical round.On reaching the venue I was given a sticker with my name and Google Interview Candidate imprinted on it.I had to put it on my shirt.After that i was asked to wait.After 5 minutes 2 guys came and took me into the interview room.Both of them were young.They started off very casually and asked me to introduce myself.Then they asked my current project.After that they moved to Core Java.
Core Java questions
What are annotations?
Have you used Generics?In generics what is the utility of "? extends X" and where it can be used.
What is recursion.Write a program to print an array using recursion.Now print the array in reverse with minimal code change(Actually they wanted to check if I know the recursion concept i.e elements are put in stack so to print in reverse we have to use this concept)
What is HasMap.Implement a Hashmap in java.How will you determine what bucket size you should use in hashmap.
Write code to delete Nth element in LinkedList
How to find duplicate elements in a link list.
Write java code to validate an XML(I suggested use of a stack)
Last question was a puzzle.You have 3 balls in a basket.You have to give one ball each to the 3 people but the basket should not be empty.How do you achieve that.

I answered most of the questions but the LinkList algorithm which i suggested to remove duplicates was not optimal.Also I faltered a bit in the recursion program to print elements in reverse.The puzzle I was able to solve with some hint.

I was told to wait outside.Then a guy came and told that I could leave for the day and they would call me on a later day if I qualify.













Wednesday, August 19, 2009

Hashmap vs Hashtable in java

1---Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones.

2---Hashtable does not allow null keys or values. HashMap allows one null key and any number of null values.