Showing posts with label Interviews. Show all posts
Showing posts with label Interviews. Show all posts

Sunday, April 13, 2008

Do I really understand Java? or Computer Science, for that matter?

Like I mentioned in my previous post, I was with Javaground being interviewed for the Developer position. It was an overall amazing and a great learning experience. I am so much thrilled for having interviewed with them that I have been thinking a lot on how I could be like them. The java we write is so lame. I gave a talk on optimizations and now I feel embarassed that I am not eligible to give such a talk. And I did cover a lot of material and left out a lot. But talking with the Javaground team made me realize that I am not as good I felt I was.

I was honored to be in their guest house along with a developer from their Canada team. He was Nigel and I should say that he was amazing and very impressive, very pleasant to talk and very down to earth. He told me simple things that no one would ever find in a book, I bet. So the aspect he told me was "comparisons with a 0(zero) is much faster than with any other numbers". This was just one of the quiet a lot of information he shared with me. Though not always "java" we talked about, he told me various other things - about life as a mobile developer, how mobile game works, stuff like that.

Anyway, I decided I would look into the "comparison with zero" to understand more. So just now I wrote two simple programs - Hello and Hello2. The Hello.java looks something like this:

public class Hello{
        public static void main(String[] args) {
                 int i = 0;
                 if(i < 1) System.out.println("Test");
        }
}

The result of running javap is shown. (After compiling with javac)
javap -c -private -verbose Hello

Let me show you the output ....

Compiled from Hello.java
public class Hello extends java.lang.Object {
    public Hello();
        /* Stack=1, Locals=1, Args_size=1 */
    public static void main(java.lang.String[]);
        /* Stack=2, Locals=2, Args_size=1 */
}

Method Hello()
   0 aload_0
   1 invokespecial #1 <Method java.lang.Object()>
   4 return

Method void main(java.lang.String[])
   0 iconst_0
   1 istore_1
   2 iload_1
   3 iconst_1
   4 if_icmpge 15
   7 getstatic #2 <Field java.io.PrintStream out>
  10 ldc #3 <String "test">
  12 invokevirtual #4 <Method void println(java.lang.String)>
  15 return

I have made the lines of interest bold. Now my Hello2.java looks like this:

public class Hello2{
        public static void main(String[] args) {
                 int i = 0;
                 if(i < 0) System.out.println("Test");
        }
}

Now let us look at the javap output shown in the listing.

Compiled from Hello2.java
public class Hello2 extends java.lang.Object {
    public Hello2();
        /* Stack=1, Locals=1, Args_size=1 */
    public static void main(java.lang.String[]);
        /* Stack=2, Locals=2, Args_size=1 */
}

Method Hello2()
   0 aload_0
   1 invokespecial #1 <Method java.lang.Object()>
   4 return

Method void main(java.lang.String[])
   0 iconst_0
   1 istore_1
   2 iload_1
   3 ifge 14
   6 getstatic #2 <Field java.io.PrintStream out>
   9 ldc #3 <String "test">
  11 invokevirtual #4 <Method void println(java.lang.String)>
  14 return

As you can see the highlighted section again, we would notice an operation missing. So let me put the areas of interest together, side by side.

i < 1

i < 0

   0 iconst_0
   1 istore_1
   2 iload_1
   3 iconst_1
   4 if_icmpge 15
   0 iconst_0
   1 istore_1
   2 iload_1
   3 ifge 14

Frankly, I do not understand the bytecode so well yet, but I do can make out that in comparison with a 1, there is an instruction that creates the constant 1. Where as for comparison with 0, that instruction is missing. I could recall something similar that we learning during Computer Architecture class and the Embedded Systems course that I attended. I wish I invested more time in those classes. How foolish I was back then?

This is not a big deal when you have server class machines or a laptop for that matter. Saving a couple of instructions - no big deal. But in a mobile environment, it makes sense. So out of 200000 odd lines that we write, if we could only save 2 instructions per 100 lines, that would save us 2000 instructions !!! and it is a lot given the limited resources of a mobile device.

I am very interested in gaining such knowledge and it is only possible, at the moment, when we work at companies like Javaground. I could get a job as a web developer or as a C# developer at any point of time in my life but opportunities like Javaground does not often come. And I have worked very hard for this opportunity. I gave 3 rigorous online tests, attended around 6 interviews and after all I wish if only I could prepare better. "If" i am lucky and "if" I get an offer from Javaground which is good enough for me to make a proper living, then I would see myself learning a lot from the immense talent that Javaground possess and hopefully one day see myself as one of their core people. I know there are a lot of such firms but at the moment, the only such firm that has interviewed me is Javaground. 

The two days made me realize, there is so much I should learn!

Friday, April 11, 2008

What is my favorite programming language?

Well this was one of the tons of questions I was asked during my interview with Javaground. Anyway the environment at the company looked so serious and everyone was kind of busy all the time. I like such a challenging environment and have to see if I was "good enough" to be a part of it. I have an offer with a service company E*Trade but I am not too sure about it. Unless the pay is relatively less at Javaground, I do not want to lose an opportunity to work for them. If I work at Javaground, I would:
1. write optimized code, probably someday write a whole new book on code optimization.
2. work with one of the best minds in the software industry. great developers and everyone talks about compact and great code.
3. better future - game devs make a lot of 1. money 2. fame 3. knowledge about s/w and h/w.

Atleast from what I see, I think they are looking for a good programmer who has strong basics and knows what he writes.
What is my favorite question?
Xavier Kral, the CTO of javaground raised this question. I always felt different about different languages. So let me start one by one.
C - Definitely not my favorite.
C++ - Great language, but then not my favorite - I do not admire or adore pointers
Java - definitely a contender. Write great software in less amount of time. Java is a cool language. Come Java 7 you have closures and it would revamp the style of Java code.
C# - Right now, my best language. The language I am most good at. The C# 3.0 features are amazing.
Groovy - Definitely a great scripting language that is on top of JAva.
So what is my favorite? I feel confused. When I work on Java for a long time, I feel Java is the best thing that has happened to the developer community. But when I work on C# for a long time, I feel C# is much better than Java. So which is my best language? - I prefer C# when working on windows and I prefer Java when I want something on Linux. Both has its pros and cons.
Why game developer job?
The charisma of a game developer is totally different. A game developer is more attractive to girls than a mainframe developer. I am kidding, but I like the challenge to work on real projects which constantly puts your skill to think and code to test. It is great to actually feel as a game developer. So again the reasons I list out are:
1. Game dev make a lot of money, if not now atleast in the near future.
2. Game dev tittle is more attractive than anything else.
3. If there is a possibility that I would own my company or become a major part of a startup, then it is possible only in the Game Development Industry.
4. Even if the economy is not all that great, Game Industry will always survive -> I would always be in demand and it would only increase with time.
5. If I work hard enough, I would end up becoming a very popular developer in the community.
6. The amount of knowledge you gain as a game developer is immense. You create a form of life in the form of games and you should feel close to god!

Saturday, October 20, 2007

CapGemini Second Round of Interview

I had my second round of interview at CapGemini TME Office at Atlanta. It was a great office, looking very much like my old office at Kanbay, but the difference being everyone had their own private cubicles unlike at Kanbay. The interviewer Mr. Micheal talked to me about the pros and cons of having a common space for everyone. Anyway coming to the interview aspects, it was everything about behavioral aspects of a consultant. I was kind of under-prepared for this kind of an interview and add to that the candidates whom I met during my wait time, most of them from GaTech! That kind of put me off to a defensive stand, come on everyone would be afraid to meet top notch engineers, consultants from a top-notch College. And it took me quite a long time to get into the "good" mode that is needed to do an interview well.
Well coming to the experiences part, I really think that it depends at least 50% on the interviewer that impacts your performance during an interview. The first round was not all that great, the interviewer had my resume, he had a list of questions, almost four pages long and I was all done in 20 mins! isn't that too long and it was kind of mechanical, routine nothing that exciting to make me talk a lot about my experiences. I think I did well on that. I was asked a series of questions and all of these were behavioral. They tested you as a team leader, as a motivator as a problem solver. They test your team leadership skills more than what they talk about your academics. questions like tell me a situation when you had too little time to a lot of things, tell me a time when you went through a lot of stress and how did you cope it. I think I did fairly well.
The second round was the one I liked the most. It was one of the best interviews I had and I have had interviews with almost 10 different people and it was a really great interview. Again, I was tested on the very same things - leadership, motivation skills, commitment, learning ability.
I think I did well. I am not sure if it is often the case, but this is the first time I have been walked out of the interview till the exit door by the interviewer himself and he appeared to be very impressed.
Irrespective of the result, I think I had a terrific experience of getting interviewed at CapGemini, especially my first round of interview with Spencer Lentz and the final interview with Micheal. Both were amazing people with great interviewing skills. I hope everyone of my friends would get such a great interviewers for their interview.
If anyone reading these posts need some light on CapGemini interviews please leave me a message at krishnabhargav@yahoo.com!

Monday, October 08, 2007

Interview with CapGemini

I have tried to search for some links which would give me some information on interviewing with CapGemini U.S but could not find any thing that was free. Well, I thought I would share some of my experiences. I had an interview with CapGemini today at UGA with a Senior Manager and I guess I cannot mention his name without his consent.
Anyway the interview was for "Staff Technical Consulting". It was more about conversational interview and we did not talk much about technical aspects. The interviewer, I guess was looking for more on the behavioral aspects of me, as a prospective consultant. The questions were more on the lines of "describe a situation where you motivated a team", "describe a situation where you had a lot of work to do and less time", etc.
I think I did a good job, I answered the questions and let us see if i can make it.
For those who would attend a similar interview, in case you need some more information feel free to mail me at krishnabhargav@yahoo.com