Wednesday, April 30, 2008

The Data structures exam

hey all,

as always after an enthu start, i stopped blogging. so here i am, back again tryin to keep it going. :-)
got a bit busy in my exams n stuff. nways, so tday was the Data structures practical exam..
We had 3 options and had to choose one of them and write the code for it accordingly. the 3 options were:
1.Binary Search tree: inorder traversal(non recursive), display, node delete, search and height of node.
2.djikstra's thm: find shortest path in given network.
3.store a polynomial using linked list and do: add, multiply, evaluation

the 3rd was obviously the easiest. and so i started off with it.. 1.5 hrs into the pracs(I had 3hrs in all, to complete the program), everything except for evaluation was done and working(including the menus in main() ).. absolutely well, i may add. so a happy nikhil started off with the last part. a simple 4-5 line evaluation code.

having done that, i just touched up a few lil things here and there and ran the program. and viola!! 9 errors show up on screen. and stupid ones. like '(' expected. 'poly' cannot start a parameter declaration. functions like multiply and add which were working till then suddenly started acting up. nothing would work.

Having had lotsa such experiences, i started off stripping the code down to its bones. put the node class as global instead of nested. deleted a few functions. etc.
NOTHING!! nothing would work

Finally, i put a character string as the only data in the poly class and tried printing it to screen. NOTHING!! it just would not work. finally a brainwave.

i changed the name of the poly class to 'ply' and VIOLA!! the program works!! just simply too good..
then started the task of putting all the code back into the class and undoing the changes i had in stripping it down..

finally with about 3 minutes to end of time(no jokes here!!) my code started working. but still i kept getting garbage data in between. then the 2nd brainwave. i had forgotten to rename the constructor.. did that. and with 1 min to end o time. the program worked..

HUSH!! such a relief it was.. it was like.. wow.. it worked finally.. i did it..

after thoughts: Later i came to know the fact that 'poly' is already defined in the math.h header file that i included for evaluating the polynomial. so a VERY IMPORTANT lesson learnt..

thats all for tday. after that, had a good time n chilled out at CCD discussing some techie n non-techie stuff.. so that was good.. :-)

adios..

Saturday, March 29, 2008

The Microsoft Internship Interview

Hey all,

Well today had my interview for an internship at microsoft. Was REALLY REALLY looking forward to it. Had been a long wait(from 27th JAN, 08..You do the math)..

We were basically around 70 odd ppl. This was at the Mumbai centre, Terna Engineering College, Nerul(or Neral-whatever!!).. We were made to sit on benches sufficiently apart..bout 19 to 20 ppl in one class i think..Nways, then the microsofties come in(all this while we were dealing with the Merittrac ppl).. And they write a statement on the board.. WE had to write some algo for that.. thats it.. If u wanted, you could implement it in any language you wanted. But that was purely optional..soo.. What we were expected to do is, after you write the algo, we had to call one of the microsofties over and tell them why we had made our algo so..and yes, they did cross question us and stuff.. infact one o dem actually made me do an LR transform for an AVL tree..
:-)

Initially, they had told us that the programs are gonna be really really easy, that all of us have already done at some point o time in the curriculum.. but they just wanted to see what all we can think of and our thought process..

And yes, one programme was REALLY easy(not easy as such, but I'm sure that almost all of you must have done it at some point, if you've learnt any programming language formally), but the other one, I had never heard of, and never realised what exactly they wanted. And the explaination they provided was not totally correct, as i later realised.

Anyways, moral o d story is that I did not make the cut.. I think they cut down the 70 no to about 15(not sure bout dis tho).

For all the ppl out dere who are reading this for some pointers, what i would say it that, dont listen to what they say.. DO not get carried away. stay focussed and study Data structures and algorithms REALLY well..ALSO, DO not get stuck into the implementation part. the ALGO is supposed to take centre stage. That should carry you through.. And yes take it easy out there. The moment I walked out of the classroom, I had come up with a very very efficient algo for one o d probs, but then it was of no use.. so keep your cool..

So overall a sad day for me. :-(

but it was a learning experience all the same.and i'm sure i'll do better next time in 3rd yr. :-)

Hope to start posting more regularly here..

Adios,
Nikhil