Monday, May 14, 2012

Know An Indian Coder : Rudradev Basak

When I (Anil Kishore) started taking part in algorithmic programming contests, for more than two years, it was just me, lot of problems, very few algorithms, my ideas and my Java codes. With that, I would have probably been still a green rated coder, working for a software company in Bangalore after moving between two or three places, still in search of the right things to do. But why ? Problems, Algorithms, my Ideas and my Codes.. what else I need ? This is where many Indian coders make mistake. Almost two years after joining TopCoder (TC), I started interacting with fellow coders, knowing more about them, reading lots of others codes, being active in forums and part of the wonderful community. That was the crucial part of my career so far. TC has some interviews of foreign coders and they are very interesting to read. Knowing more about our own Indian coders will be more fun, especially for beginners to get inspired. This is the least I can contribute to the wonderful community that has given a strong foundation to my career, introduced to me some amazing people around the world.

( This post is for coders, especially Indian coders. If you are not a TopCoder member or not interested in algorithm / programming / math contests, this may not be very interesting to you. )

This is the first interview post in this blog and no prizes for guessing correctly whom it is with ( because you read the title already ;) ). This interview is with Rudradev Basak, or should I say rudradevbasak , also known as Rudy. He is undoubtedly one of the best Indian coders of all time and is currently leading the Indian rank list in TopCoder, CodeForces, CodeChef. He is also part of the team Proof of IIT-Delhi along with Nikhil and Pradeep, that won ACM-ICPC Asia Amritapuri regionals 2011-12. They will be representing IIT-Delhi this year ( second time in a row ) at the ACM-ICPC World Finals 2012, Warsaw, Poland. So, lets find out more about Rudy, his way of competing and more.

Tell us about yourself and your schooling

I was born in Burnpur, near the city of Asansol in West Bengal. I attended St. Vincents School in Asansol, a highly disciplined school run by the Christian Brothers. For +2, I shifted to another school, named BRS (Burnpur Riverside School). There I qualified within top 30 of INMO(Indian National Maths Olympiad), and that was a pretty big thing for my school at the time. (I had qualified the RMO for the last two years, but could not manage to qualify INMO) The headmaster gave me leave to study for IIT-JEE, and not come to school at all :P. Anyway I attended the IMOTC(International Maths Olympiad Training Camp) for 2 consecutive years, and also was a part of the Indian IMO Team in 2008, and that was an extremely enlightening experience for me. It was at the camp, that I was given the nickname Rudy, which has stuck till this day. Also I managed to get into the CS Department at IIT Delhi, and met an entire bunch of awesome and brilliant people.

How did you get in to algorithms, problem solving and competitive programming ?

In IIT Delhi, the first couple of semesters had a basic intro to CS course, and a Data Structures Course. At that time I did discuss algorithmic problems with friends once in a while, but I did not go into competitive programming at all, even though I had heard about TopCoder. In my fourth semester (Jan-May 2010), I had the course CSL356 - Analysis and Design of Algorithms. And one day, I happened to see a fellow student, Jatin Batra, doing Topcoder in the institute lab. I went up to him, and saw that, contrary to my preconceptions about Topcoder problems, the problem he was solving was quite doable. That was the moment that got me into doing TC and into competitive programming in general. I had a good first match, catapulting me to Div1, and since then I have been pretty addicted to it. It helped that in the summer of 2010, I was at the institute doing a summer project, but still had plenty of free time. I also got into doing TC Marathons at that time, which I think has at least helped my implementation skills.

When did you start preparing for ACM-ICPC and how did you practice for it ?

Pradeep, Rudradev, Nikhil at the 2011 ACM-ICPC World Finals
My topcoder participation also galvanized my teammates, Nikhil Garg and Pradeep Mathias, to become more active in coding. And in the next semester (Aug-Dec 2010), we decided to try out for ICPC. We started practice slowly, barely meeting once in a couple of weeks at first, but later accelerated a lot. We learned an awful lot from each other, and in that November/December, I remember us practicing in a frenzy, especially in the 14 day gap between the end of Major exams and the Amritapuri Regionals. Each of us routinely crossed 12 hours a day in coding, both individual and team practice. That was a level of dedication and hard work we would never match again in the future.

The hard work paid off, as we came 2nd at the Amritapuri Regionals, and to this day, that remains my most satisfying moment in my contest career. Since then, we have done sporadic practice, sometimes going weeks without doing any, and sometimes gathering enough motivation to get into a pretty rigorous routine. I have still tried my best to do as many contests as possible, and maintain a medium level of practice, as far as my mood will allow. And I hope that this time, we will perform well in the ICPC World Finals, happening in Warsaw in 4 days time.

Many Indian coders admire you. Who are some coders whom you admire ?

There are a lot of coders I admire. I remember meeting Venkatesh Basker in Amritapuri Regionals 2010, and he gave us a lot of encouragement. Ajay Somani and Varun Jalan were also idols to me. Besides of course, I admire all the targets and almost-targets, those geniuses from around the world.

What is your strategy during TopCoder algorithm matches ?

Like most I open the 250 point problem first. For me, nowadays, aim is to solve 250 in < 10 mins, and faster if possible. So I try to read the question as fast as possible. While midway through reading the question, I try to guess what is the quantity that the problem is going to ask from me. And I get it right a considerable fraction of time. Parallelly ideas start forming to solve the problem. I generally try to avoid reading the example test cases before coding (unless the problem statement was really complex and I needed some clearing up). I find that they often misdirect my thoughts in weird directions. Type as fast as I can, and hit Compile. Number of times I hit Compile Error on 250 pointer before getting it to run is on average I think around 1 in recent months. If examples passed, then glance through the examples for the first time, glance through the code once, and Submit! If not passed, then I actually try to read the sample test cases properly, and go on about debugging the code. In any case, after I submit, I look at the division summary for the first time, (unless I haven't been able to solve the 250 in say 15 mins). In cases where I submit immediately on passing examples, I generally spend a couple of minutes more trying to check and recheck stuff. I think it has helped me to correct mistakes twice in recent past. Although Reading speed isn't that important, I still think people should try to improve in that area, in general, and not only for topcoder purposes. 

Solving the 250 gives me an adrenaline rush unlike anything else (except maybe the first couple of minutes in challenge phase, and the split-second wait after you submit a challenge). Once I decide to open the 500, things calm down a lot. I try not to look at the Division Summary too often. In fact, I have noticed that if I am not getting ideas in the 500, then checking the division summary seems to make it worse. So I have made it a point nowadays not to look at the Division Summary at all within 30 minutes after opening the 500.

You seem to have gained some points from challenges these days, what did you change ?

If in the last few minutes of the coding period, if I see that I have virtually no chance of completing another problem, I switch to test case generation mode. Up until a few matches ago, I was very poor at challenging (I had total career challenge points negative !). In recent matches I've been able to sneak in a few challenges here and there. Often I fixate on a few plausible bugs that others might have left in their code, and only focus on those issues in the first 5 minutes of challenge phase. Later I switch to random solution mode. Finding a bug, creating a test case, clicking challenge, and waiting for that split second before the verdict is, as anyone who has experienced it will agree, a breathtaking experience. 

What is the role of elegance and simplicity of code in short contests ?

Even though in the short run, writing code fast, and writing elegant/simple code, may seem to be conflicting, I believe that in the long run, maintaining simplicity of code and elegance of solutions is very much in line with writing fast and correct code. Of course it may not seem easy at first, but practicing and making it a habit of writing code elegantly will definitely help. 

Do you listen to music while competing ?

I tried solving SRMs while listening to music a couple of times, but it didn't turn out very good for me. However I do like to listen to some calming music in the 10 minutes right before the match starts. I have found that this calming helps me to maintain a more vigorous attitude during solving the 250 later on.

 What are some current milestones you want to reach in coding contests ?

Getting to the onsite finals of Topcoder Open and Google Code Jam are some milestones I would really love to reach.

Finally, what advice do you give to different levels of coders ?

First, before I advise people to practice harder, I want to say, "Practice ONLY if you actually enjoy it/want to do it. There is no point in practicing just for the sake of some vague goal in the future which you may or may not attain." Now, the only advice I can give to people, is to practice!. On topcoder, grays and greens need to learn implementation skills, and to convert their thought process into code efficiently, and NOT learn up algorithms. Once one progresses to higher green, or blue, then you need to actually start learning algorithms. For higher rated people, identifying your weak points, improving your accuracy, and MORE practice should help :)  Also, for all people, reading code of other higher rated coders will always be helpful.


Lets thank Rudy for taking his time in replying to my questions and wish him all the best for his career. Hope to see him as a TC target soon and wish his team good luck in World Finals this week, and beat the previous best Indian rank : 29. Lets also wish other Indian teams in ACM-ICPC World Finals in Poland this week, all the very best, especially the team TuringMachine ( Anish, Kunal and Nadeem ) of IIIT-Hyderabad ;). Make us proud guys !


So how did you like this post ? Have more questions ( non-technical ) to Rudy or any one ? Want more such posts from others ? anything... drop a comment below to let me know.

~ AK


  1. Lets consider a beginner who just started programming and he just know's 'c'. What is ur advice to him? How to start and improve himself? Like a roadmap(beginner to expert)!!! This question is not just mine!! From many beginners.

  2. There is no such specific path to take. Think of the basic things, 1. Study standard algorithms 2. Practice by solving lot of problems. Its just that. I would strongly suggest to follow TopCoder and be active in the community, not just in the contest arena. If you are familiar with TopCoder, here is the road map : grey -> green -> blue -> yellow -> red :)

  3. Is there a specific/helpful list of topics written somewhere we all need to know before entering TC? I am talking about techniques like solving recurrences in logarithmic time, etc...we cannot find such things in text books.

  4. Nice post...really helpful. Thanks Anil!

  5. Cool post, waiting for more, especially yours!.

    Generally, people would quit coding if they stay grey for more than 5-6 SRMS, But this page/graph (link below) has always inspired me and it still does!. Your story will be a great inspiration for all, please do post it soon.


    1. People have to have a character even if they are gray, we can learn even from the profile of the man himself, Anil Kishore - he didn't give up even when he was gray for good number of SRM's :) :)

    2. @ankitsablok, Thats precisely what i wrote :)
      Here are a few more inspiring people

  6. Good post and a great guy. Met Rudradev at some mall in Bangalore (KFC of Forum Mall, I think) some 1 year back while he was pursuing his internship at Microsoft. Found him humble as ever for his acomplishments and I remember being inspired. Keep going, Rudradev.. way to go!!

    1. It was McDonalds btw, not KFC :)

  7. Thanks Saket, I can't imagine someone getting inspired by that graph :p
    @ all : Seems another common misconception many of us have is, "TopCoder is for contests and so we need to know something before entering". But that is not true. TC is a place to learn from scratch and do contests just for fun initially and not worry about ratings at all. If your graph is really bad and then improves slowly, it will be very appealing :). You can't ask ques like "What to learn", "Where to learn", "How was your journey.." etc., this is something you have to experience yourself, waste a lot of time, realize 100s of small things, approach in own style ! I'll make a post about my small story soon. Good to know that many of you liked this :). If you have specific ques, do not post as Anonymous, so we can point at you in replies.

  8. Brilliant post!! Keep it up. :)

  9. Nice post Anil Anna and thanks to Rudy for sharing his experience. But I would be really willing to know Anil's story.

  10. Nice inspiring post .
    you said "for more than two years, it was just me, lot of problems, very few algorithms, my ideas and my Java codes. With that, I would have probably been still a green rated coder, working for a software company in Bangalore after moving between two or three places, still in search of the right things to do. But why ? Problems, Algorithms, my Ideas and my Codes.. what else I need ? This is where many Indian coders make mistake. "

    this exactly seems my story .Its been 2 and half years , i know some algorithms,some tips but i keep oscillating b/w grey and green circle at topcoder , same is story at codechef.

    "Almost two years after joining TopCoder (TC), I started interacting with fellow coders, knowing more about them, reading lots of others codes, being active in forums and part of the wonderful community. That was the crucial part of my career so far"
    Currently i am only active a arena , can you please elaborate how one can try to be more active.I know it is sounding silly and you already have answered in above paragraph but elaborating it will help me.

    Thanks !!

    PS : sorry for posting same post again but not as anonymous this time.

  11. Kind of expected this to be the first post :)

  12. Great Post!!! looking for more :-)

  13. nice post....
    I would like to read about your experiences (from your early days till now) too :)

  14. Awesome post !!!
    As the SRM finishes, run into Rudy's room, gather as much knowledge as you can ... Last four months have been great fun, learning a lot from him!!! ... He has actually taught coders in our wing ... more than how to do a question, he taught how to start thinking about the question.

    Keep writing, would love to read such posts.

  15. Really a very nice post. I would like to know that what benefits usually more to a beginner(from the scratch),practicing on topcoder or other programming sites like codechef,spoj.

    1. Main Benefits : The joy of solving a problem is ultimate and engaging in it for a long time makes you feel happy; increase sharpness of mind; improve programming / debugging skills; meet awesome ppl; Win t-shirts;

      Other minor things : can win some prize money rarely; helps in building confidence during job interviews these days;

      But the skills developed by doing all this are not directly needed for solving real world problems.. working as a Software Engineer. Join Quora and follow some questions related to this for more info.

    2. Thanks for the reply. Actually I was asking that which is the better site(from topcoder or other sites like codechef) to start for a beginner.

    3. These days I see some high rated coders ( best eg. Egor ) participating in almost all major contests ( topcoder, codeforces, codechef ), so a beginner should at least do that too. Contests are very rare ( at most 1 per week in each site ), so its not much time. I would suggest you to participate in as many live contests, and parallelly read a topic and solve problems specific to that. If you can't solve a problem for sometime, its ok to look at the solution. There are 1000s of problems to try out. Good luck !

  16. Really gr8 post and the discussion underneath it was also a nice read. We really need such healthy discussions.
    Loved it!!!

  17. Very Inspiring Post..... Best of Luck Team: Proof for ICPC 2012 Final

  18. Very inspiring.. I have became a fan of you.. hope to become a coder like you...

  19. rudro da Burnpur Riverside School is proud of u.
    Best of luck for your prosporous future.

  20. a great post keep writing!!!!!!!!!

  21. first of all i must confess thats a very good blog. really helpful.
    Now, I want to ask you (or any expert out there), what about someone who is not exactly a beginner, but just after that beginning stage. I am able to solve a very few and limited number of problems (usually the ones in the easy section of codechef) and could not even clear INOI for the training camp(cleared the first round only). I am really interested in algorithmic programming and I really want t o improve upon it. I will practice(so you don't need to particularly point it out), but is there any specific book(s) which I could/should follow? Anything else of any help?

    1. It depends on personal ability. I hardly remember reading more than 1 - 2 pages of a few books I came across. My learning is more from solving problems and seeing other's codes and basic algorithm tutorials in topcoder site. I heard many times ppl recommending this book "Introduction to Algorithms" by Cormen ( also called CLRS, initials of authors ). You may start with that and keep solving problems on the topic you read there. Being active in forums will help a lot and also will help you in knowing good books :)

    2. Hello anil, i just want to know if there are any particular sites with database of top programmers solutions with code.

    3. Most of the sites (TopCoder, CodeForces, CodeChef etc.) have codes of all contestants public after the contest.

  22. Awesome post anna :-) Waiting for the next one...

  23. To Rudy,

    I guess nobody knows that Mr. Rudradev Basak or Rudy or Rud was a very good singer as well (don't know about present situation) .We both have performed for our school at many places. So he has a very good knowledge of music.I feel proud to say that he was my classmate...Best of Luck...

    Sagnik Das

  24. The most valid point one could infer from this post is that, code only out of interest and not with any vague or opaque goals. On a whole, loved it. :)

  25. How much time is needed to become a CODER like you ?

    1. Ask about, how much effort is needed to become a better coder.
      Depends on your interest. May be expect to spend at least a good 1 year of active contests on (topcoder, codeforces, codechef, ... ) + reading tutorials/forums. You will know the answer after that ;)