Loading...

Saturday, September 24, 2011

An exciting last year in college and my awesome first job


Its been a long time since I last updated my blog. The reason is not that I didnt want to or that I didnt have time for it. I just didnt do it. I have thought about a post numerous times, but have never actually written it. So today I thought, lets do it :)

A lot of things have happened since my last post.

The last year in college was pretty exciting! Got two gold medals (:D :D) and we won the overall team trophy at Envisage'11 (as a result of which, quite surprisingly, we featured on the home page of the college website as well ;)).





And after I got placed in the first company I applied for on-campus(Microsoft),  the Amazon-g trip and the free (!!) trip to California for the Facebook interview, I finally joined Google (as a Software Engineer :D) and here I am at Bangalore, writing this post from my new MacBook Pro (;))!

To be very honest, I was a bit disappointed to land up at Bangalore. I was almost ready for Hyderabad. But  2 months later, I dont think I could have been happier. Bangalore is awesome. I had heard some great stuff about the weather here, but there is nothing like actually experiencing it yourself. You wake up each morning and breath fresh cold air, you sleep late at night with awesome weather around you. It all feels so great!!
Its only when you go out on streets that you feel the pollution is a bit too much. It is when u r struck in traffic for a really long time that you feel a bit disappointed, but then like all places around the world, Bangalore is not perfect. But I like it!!

Google is just amazing! I am in a great team and I really feel like I've got exactly what I wanted. I am in the mapmaker team (:D), which allows you to update the ever-changing maps. To enable users to edit every aspect of a map is a very challenging problem and team at Bangalore is working really well to solve it. There are a great bunch of passionate Software Engineers here and sometimes you dont mind working late at nights or in the weekends when you feel a little more effort on your side could make so many millions of users of your product happy!

Google and Bangalore seem to be a deadly combination :)

Well to conclude this post, the times gone by have been exciting and the future seems to be better ;)

Friday, November 12, 2010

The Amazon-g Trip !!!!!

10 Nov, 2010. 3:30 AM : I got up. Yes that's right, I got up at 3:30AM :) And still its not the reason why the day will be remembered. (Remember, remember the 10th of November !!!!!). I knew it was going to be a gruelling day. Had to catch a 6:15 AM flight :) Got ready quickly and was ready to leave for the airport by 4:45.
Around 5:25 AM : Should have reached airport by now. Was very near to the airport, when we took a wrong turn by mistake. We thought we will take a U-turn and this should not be a problem. It would not have been a problem, if we were not running short of time. As it turned out, that wrong turn even resulted in the front tyre of my car being punctured. When you are late all your activities take a little longer than usual!
Somehow was able to find an auto on an empty road and reached the airport by 5:40.
At the airport: At the boarding pass counter:
Lady: Please come in line.
Me: Please allow me. I am running a bit late.
Lady: Which flight are you on?
Me: The 6:15 flight to Hyderabad.
Lady: Sorry, you are required to reach here at least 45 minutes before the scheduled departure. You cannot board the flight now.
Me to myself: Wow! Another twist in the tale. This is gonna make a great blog post :P :)
Me: Please mam. Pls do something. I have already done my web check-in. Passed her my ticket. I was traveling Business Class (Yes, Amazon had booked me on business class!!!!!).
Lady: Let me see.
She called someone and told them that she had a business class passenger with her. And it worked! She gave me my boarding pass :)
Now that I had the boarding pass, I was sure I'll make it! Jumped the line for security check and got over it quickly. Boarded the flight safely. Thanks Amazon for the business class ticket. It was the first time I was traveling in that class.
On the plane: As soon as I sat on the seat, the first thing that came to mind was that I had forgotten to bring a camera! Damn, no pictures :( (That is why this will be an all text post, unlike some of my earlier picture only posts!).

The guy sitting next to me, asked the hostess about entertainment system on-board. The air-hostess refused and the guy promptly took out his MacBook Pro and tuned into Quantum of Solace! I wasnt carrying my laptop but didnt even need it. Experiencing the Business class hospitality for the first time was more entertaining than any film on my laptop.
Overall, the experience in the plane was awesome. Enjoyed every bit of it!
Hyderabad: At 8:15 was back to the city which I have visited most often, after of course my home, Delhi. The weather as expected was awesome. The Amazon cab took us (me and Akhil) to the office.
Akhil had reached 25 minutes after me. He had traveled by the an Indian Airlines flight (Economy class :P).
11:00 PM: Reached the Amazon office. The HR was waiting for both of us. She asked about our flights, breakfast and after 5 minutes, we were ready to start our interviews!
Akhil was the first one to start. I had to wait for an hour for my interviewer!
At 12:30 my first interview started and lasted till 1:30. When I came out, the HR told me that Akhil had started with his second interview and when he completes, we will proceed for lunch. My interviews would then be after lunch.
I had heard a lot of negative comments about food at Amazon, and after 2 months at Google, I was sure that I cant like the food anywhere else! But my empty stomach didnt stop. By 3, I was ready for my next interviews. Now, I was the first one to go. Akhil had to wait a bit. My interviews happened back to back from 3:15 to 4:15 and then from 4:20 to 5:20.
By the time I came out, Akhil was finished with his interview and told me that we were again very late for our flights. He had to catch a 7:15 flight and hence should have left for the airport, by at max 5:15. Luckily, my flight was delayed to 8:25. Probably, now it was time for Akhil to experience the same thing! But he wasnt travelling Business class and we hadnt even done web check-in. :(
We rushed quickly and thanks to the driver, we reached the airport by 6:30 (Just 45 minutes before the scheduled departure!). But thankfully, Akhil had no problem this time and boarded the flight easily. And then came the news that my flight was further delayed to 8:55 :(
Had to wait on the airport alone. And to add to it, my phone got switched off due to low battery!
At 9:10 the plane finally took off and at 11:15, I was back to Delhi! Back home :)
Now just hoping that the hard work pays off and Amazon announces a great result!!
Fingers crossed...........

Wednesday, October 20, 2010

Moments after The Microsoft offer :)

All four selected students (2 leftmost and 2 rightmost) with the Microsoft interviewers (in between) ;)


Sharing the joyous moment with friends.

Monday, October 4, 2010

My First two days at the Games Village !!!!!

With the Canadian Gymnast team after their welcome ceremony

The awesome facilities for the athletes to unwind

The group of 'Village Operations Assistants' assigned with the canandian team

Watching the athletes train at the Games village



At one of the flats for athletes

Friday, September 17, 2010

US NSA access in every copy of Windows

Did you know that the US National Security Agency (NSA) has an inbuilt backdoor entry in every copy of Windows?
Read more...

Sunday, July 4, 2010

My first Pay Cheque!!

On July 2, 2010, I got my first pay cheque from Google :)
Well the amount Rs. 13,519 may not be great but its good to start with and the fact that I got it from one of my dream company "Google" makes it perfect for me.



I joined Google India, Hyderabad office as a Software Engineer in Test (SET) Intern on 14th June, 2010.
Google payed for my flight tickets, is taking care of my food and accomodation and still paying me a monthly stipend of Rs. 25000 :D
The facilities here are awesome. The Engineering Guest House, located in the posh area of Banjara Hills, is a 3 storey building. It boasts of TT Table, fooseball table and home theatre in the common area and TV, AC and 24-hour net connection in each room.
The Google Office (Omega building), located at Jubilee hills is almost 7 km from the Engineering Guesthouse. It is a 6 storey building with floors 1 to 4 mainly occupied by AdWords: Google's main source of revenue.
Google's Engineers occupy the top floor of the building. The office boasts of a bakery, snooker tables, Bunker rooms (for Sleepy engineers), Gym, Massage room, fooseball tables and even a library. There are break-out areas on each floor where people come to simply relax. Google actually follows a 70-feet rule which states that wherever you be in the google office, food will not be farther from you than 70 feets. Not to mention that the food at Google (office or guesthouse) is absolutely free :)
I am having a great time here and the time I spent here will definitely be one of most memorable moments!

Friday, June 25, 2010

Sample Thrift Program for Server in Java and Client in C++

Objective: To create a Java Server which prints ping on the console output each time a C++ Client connects to it and calls the function ping().


I use Facebook's Thrift for implementing this IPC.


First of all install Thrift:

To get a thrift tarball file go here and extract it. Before installing it, we need to resolve some dependencies which can be resolved by running the following command on an Ubuntu machine:


sudo apt-get install libboost-dev automake libtool flex bison pkg-config g++


To get a list of dependencies for other platforms, consult this:

Now to install thrift simply run the following commands from the thrift folder you just extracted:

./configure

make

sudo make install


This should be sufficient to install thrift on your machine. Later though I still got the following error while running the executables for which I had to copy my thrift library files from /usr/local/lib to /lib:

error while loading shared libraries: libthrift.so.0: cannot open shared object file: No such file or directory


If you still face some problems, try consulting this or leave a comment.


Now with Thrift setup on your machine, lets begin the real work!


First of all we write a sample.thrift file:

namespace cpp Test

namespace java Test

service Something {

i32 ping()

}


And then a C++ client:

Run: thrift --gen cpp sample.thrift and I get a couple of autogenerated files in gen-cpp folder. You can build them to get the Server.cpp file, but you have to write a C++ Client yourself. Ways to build your C++ Server and to write a sample C++ Client are clearly explained here.

My C++ Client thus looks like this:

#include "Something.h" // One of the autogenerated files

#include[<]transport/TSocket.h[>]

#include[<]transport.TBufferTransports.h[>]

#include[<]protocol.TBinaryProtocol.h[>]


using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;

using namespace Test;

int main(int argc, char **argv) {
boost::shared_ptr socket(new TSocket("localhost", 9090));
boost::shared_ptr transport(new TBufferedTransport(socket));
boost::shared_ptr protocol(new TBinaryProtocol(transport));

SomethingClient client(protocol);
transport->open();
client.ping();
transport->close();

return 0;
}


Your C++ Client is thus easily ready. You can check that its working fine by running the C++ Server and pinging it through the C++ Client. If this works, your C++ Client is ready.


Java Server

Now this for me was the most difficult part. When I run: thrift --gen java sample.thrift

I get a Something.java file in a gen-java folder.

Then I wrote a Server.java file myself by taking help from the Java Server given in thrift/tutorial/java/src. The exact Server.java is as follows:


import org.apache.thrift.TException;

import org.apache.thrift.protocol.TBinaryProtocol;

import org.apache.thrift.protocol.TProtocol;

import org.apache.thrift.server.TServer;

import org.apache.thrift.server.TSimpleServer;

import org.apache.thrift.transport.TServerSocket;

import org.apache.thrift.transport.TServerTransport;

import Test.*;

public class Server {

public static class SomethingHandler implements Something.Iface {

public SomethingHandler() {

}

public int ping() {

System.out.println("ping\n");

return 0;

}

}

public static void main(String [] args) {

try {

SomethingHandler handler = new SomethingHandler();

Something.Processor processor = new Something.Processor(handler);

TServerTransport serverTransport = new TServerSocket(9090);

TServer server = new TSimpleServer(processor, serverTransport);

// Use this for a multithreaded server

// server = new TThreadPoolServer(processor, serverTransport);


System.out.println("Starting the server...");

server.serve();


} catch (Exception x) {

x.printStackTrace();

}

System.out.println("done.");

}

}


I am using Eclipse IDE for developing my java project.

Now here are a lot of dependencies which need to be resolved.

First of all in the new Java Project, I had created, I added my Server.java to the default package and added the Something.java to a Test package.

Hence my package hierarchy now looked as:

ThriftServer(Project Name, You can give any)

-src

--default package

---Server.java

--Test package

---Something.java


Now you need to go to thrift/lib/java and have a look at the README file present to install the java libraries required.

just run the ant cmd from thrift/lib/java in your terminal and you will get a libthrift.jar file in the same folder.

Now to resolve the org.apache.* imports in your project, add this jar file to your project. You can have a look here to see how this is done.

After doing this, you will still be unable to resolve import errors for org.slf4j.Logger and LoggerFactory.

To resolve them, download slf4j-1.6.0.tar.gz from here.

Extract it and add the following two jar files to your project:

  • slf4j-api-1.6.0.jar
  • slf4j-simple-1.6.0.jar


Now your project should be completely-error free and ready to run.

Just right-click on Server.java and goto Run As-> Java Application

You should see "Starting the Server...." in the console indicating the server is running fine.

Now run your C++ client from a terminal and you should see ping on the console in Eclipse each time you run your client.

This indicates your Server-Client architecture is ready and fully functional.
Now you can use it to create some great stuff or atleast try and solve some good puzzles on the Facebook Thrift Puzzle Server!!

Enjoy!!