Latest Entries »

Time to revamp the blog

Hi readers 🙂

It has been long since I contributed to this blog. Now, I feel , is the time to revamp the blog. I will try to categorize my posts into following –

1. Programming/Technology

2. Politics

3. Others

for now, until the posts are numeric enough to have their own separate blogs 🙂

It happened! After many failed attempts and 3 and 1/2 years of wait! It was bound to happen, sooner or later!

It was 5 in the morning. The wing had a deserted look. The block always looked a little scary at odd hours. With not a sound, not a movement, not even flicker of light, I always found mega block, which is a huge building, to be hypnotic and give an eerie feeling. But today was not the day. Today was the “trip” and soon I would find people waking up and getting ready for the “trip”.

It was going as per my schedule, and by 530 I was ready to leave. But to my disappointment I found only 11 people got ready by then. It wasnt really surprising, I knew not all will be ready on time. Hungry, and ready to leave, we all set to Thadambail to have breakfast of buns and sambar. I have, of late, started to like that stuff, its something available only in this part of the state. The buns were good, not oily, with soft center and a tinge of sweet and chilly(?). The rest of the class also joined us soon. With all of us nourished, we set out on the trip by 730.

Unfortunately ( or fortunately? ) the girls did not join us. Some had backed out at the last moment due to various reasons. With it being an all guys trip, its nature had completely changed. The implications being free flow of ideas, thoughts and motives, and some relaxation of the schedule 🙂 Nevertheless, it would have been great to have everyone on the board.

To the comfort of the driver, we had all gathered and asked him to begin the drive. This had put an end to his early morning boredom, which i suppose started much before 530 AM. The drive was smooth, first on a national highway, then a state highway, then just a road and in the end on some path. The almost 3 hour drive made me sing more songs than i have sang in the entire last one year! With some melody in our voices, some noise and a lot of screeching we did a splendid job of entertaining ourselves and even managed to screw up our larynx enough to make us shut up and sit after a couple of hours of “singing”.  The all time favorites were bidi jalileye, yaaron, dost dost na raha among several others. The gult song “ring ringa ring rigna ring ringa ring ringa reeee…” brought out the headbanger in all of us.

The drive was interrupted by an half hour pit stop at some place on the way. I have no recollection of the name of the place. Everyone took this opportunity to refresh themselves and the villagers.  As this was the last place where we could get some items to keep us nourished, people took what they thought would give them some energy: buns, puris, idlis, biscuits, chips, cold drinks, packed peanuts, DSP Black, Old Monk, Smirnoff, bananas, small, king…There was nothing much mentioning about the place except small shops, old men staring at you, carnivorous cows, autos(!!), and a fully stocked bar yet not enough variety of food to eat.

We reached a place where the trek would start. The bus would not go any further. The trek started by crossing a 10 meter wide stream of water of knee depth. This set a precedent for the rest of the trek. All of us, after wading through the stream, slipping on slippery stones, looking out for leeches and other creatures in water and having reached the other side safely, made a triumphant call, followed by a photo session as a mark of our triumph. This turned out to be just the start, and water perfectly harmless, and almost no leeches in this weather.

The trek was an easy one by trekking standards. It is just around 4km trek ( thats what I was told).  For the non-trekkers, like me, it was sufficiently tiring. Large portions of the trek was just a walk on slightly inclined ground.. I did notice how one and half hours had gone by since we started trekking. It went on smooth until the last half an hour. With uncertainty of direction, difficult terrain , growing heat, humidity and fatigue, things started to get a little challenging. The path grew narrower, less visible and obvious, and the nagging yet pleasant sound of the water falling, which made you think you were close to the falls, filled us all intermittently. We kept trekking , expecting that the fall was ahead us at the next turn, at every turn. But it was not. We were getting impatient, I started to doubt if we were on the right path. And then we saw water! We had reached! No, we didn’t. We continued on, and then came the shouts, the cries! Yes, we found it! We had reached! I, after slipping on some mud, after falling of some rock into water and some maneuvering finally got the view of it! It was beautiful. It looked much better than in the pictures! It was worth all the effort (though for a trekker, this would have been one of the easy treks).

What happened next I will cover in another post 🙂

National Instruments R & D

Hello guys, its been long since I last blogged. I have been wanting to get back to blogging from a long time, but was looking for some topic to resume, and now that I have one, I hope to continue blogging 🙂

In this blog I will talk about my interview process in National Instruments R & D. So, without wasting any more words, lets get started .

Something about the company: I really don’t know much about it, except that it produces softwares required which are used typically by electrical and electronic engineers for designing testing 🙂 I’ve always wanted to work in a products company, though of late i was getting more inclined towards systems programming, but no issues 🙂

Profile they offered :

Two  profiles were offered – one for software, one for hardware. Hardware was open for ECE and EEE, Software was open for CS, IT, ECE, EEE

They had three kinds of postings:

1)      Full time positions (the regular thing)

2)      Full time interns – I dont know much about it, except that it is for 6 months, at the end of which based on one’s performance, s/he is inducted into the company. This was for MCAs.

3)      Part time interns – This is for people who are in and around b’lore, who can visit the company 2-3 days a week

Coming to the more interesting, the interview process  🙂 :

I was sitting for the software profile, so I don’t know much about what happened to hardware people. There were basically 3 rounds, 1 written and 2 interviews. They asked about coding right from the first question in first round to the last question in the last round.

Round 1 : Written round, basically a C Apti

This round lasted for an hour, basically consisting of 2 parts. The first part contained code snippets and simple questions on it. There were around 12 questions and the answer had to be written(not MCQ). The second part involved wrting an algo/code or both for a prob statement.

Some simple problems were – find what does the following code does ( one was about printing nodes at kth level, one was about calculating sum of a number until single digit…), replace a given code with a more simpler code, finding number of graphs with n vertices, n few more simpler ones. The only question for which i didnt get a solution was

if((a == 5) || (a ==7))

{
//label

}

The compiler generates following assembly code

cmp eax, 5

jz label

cmp eax, 7

jz label

Optimise above code with single jz statement

The second part of Round 1 was to give an algo/code a problem statement. The jist of the statement is –

N soldiers of two armies are standing in two rows facing each other. Their individual strengths is given by two arrays G and F. You are commander of army F. If G’s soldier strength is greater than or even equal to F’s, G’s soldier wins or else F’s soldier wins. The soldier who looses dies, but strength of winning soldier is unaffected. Rearrange F’s soldiers such that the sum of strengths of alive soldiers in F is maximum.

Given two arrays int G[], int F[], int n = number of soldiers in both G and F

The indices represent the strength of a soldier

G[] = { given and order fixed}, ex: G[] = {2, 10, 7}

F[] = {given, order not fixes}, ex: F[] = {2, 9, 6}

sum = 0, all are dead

Rearrange F so that the sum of strengths of alive soldier is max. The above can be rearranged as

F[] = {2, 6, 9}, sum = 9

That was pretty much the first round. Around 80-90 people wrote the first round, and around 22 were selected. 3 from IT, 4 from CS, 1 from MCA and the rest from ECE.

Round 2: First round of interviews

After the written round, the shortlisted candidates were called for an interview. It was scheduled for half an hour for each person. My interview started almost on time. They took my resume, studied it for 10 mins and then I was called in. It was a one on one interview. The interviewer started with asking me to tell about myself. After clearing the purpose of the interview and what they are looking for in a candidate in that round, he proceeded on to ask questions. The questions themselves were easy. I was asked about 4 – 5 such questions in the entire round.

I always proceeded with first telling the interviewer what my strategy would be in solving the problem, and when he was satisfied, to write the code. The following questions I can recall were asked to me:

  • Given two arrays A[a1, a2…an] and B[b1, b2…bn], write a program(WOP) to find the fraction A/B in its simplest form
  • Given an string, find the largest palindrome in it
  • Given two trees, find out if one tree is subtree of the other(this was not required to be coded)
  • I don’t remember any more questions

This round was pretty much easy, the interviewer was friendly and would change the question if you were to get stuck at some point. The sad part was some people were eliminated in this round, based on such easy questions.

Around 14 ppl were selected from this round, 2 from IT, 3 from CS, 1 from MCA, rest from ECE.

Round 3: Second round of interviews + HR

This 1-on-1 interview round was scheduled for one hour. It started almost on time. My interview was slightly different from others. My interviewer spent around 10 mins asking me about things in my resume, regarding extra curricular activities, on my role in club, specifically the workshops, events I conducted, co-coordinated, attended, regarding my role in the cultural fest, on my internships. Then he started with the technical questions.

In the entire remaining duration we discussed only one question. He asked a question, which fortunately, came in my earlier round. He asked on how you will say, given pointers to two nodes, one is a sub tree of the other. He asked it on two approaches – comparing the value of the pointer, and comparing the values of nodes themselves.

The solution is rather straightforward, if comparing memories, traverse one tree and check each node’s address with the other node. If its comparing by value, it gets more complicated as all the children of the other node also needs to be compared to infer whether it’s a subtree or not.

I was asked to code both the approaches, and he checked it against various boundary conditions. I had made some implementation mistakes here and there which he founded out, and some I realized while explaining him the code. He was cool with it, as long as I corrected it.

After the tech questions, there were two HR questions –

1) Have you spent too much time on debugging something, and if yes, where was the fault, how did you correct it and how did you go about finding it?

2) As this was an R&D position, he asked me to give an example where I have shown motivation and initiative, when I didn’t really have to do it.

I didn’t have much trouble answering the above questions.

Finally, after around 30-45 mins of discussions within themselves, they published the results. Five people made it through: 1 from CS, 1 from IT and 2 from EC. They gave 1 full time internship to a MCA.

So that’s my entire experience. They haven yet given the joining dates. From my entire experience, two things that helped me the most –

1)      The ability to code, even when they say algo is enough, after giving algo, if u have time, code it. It gives you an advantage.

2)      Extra curricular activities. Depending on the profile of the company and the job position, change your resume to highlight few key areas, instead of putting all information, specially the langs/platforms/etc you know and the subjs which you studies.

These are my personal opinions, which I feel will help you.

All the best to everyone, who is looking for placements this year or in future. If you can code and have practice, you don’t really have to worry about anything else.

Microsoft internship…part II

This is sequel to the post

https://ashishjain.wordpress.com/2008/10/23/microsoft-internshipsome-vodka-please/

Round 1: Written round
The results to the written C Apti round were announced overnight. 27 people out of 101 got selected. Here are the questions of the C apti:

a)A recurssions problem, just needed some patience

b)given a function parser(char *) which parses the input string. Write all the possbile test cases for it.

c)You have been given a memory space to work with.You only know its base address and size. You cannot use more memory. Write a function for Void * Allocate(int ) and void Delete(Void *)

d)Given two linked lists, each conatining a digit of a very  long number. Subtract the two numbers and return a linked list which contains the difference, with each node containing one digit

The questions required some thinking and the implementations were not rigourously tested.Not very tough, but a challenging round

Round 2:Logic and implementation
The next round was a group process. 27 members were divided into groups of 4 each, each group having a mentor. All of them were made to be seated in a single room.The process was simple. One question would be given and everyone has to think about its implementation and discuss the answer with his/her mentor. When the mentor gives the go ahead, you have to implement it after which the mentor would check your code and give test conditions.

There were two such questions with half an hour each for each question. The questions were as follows:

a)Given input binary tree and a number, find the path from the root to leaves such that the path sum is equal to the given number

b)Given input a Char *.It contains alphanumeric + special symbols. Every special symbol has to be replced by”_(its ASCII)_”

for example, assume ASCII of $ is 32(I dont remember the exact values, its a pain to remember ASCII table), then

Input: A$BED

Output String:A_32_BED

The constraint here being only limited additional memory being available which is exactly equal to accomodate the new string and that extra memory is available only at the end of the given string. You cannot create a new string, you have to work on existing string.

This round was doable and challenging. It was fun, I thoroughly enjoyed it.12 out of 27 people got selected

Round 3: Personal Interviews
The next round was personal interview.It was a 1 on 1 interview. I was asked only 1 question and we were discussing the same question for 50 mins.This varied with person to person.I got enough indications I wouldn’t be able to get past this round as I was encountering more problems, one after the other, in the implementation I choose.The question was pretty straightfoward though:

Given two arrays as input. Array a contains integers. Array b contains the indices of array a which needs to be deleted.

I was trying to implement a solution with complexity o(n), and the logical complexity became very high and the interviewer was not very impressed with it.

8 out of 12 people were selected to the next round.This will be after end sems, which is a pain to those who got selected as they may have to stay back during holidays and have been asked to go through the basics.

This is pretty much the entire procedure.The interviewers were very friendly.A very good experience.The entire process was just too much fun 😀 I wanna write more just for the heck of it 😀

The day finally comes in my engineering career where i sit for comapnies. Well this is for internship. So microsoft is coming to take interns for summer which is more than six months away. Well some details of how the week has been. Just finished economics test yesterday, coming now after writing the OS lab end sem exam and have to submit DBS project report tomorrow. Among all these a test by MS. The preparations are great! 😉

In another few minutes i will be leaving for the test, thought the best last moments will be to write a blog. Well the first round is written C-apti. Some hope for me there. The interview will be tomorrow. But tomorrow is long way, there are 101 people competing for this internship and i have no clue how many is on offer.

My programming skills have lost touch and polish of late, weary of what i will do with interview. I can probably discuss Chandrayaan-1 and India’s secret nuclear submarine Advanced Technolgy Vechicle(ATV). I wish he lets me speak about Computer Graphics and i get a chance to work on DirectX.

All other strategies are dynamic! This is going to be more of a test in distracting him into subjects i know. Will update after my tests.

Cheers!

P.S. : Here is the sequel
https://ashishjain.wordpress.com/2008/10/26/microsoft-internshippart-ii/

Ever wanted to program your status message. Well this article below explains wonderfully how to go about doing it

http://ipowerinfinity.wordpress.com/2008/07/02/fun-with-gtalkpidgin-changing-your-status-messages-programatically

This link has an amazing discussion on the vasious apsects of different programming languages
http://t-a-w.blogspot.com/2007/02/right-to-criticize-programming.html

Ever wanted to compare different programmign languages and test which one is more effecient? Either in terms of speed of execution, size of the binary files created or the size occupied by the program in the memory?  Then the Computer Language Benchmarks Game is for you. This game lets you compare different programming languages. You ask how? The details can be found on their website:

http://shootout.alioth.debian.org/gp4

But for starters, it compares the implementation of defferent programming languages to solve a specific set of tasks. And how is the implementation tested?By profiling a code written for solving that particular task. The code used to have the comparison is open to all for review, so anyone can optimise it.

This provides a rough comparison estimate between languages of similar types(need not always be similar), like if a particular implementation is better in C or C++

So go and check it out yourself, here is an comparison between C and C++

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gcc&lang2=gp

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!