MathJax

Monday, 20 November 2023

On Growing Up

All names, characters and incidents portrayed below are entirely real. If you identify with anyone, it was probably you :)

Chennai, 2006

I'm back in the past. It's a scorching Tuesday morning, and I'm riding the bus to school once again. There's a glint in my eye. I'm not getting picked on today - the school bully is absent, which in itself makes it a particularly good day. But that's not why I'm excited. The savory aroma from the canteen wafts its way to my nose. In my pocket, I have the goods: pocket money worth 5 rupees, for my bimonthly wheel chips splurge. But today, I restrain myself. I have a brilliant idea. I don't feel particularly hungry. What if I got my friends to pool their pocket money on the days they were full, so that they could get money when they were craving food? We'd allow people to take money from the collection and pay us back later, too. 

Yes, I re-invented the concept of a bank. Except I didn't account for the fact that there were no interest rates. And no credit scores. And the teacher looked at me taking money from all of you and shot me a glare. And all of you did what I now know as a bank-run.  And now I know there was too much counterparty risk. But 7-year old me was confused - why couldn't we all live in a world where everyone had the best of intentions?

Fast-forward to a week later. I was over the moon. I'd gotten the Charizard tazoo from the Cheetos packet I'd been consuming for this express purpose. I went to my best friends who lived across the road to gloat about my bounty. I left my tazoo box alone in their room and came back to it, and realized it wasn't there anymore. I broke down and couldn't understand where it went. I went so far as to accuse them, but believed them when they said they hadn't taken it, though I could see the sudden addition of a Charizard in their collection. I began to think maybe humans were too hard to understand after all.

Left: the fever dream of every 2nd grader in Chinmaya Vidyalaya
Right: the fever dream of every primary schooler in the world

Fast forward to the end of third grade. My favorite teacher was leaving, and I wanted to do something for her. Something BIG. But I was budget-constrained, being a walking expense on two legs already... I decided to again contact my friends from the bank-creating scheme and pool money together to get her a huge cake. Why not the whole class? Well, because we would only eat the cake amongst ourselves, of course. That was obvious, wasn't it? You can just-about guess how that went. The teacher was extremely touched, and being the kind person she was, she shared the cake with the whole class, making sure each kid got their fill. Meanwhile, the small gang of cake-investors who paid for the cake (rightly) blamed me (the cake-manager) for this turn of events. All I could do was sit aside and not have any cake, while I tried to figure out how I ended up in this mess. I was absolutely befuddled. Socialism didn't work. I was now trying to be Capitalist, purely pooling money for individual benefit. Was my teacher secretly a Communist?

Books were always far easier to understand. I loved my weekly visit to the library so much, they would often have to charge me extra because I would borrow over the allowed rate (5 books/week). The world of Tintin, the Hardy Boys, Asterix, Charlie and the Chocolate Factory, Tom Sawyer - I could visit fantasy worlds without leaving the confines of my house! Moreover, the kids in the other classroom were talking about the new book series - something about a hairy potter? I thought that sounded like an interesting title. By 4th grade, I was hooked to the series. But study books? Those words filled me with dread. I would avoid them like the plague. Because of my constant begging, pleading and imploring, my mom finally said "enough already" and got me a second library subscription. Boy oh boy, was that a GREAT day! My mom got extra-cute drawings in her Happy Mother's day card that year. 

Mumbai, 2010

I was a big boy in 2010 - a full 10 years old! My parents decided it was probably best for us to move to Mumbai - primarily for me, hoping I would pay more attention to the world around. Moving was a big deal back then - my entire world was torn apart! Everything was so different. People walked fast. Trash on the streets. Our apartment was a tiny one-bedroom, and everything felt so cramped. Mom said she wouldn't teach me anymore - what a disaster! Did that mean I'd have to learn the material myself? Whelp, better get to it.

School was alright - there was so much more tech, and so many people with different interests and ideas! I just couldn't understand how people thought. I liked stories, and I decided that history was basically stories, so I finished the entire history textbook in a couple sittings. I loved how the teacher would embellish the content in our books with her own knowledge. When she would ask questions to the class, I would answer immediately and out of turn because I was impatient for her to tell us more. I could not comprehend how the others felt when they said they didn't enjoy the class as I did. How could it NOT be fun?

For no apparent reason, moving was the start of an entrepreneurial streak. I'd sold Pokemon fanfic comics I'd written in exchange for snacks, an idea I got after reading the Captain Underpants series (I was just like George and Harold!); but now I took it to the next level, with video games. I'd always been extremely into video games (including fooling my parents and staying up 6 hours every night with them wondering why I was so sleepy every morning, learning to use the internet, and being involved in online communities). I tried creating my own game, and even roped in a couple of friends!

On a lazy monsoon day, me and mom decided to create our own chocolates, with the idea being that I would sell them. I remember selling out the first day and getting a lot of return orders the next week. Another summer, I woke up and thought there was good money in burglar alarms for some reason, so I made some very shoddy ones. Relatives who felt proud bought them at highly inflated prices. It probably wasn't even worth the material that went in. Those were fun times.

Middle school didn't make me any more attuned to human emotion - in fact, it was probably the other way. I was with my best friend from 7th grade recently and opened my middle school email to scrooge for blog content. He was laughing off his rocker saying "oh yeah, this is so you" while I physically cringed. Well, you live and you learn...

There was a turning point in my life around 10th grade: two major life events completely changed my perspective on people. First, I was told I would not be going on a trip I was selected for previously, the major reason being not getting along with others; and second, I started making a lot of friends, both in-person and online, who liked and were much better than me at math. I couldn't say I finally learnt empathy, but I'd taken the first step - reaching out an olive branch. I finally begun to understand that interacting with people could potentially help me learn and grow; and helping others was a refreshing change of pace. 

New York, 2023

Let's jump back to the present. A close friend recently said "You are one of the most social people I've met!" and this made me bellow heartily. Life has a weird way of putting you in the most ironic situations; I was unable to convince him that a lot of my extrovert persona was unnatural, learned behavior. 

Last week, I met him again and told him I was going to write a blog called "A love letter to my friends". This is that blog. It's dedicated to the wonderful humans who changed my life. 

Not that long ago, I had a disagreement with someone who was very close to me. She thought people couldn't change. And I hope I managed to change her mind, if only a little. Because all of you taught me how to change; how to become the best version of myself. And that's what growing up is all about! I met a lot of you from middle school recently - and it made me happy to see what amazing things you're up to. Thank you for opening up to me about your experience - thinking about events from your lens reinforced to me the diversity of homo sapiens. 

Maybe we've been childhood pals. Maybe you're the kind stranger on the train in Switzerland who taught me to live life in the moment. Maybe you're the classmate who saw my bruise and immediately offered a bandage. Maybe you're the student who told me I was doing a great job despite my stuttering. Maybe you're the mentor who was straight with me and told me I needed to really understand my project inside-out. Maybe you're the friend who sent me an anonymous gift on my birthday saying we'd be friends forever. Maybe you're the senior who steeled me to take the plunge and to not give in to what everyone else thought was the right decision. When I was devastated, maybe you invited me home and let me stay the night. When I was in doubt, maybe I called you and you got my thoughts in order. Maybe you flew over for my sake. I'd do the same for you in a heartbeat. Sometimes I wonder if you still listen to rock music when you work. Do you still play the drums like a man possessed? I hope you've been getting enough sleep. How long is your Duolingo streak now? I hope you've been taking care of your arms after your surgery. I often think about that beanie you knit. I sometimes walk around the house wearing the panda hat you gifted me. Thank you.

You're someone I admire. The way you make people at ease with your words. The way you rouse up a crowd, and get people motivated. You work your magic with a guitar, and you leave me captivated. You work from the shadows, making people laugh with your creations. Your paintings evoke strong emotions. You always fight for the causes you believe in. You're building something you love. Of course I want to see the finished product - I was already enraptured listening to you talk about it! You walk with poise and purpose, your head always held high. I want to see you open that restaurant you dreamed of. When you direct your first movie, I'd be in the audience, clapping my heart out. 

You've taught me a lot of things. You've shown me what I can be. And of course, you've said things I've taken to heart and worked on. I've always been hard on myself, and I'm working on a lot of things. I'm trying to become a more complete person everyday. But it's important to realize the effect you've already had on me.

You were at my apartment at 4am, and told that I needed to lose weight for health. I really, really tried. And it worked. I've lost about a pound a week for the last two years. There's so much left to go, but you helped me turned my life around.

You comforted me and told me I was good enough back when I was kicked from my ICPC team. I practiced at nights, from 1am to 6am multiple times a week. You were there with me. And it worked.  

You taught me that life was more than academics. I spent a quarter with no academic classes whatsoever. And it worked. I re-ignited my love for teaching, and I gained valuable perspective in various other aspects of life - music, dance, comedy and games.

Recently, I started running polls on my Instagram. From thinking of decisions as a high-dimensional action space and realizing I needed to explore more of it came a desire to start including epsilon randomness and coin flips. And then I had an epiphany - I had a great set of priors from people I trust already! But that - and my other experiments - are a blog for another day.

I've come a long way since being a kid. And there's a much longer journey ahead. We have some lofty goals ahead of us for next year; and it's only going to get more exciting from here on. I can't wait to tackle them head on with all of you by my side.

Thank you for being the best human beings and friends someone could possibly know. Thank you for spending a moment of your time, however fleeting, to be free with me. You're the reason I get up everyday, ready to change the world - and more importantly, myself. I hope you're always healthy, happy, and full of energy and vigor. I hope we'll cross paths again - and when we do, I'll be able to look you in the eye and say "It's like you never left".

Maybe what I want to say - really, all I want to say, is - I love you.

Monday, 26 December 2022

ICPC World Finals Dhaka 2022

My experience with ICPC has been a wild ride! In this blog, I'll talk mainly about my experience at the World Finals in Dhaka, Bangladesh held in November 2022. This blog is divided into the following sections: 

  1. Background (My story so far)
  2. Travel & Experience at Dhaka World Finals
  3. The actual contest 
  4. Aftermath (Closing ceremony, thoughts, travel back) 

Background

It's time to finally put my thoughts into words, and take a trip down memory lane...

When I joined college in my first year, everyone was talking about "Computer Science" and how it is the best major to go for. I didn't understand what the hype was about at the time, but it turned out that the courses left me craving for more. At the end of my first year, I learnt about a competition touted the "Olympics of Programming"; called the ICPC. When I read about it, I knew: I had to get there, at the biggest stage, and participate in this competition. My goal was to get to World Finals one day!

The way qualifications work in India is as follows: you participate in up to 2 regionals, and the top x teams from each regional qualify to World Finals (different regionals may have different quotas). Recently, there has been some innovation with the introduction of Asia West championships, where only the winners of regionals qualify and other top teams meet at a single contest to determine the other qualified teams. 

I really took this to heart... (Context: click here)

Cue many years of practice: blood, sweat and tears put together, my team finally qualified to represent my college (IIT Bombay) at the ICPC World Finals 2020 in Moscow by winning Amritapuri ICPC Regionals in December 2019! I even wrote a few blogs about it...

Unfortunately, in 2020, COVID-19 hit and affected most of the world. This severely impacted our motivation to grind and do well at World Finals, since it was indefinitely delayed. We got back to doing other things in life... but I never forgot about it. I had streaks (with 6-12 month long breaks in between) in which I competed, until at some point I hit one of my other goals in life - finally reaching Grandmaster on Codeforces, meaning I was about top 500 in the world, and top 10 in India amongst every contestant individually..

My profile at the time I hit GM for the first time
My profile when I hit GM for the first time! I finally got to remove the "Too Weak to GM" tag from my name.

While waiting for World Finals 2020 to occur which was delayed indefinitely due to COVID, I started considering trying to qualify for another World Finals. Both my teammates for the Moscow World Finals did not want to do CP anymore, so I found two new teammates and participated in regionals. After a last minute AC on a nasty geometry problem, we qualified for World Finals 2021 by winning the Pune-Gwalior Regionals by a problem (scoreboard link here).

Eventually, it was announced that ICPC World Finals 2020 would be held in Moscow, as planned... in November, 2021. Forget practice - there were far more pressing questions to answer! All of our lives - mine, Shriram, and Tushar's - had changed significantly since we last planned to go. I had accepted a Masters in CS offer from Stanford, and moved to the US in September 2021. Tushar moved to South Korea to work for Samsung. Thus, logistical issues took priority.

It turned out that neither Shriram nor Tushar could participate, and it was hard to acquire funding from our university for me to go with 2 replacements I found (though our coach, who was a professor I was working with on a research project, did try his utmost and has been consistently great about helping out with everything - thank you, Rohit!). 

With these issues, I managed to get 2 replacements, Bhaskar and Shivam, who were also my teammates for the Dhaka (ICPC 2021) World Finals. Further, for funding my own travel to Moscow, I ended up testing, problemsetting and becoming contest admin for a few Codechef rounds

Meanwhile, in my personal life, I had already started my Masters degree in Computer Science at Stanford in September 2021. This meant I had some additional logistics to figure out (getting Russian visas in the US as an Indian citizen..) and travel was made somewhat more difficult. Eventually, I managed to get on a flight and travel to Moscow. 

Moscow was a one-of-a-kind scary experience in my life in many ways; as soon as I landed at 2am, I got notified that both of my teammates had gotten COVID and were taken to some other ward. After reaching my hotel at 3:30am and getting the full story, it turned out that Shivam had gotten a positive COVID test and was taken away, while Bhaskar was asked to isolate in the room both of them were sharing.

After many scuffed days, Bhaskar was allowed to participate on the day of the contest, and we achieved the best rank IIT Bombay has gotten to date: 33rd tied (our rank with tiebreaks was 37th), solving 6 problems; and we did it in a team of 2! It was a really good feeling, and left us motivated for Dhaka WF. Meanwhile, I also met some of my CP idols, which was amazing!


        Left: Me and Bhaskar w/ Mike, creator of Codeforces
        Middle: Me with tourist (Gennady Korotkevich), best competitive programmer in history
        Right: Me with Um_nik (Alex Danilyuk), one of the best competitive programmers, winner of                  World Finals 2022, and at the time my co-coordinator at Codechef

Another cool aspect of World Finals is meeting all your programming friends from over the world! We had an AC discord meetup, but I'll skip posting those pics as I have better ones now...

Historically, one can only participate in World Finals up to 2 times, to allow for more diversity in participants. However, after Moscow World Finals, we got the news that Moscow would not count as a World Finals participation for the purpose of the criteria, since it was held in a COVID year (and thus some teams could not participate). This meant that I could qualify yet again...

A fellow incoming Stanford student Lucas Xia reached out to me on discord, asking me if I would want to form a team with him to contend from Stanford for another World Finals. I decided that I was in, and we completed our team with Konstantin Miagkov, a PhD student in Math. We ended up doing pretty well in the North American circuit, qualifying to NAC in May 2022, and coming 11th there. This result allowed us to qualify for the World Finals to be held in Sharm El-Sheikh, Egypt 2023. Maxwell wrote a cool blog on the NAC experience here and Alex made a nice video on NAC here.

Card games were a big theme of NAC 22
                           

The Stanford team, in order front to back: Lucas, Konstantin, Me

In-contest pic

Since we qualified to World Finals through NAC, this confirmed my qualification to 3 World Finals with 3 completely different sets of teammates: Shriram & Tushar for Moscow World Finals, Bhaskar & Shivam for Dhaka World Finals, and Lucas & Konstantin for Egypt World Finals. A truly unique and weird achievement...

Travel & Experience at Dhaka World Finals

After NAC, I took a break from Competitive Programming until October, when me, Lucas, Konstantin, and Andy (our Stanford coach and a PhD student here) decided to run a larger iteration of the Stanford ICPC club. Teaching at club meetings reignited some of my passion again, but there was a slight problem: the ICPC rules state that every team gets a single computer. Me, Bhaskar and Shivam had not met each other for over a year in-person, and we had never done a one-computer contest together! Indeed, due to COVID, ICPC had allowed 3 computers for the previous season; therefore, even at the start, we knew that this world finals was going to be a gamble. We were not used to debugging on-paper, reading each other's code, and maximizing computer time as a team. There was no ideal way for us to practice this (and not too much motivation), so we decided to just wing it. Getting funding was something we had given up on based on our experience last year, and thankfully by this point all of us had enough saved for the trip due to having jobs.

Finally, it was time to leave for Dhaka! I travelled with Lucas (who had qualified from UCLA, his undergraduate institution) and we had flights through Dubai. Since our seats were far away, we tried to use the in-flight calling feature on Emirates; but sadly, it didn't work very well 😖. At Dubai, we met the UCLA coach Professor David Smallberg, who got us into a nice lounge at the airport. We got some rest and free food; what more could we ask for? 😋
                        
Before the harrowing 24 hour journey

Chilling @ lounge in Dubai

After a long journey, we finally made it to Dhaka... only to be greeted with a 2-hour long line for immigration. After finally getting through, we were given a grand welcome - some ICPC official took us through a different entrance and separate security, where we were barely checked and immediately made it outside. We then waited for the bus with what seemed like 20-30 volunteers; almost as many as people arriving on flights (maybe I exaggerate a bit, but...). Some of the volunteers tried to take selfies with the (foreign-looking) participants; South Asians reading this blog will understand the tendency of locals here to treat foreigners as celebrities. Unsurprisingly, no volunteer wanted to take a photo with me, since they thought of me as a local; clearly, my American façade needs a lot more work.

Everyone then split into different buses to go to their respective hotels, which was an unfortunate part of this World Finals in my opinion. The hotels were assigned based on the region, and so I was separated from all my US/NAC friends, and sent to a hotel with the other South Asian teams (which was the farthest from the venue, and most inconvenient by far). On the way there, I noticed that a lot of banners for ICPC were present throughout the city... I really felt like a celebrity! On arriving at the hotel, we took a COVID test, and were handed a SIM card and some other helpful items. I then realized changing to the latest iPhone right before WF wasn't the best idea: I didn't have a physical SIM card slot, and thus I had no way to contact anyone...

After settling into my hotel room, meeting my teammates after forever and getting dinner, I did what any reasonable person would do: host a poker game and invite all the teams for a meet-and-greet! It was tremendous fun; I was seeing some of these people in person after 3+ years, and meeting online friends for the first time.

Poker night in our team's room

Since we were playing no-cash, people kept requesting more money; I allowed it as long as they waited a game out and requested powers of 2, until we reached a ridiculous end...

After a fun game that lasted a few hours, we ended things before midnight and got up fresh in the morning, ready for team registration! I pleaded to my teammates to please not get COVID this year, so that we could actually have a 3-person team compete.

Opening ceremony-ready! Left to right: Shivam, me, Bhaskar

Heading to the registration, I was excited and nervous to meet the rest of the AC/kbr (discord servers) gang! We decided to meet around lunch; unfortunately, seating for groups wasn't great, so we just got some chairs and a couple of sofas together, and finally caught up with each other. As usual, everyone is way shier in-person compared to online...
                    
A high quality chess game between richzli and Monogon

Playing carrom after a long time! Bhaskar lost, though he will strongly deny it on enquiry

kbr meetup!! We got cute plushies too😋

AC meetup! Pajenegod (holding the Blåhaj) proceeded to steal Kuroni's plushie by submitting it as KTH's mascot, which was a hilarous misunderstanding

We played a quick couple games of Secret Hitler on a makeshift table (ie, a chair, since there existed no tables), but I was distracted the whole time - my registration time was coming up soon, and my teammates were waiting for me (sorry, KTH folks, for throwing your guesses off by irrational play)! After finishing the game, I ran down and met my teammates - who, as it turns out, were engaged in a competitive game of table tennis. I stepped in for Bhaskar to cover for his abysmal play, but rushed the game anyway to not be late.

As it turns out, we made it to registration well before time! While checking in our documents, I realized I brought my proof of enrolment for Stanford.. but I was participating from IIT Bombay 🤡. Yes, the ICPC years being shifted so much had even participants confused whom they were representing...

After quickly fixing these issues, we went through the other registration desks, where one of the ladies said "hey, you're that guy who participated alone last year!". I guess I was memorable; I have to say, the memories were definitely meme-worthy! She was glad I had a team this year, and hopefully she'll remember me next year as well. We did the team picture, and were confused about what to do for the team video; we ended up doing three different things, with me doing a thinker like last year, Shivam doing the "cool guy hairflip", and Bhaskar being generally confused about the camera being turned on.

My meme team photo at Moscow World Finals

Finally, a 3-person team! Though it's complete chaos this year...

After team registration, we realized there was a large break until the cultural program. With all of us being out of practice, we decided to take a cab back to our hotel and get up to speed on stuff we didn't remember. Though we were rusty, we still considered ourselves as relatively decent contenders; both me and Bhaskar had been Grandmaster before on Codeforces, and Shivam was Master (though he didn't participate at all, so I guessed he was likely stronger). We got in some good practice, and got a good night's sleep for the ICPC Challenge and Opening Ceremony the next day.

The next morning, we entered the ICPC Challenge (a heurestic contest, with prizes for top 12 ICPC teams) with no game plan in mind. I was the only one on our team who had done heuristic contests before, and I hadn't done particularly well on them, with a 56th rank in Hashcode 2021 being my best achievement. We decided that I would code at the start, and then we would see how it went.

Getting ready for the ICPC Challenge

Post ICPC Challenge meet-up!

It took me 30 minutes to get the code up and running for the basic greedy solution, and surprisingly it actually passed the samples (I'm not known for writing the most bug-free code...). On submitting, we got an alright but not-too-high score. Since my teammates had no experience reading my code, we decided that my code was impossible to read and I would be the only one who would code for the entire contest. After many ideas from my teammates, fixing a bug in my solution, and a ton of hardcoding constants and optimizing over testcases, we ended at 22nd place amongst ICPC teams; not a bad result at all! Considering our lack of preparation (me writing python scripts on the fly, no template code for automatically running scorers and saving best solutions, and unfamiliarity with heuristic contests), this result was a pleasant surprise and made me feel hopeful about our form. In particular, I was quite happy with how quickly I managed to implement things without making too many errors.

Following the ICPC Challenge, we had the opening ceremony, which had some fun performances. Unfortunately, like any respectable opening ceremony, we had some long, boring speeches in the middle as well. Not wanting to listen to them, I decided to get a bit creative; I downloaded some 2-player games on my iPad, and challenged my teammates to 1v1 me. In what would become the recurring theme of the trip, Bhaskar ended up losing a vast majority of games (don't let him convince you otherwise!). After the too-long opening ceremony, we made the 1+ hour trip back to our hotel and ended up practicing for a bit. 

A Opening Ceremony dance!
  
Bhaskar proudly posing after his loss to me in a General Knowledge quiz. The scores left me feeling quite concerned...

Team pic on the big screen!

The next day was the Dress Rehearsal, which was mostly without incident. A bunch of us ended up playing Avalon, where I managed to get a pic with Errichto; and I got some souvenirs from Saratov SU from pikmike. That reminds me that I really wish souvenir exchanges were a bigger thing at ICPC; I tried doing this last year (I gave people Stanford golf balls), but it didn't really catch on. Maybe in Egypt I will try to arrange something well in advance...

Meme-worthy Indian teams during the practice contest
   
Saratov SU merch

Avalon time!

After the dress rehearsal, I managed to get an extra 3 lunches from the organizers; my teammates, who were starving for more food, were very appreciative of this. In the evening, I decided to skip practicing with my teammates (who were planning on doing some individual practice) and work through problems with the IIT Kanpur team instead. I showed them a couple of cool flow construction problems I came across recently, and worked through my personal set of practice problems I like to go through before major contests.

The actual contest

Finally, it was D-day. The contest we were all waiting for! We woke up early, took the bus, and reached the contest hall way before the scheduled time. We reached so early, that there was really only one reasonable thing to do: play poker! Since we didn't have a set, we played completely online this time. Our game was interspersed with interesting comments from Bill Poucher, who was going around and entertaining us with random facts about teams. 

Finally, we entered the contest hall, and the World Finals countdown started. After going through the usual routine of "Don't touch anything" and "Let's speed up the countdown timer", the ICPC World Finals officially was underway!

Our contest strategy was as follows: I was at the computer first, and coded some boilerplate template code we would all need. Meanwhile, the other two read problems to find the easy ones. I ended up reading from the start, and problem C struck me as an interesting one. I worked on the math on paper; meanwhile, Bhaskar realized that H was not too hard, and started coding it. Around 15 minutes in, many teams already had AC on H, but some had WA; it was clearly a tricky problem in some way. 

Meanwhile, I had figured out the solution to C was some bruteforce check; the constraints having n atleast 6 was a clear give-away, and the rest was simply figuring out some divisibilities. Unfortunately, the lack of practice had made me underconfident in my solution. Meanwhile, Shivam had solved J on paper. I realized that my solution meant I would require some kind of way to avoid overflow, so I asked Shivam to quickly follow my logic and make sure I wasn't missing something; Bhaskar was still using the computer, so I wanted to make sure I wasn't going to implement something incorrect next. Shivam agreed with all my claims, and I decided that the best way forward was to use Python; though I had never used it in an official contest before! Meanwhile, I started reading the other problems; I went through B, E and H, both which seemed approachable.

Bhaskar submitted and got WA on H. He wasn't sure what was wrong, so we printed his solution and I took over and coded the solution to C in Python; it took me a few minutes to figure out the code, but I managed to finish and pass the samples. We submitted, and the worst case scenario happened: we got another WA. I gave up the computer to Shivam to do J, and me and Bhaskar were debugging our specific problems. 

While Shivam was halfway through J, Bhaskar figured out the "trap" in H, and took over and recoded his solution. Meanwhile, I figured out that my mistake was simply not exiting the while loop correctly; I have no idea how it passed the samples... I spent a couple more minutes ensuring I was not making a mistake, took over the computer, fixed this, and got our first AC at 74 minutes into the contest! Bhaskar finished his last few lines for H, submitted, and we got our second AC at 77 minutes. Subsequently, Shivam took over, and got AC with a few more lines; we had our third AC at 89 minutes. Things were looking good again!

At this point, the official stream tells me we were 9th on the scoreboard. I already knew how to solve L, so I took over while my teammates figured the other problems out. L seemed to just be a brute-force; and with my current form, I believed I could do it without taking too much time. While I was coding L, Shivam managed to come up with a solution to B, and Bhaskar came up with a solution to F. This meant I had to code quickly and accurately; however, keeping in mind that we had no practice with 1-computer, I was very concerned about how much time we were wasting there. In my mind, both my teammates were not the fastest typers, and they were debugging on the computer; therefore, I wanted to debug on paper as much as possible. With this rush in mind, after coding L and not matching samples, I immediately gave up the computer to Bhaskar for F.

We had a decent lead early in the contest

I went through my code carefully for a while, and found a few bugs; I kept taking over the computer until I managed to get the same expected number of steps as the sample. However, my starting coordinates did not match! It took me a while to realize the whole coordinate system was shifted; after taking another 15 minutes and fixing this, everything seemed to be perfect and I submitted; only to get a WA! 😐

Meanwhile, Shivam had solved G as well, and we had 4 problems queued at this point: F, G, B, L. I could not figure out my mistake in L, and I insisted on not using the computer to debug, which was a huge mistake. After spending forever trying to debug L, I decided to try to explain my code to Bhaskar once he was done and try to solve other problems meanwhile instead. I thought about problem A for a bit; meanwhile, Bhaskar finished F and got AC at 179 minutes. This pushed us to 17th place, with 3 more problems to go!

Shivam took over to code B; meanwhile, I explained my idea of L to Bhaskar. Since we had no experience reading each other's code, it was very hard for him to read my code for L. I suggested him re-coding it, but he said it was unlikely to pass if he did, since he would do the same thing as I did. At this point, I was desperate for an AC; I decided to simply re-code my own solution in a different way, bringing the complexity down from O(n^2m^2) to O(nmk), where n, m represent the rows and columns, and k represents the number of markers.

Having decided this, me and Bhaskar decided to work on problem A together, to hopefully get to 8 problems (if we managed to get B and G, and I fixed L). Looking back, this was a mistake. After Shivam got an initial wrong answer on B, I coded another solution to L, and got another wrong answer. Meanwhile, Bhaskar had solved A, and we let him take over to code A. He spent 5 minutes coding it, and at this point we had 30 minutes left in the contest. He realized that it would take him the entirety of the 30 minutes to finish! 

We decided to give up on A, and try to finish B and L if possible. Shivam realized he had missed a few cases in B, and spent time adding those cases. Meanwhile, I was looking for everything possible in L; were my arrays too small? Would I fail on small test cases? Did I not output with good enough precision? Did I take the input incorrectly? Was I printing the output incorrectly? (The problem asks to sort by y-coordinate first, which was unusual).

After changing as many parameters in L as I could between Shivam's debugging of B, we got WA on both until the end of the contest. Team morale was at the lowest it had ever been. We knew what we just did; took a successful contest performance, and threw it down the drain. Overall, there were a lot of mistakes made that future ICPC teams should learn from. Here, I list the lessons we learnt:
  1. After I could not understand what was wrong with L, I should have just insisted that someone else code it from scratch. It is a fairly easy problem, and probably I had missed something that someone else would now.
  2. I insisted too much on not using the computer to debug; maybe my L failed on small test cases or the maximum case trivially, but I only checked this on paper. I realized later my anxiety of using too much computer time led me to completely bomb the contest.
  3. We should never have started thinking about A. At that point, it should have been only between B, G and L. To be fair, all we cared about were medals, and we knew we needed 8 problems at least, which led us to this moonshot decision.
  4. Teammates should always be able to read and understand each other's ideas. This would have made our debugging much faster on B and L. 
To my teammates credit, no one blamed me for our terrible, terrible performance. I felt seriously depressed because I had bombed a problem I should be solving in my sleep in one of the most important contests of my life. I know I hadn't prepared for it, but I wanted to go out on a problem I didn't know how to solve; I had no large regrets (apart from not having 1/3rd of our team present, which I could do nothing about) in the Moscow World Finals because we got AC on everything we were able to solve. This World Finals was filled to the brim with regret; Solving 8 problems on paper was completely useless, since we only got AC on 4.

After the contest, timreizin told me that SecondThread talked about me on stream, which was cool. The video at the correct timestamp is here. The idea was that the commentators would tell the audience cool facts about the participants, and I want to talk a bit more about Bhaskar's cool fact. I know him since 8th grade, and this is Bhaskar's 4th different field in which he has reached world championship level; previously, he had golds in Junior Science Olympiad, Physics Olympiad, and he was 3rd in the world in U-12 Chess championships... Additionally, he's quite humble and even Shivam didn't know this fact until I told him. What a genius!

Aftermath

I was too depressed to happily talk to anyone after the contest. Aryan from IIT Kanpur came over and let us know that his team had solved 5 problems (they had 3 before the freeze, and at some point we had AC on 4 problems to their 1 problem); other teams were similarly happy or sad, but everything seemed as if it were in black and white.

"Well", I thought, "atleast we missed medals by a lot - not by just a little, right?". Oh, how wrong I was. In the closing ceremony, as expected, the resolver showed that we were the top team on 4 problems (which means that we were the fastest to solve 4 problems, which is a bad thing; any team that solved 4 problems as fast as us got atleast one more). We ended up on rank 50; atleast we made the top 50, right? 

Well, it turned out that IIT Kanpur was the 49th team (ie, the last team on 5 problems); and the resolver stopped. When it finally dawned on our team what was happening, we realized we made a huge mistake; by throwing our contest so hard, we missed becoming Asia West champions, instead giving it to IIT Kanpur. This moment was the most bittersweet of the whole trip; IIT Kanpur was the team I was closest to, and even trained with on the last day, but I would have wished they were champions by more than 1 rank. The difference was way too small, and our throwing way too bad to feel good for them in the moment.

IIT Kanpur, Asia West Champions!

Now that I've had time to process our (mostly my) mistakes, I'm super happy for the team, and for Aryan in specific. He has been one of my longtime closest friends, and I've teamed with him for fun contests many, many times. I know how hard he's tried to make it to World Finals; failing every time because of a stronger team from his college. He was able to come due to a miracle: one of the original team members from IITK could not participate anymore, so Aryan was able to take his place, and show us what he's made of. Thus, aryanc403 has become Asia West champion without ever qualifying for World Finals; all I can say is orz!

Other results of note are: UCLA is 34th (Lucas's team did extremely well! They are tied 26th), Purdue comes 20th (tied 16th; Kuroni was extremely sad about missing another problem, but thankfully they would not have medalled even if that were AC due to worse penalty; hopefully that makes the pain lesser), KTH is 13th, barely missing medals 😔. To the surprise of no one, MIT ends up winning; however, they do not AK (all-kill) the set, since they do not get AC on D, a geometry problem.

MIT wins Dhaka World Finals

After the closing ceremony, me and Lucas rush to get to a bus to the airport as soon as possible. On the bus, somehow the topic of wildcard matching comes up, and I tell Lucas how to do it with FFT (something I've seen on cp-algorithms here a long time in the past). Later, someone tells me this is directly related to problem G, which is sad since I didn't get to read it.

On reaching the airport, we meet none other than... the MIT team (specifically, Mingyang and Jerry from the team, and Ce Jin, their coach)! We briefly wonder how they will get all of their plaques, cup and medals to the US (duh, of course MIT will pay for the extra bag...). It turns out we have the same flight to Dubai; therefore, we end up getting dinner together and then playing card games at the terminal, waiting for our flight. At the Dubai airport, we realize we all have a lot of time to kill; Me, Jerry and Lucas roam around to get some souvenirs for friends back home (I couldn't get any cool ones at Bangladesh! 😓. I settle on some cool candles I see at the airport. Meanwhile, Mingyang is working on his biology homework for a class at MIT.

Souvenir candles I got for friends!
 
After some shopping, we meet up again to get some games of poker going. Lucas gets a particularly memorable play; he flops quads and then Jerry hits the full house on the river! Both of them naturally call all-in, and the result is hilarious.

Lucas flops 4 of a kind, beating Jerry's full house!

After a few games, me and Lucas decide to use our non-existent, long-forgotten biology knowledge to assist Minyang in speed-running his biology pset. As thanks for our rusty memories of the Rough Endoplasmic Reticulum having Ribosomes, he lists us as collaborators on his pset (I'm sure we did more damage than help, though...). We get a final picture with the MIT team before they head to their flight.

Mingyang showing off the results of our hard work (?) on the pset
From left to right: Me, Lucas, Minyang, Ce Jin, Jerry

It turns out that we played around for too long, and the MIT team is barely in time to make their flight. Me and Lucas have a bit more breathing room, getting on our last flight of the journey. With the end of a long trip looming, both of us are energized and we promise to do much better on Egypt World Finals next year. On the flight back, we play various games; we learn how to play Yahtzee through trial and error (highly recommended fun game of priors and posteriors!), and while Lucas whoops me most times, I manage to get the high score. 

Yahtzee high scores

Extremely tired on the way back!

Like a true software engineer, I manage to break the in-flight entertainment system

As we make our way back to Stanford, I realize that I only have one last shot left at ICPC World Finals. I guess I'll have to make the next one count; it's the only one I have where I'm able to practice with teammates somewhat before the contest. The end of my CP career is near, and Dhaka reminded me what CP means to me. Come next year, hopefully I'll go out with a bang.

In other news, my ICPC zoo has grown larger! Hopefully next year I'll be able to add cats to the mix...

My cute lil ICPC zoo!

Sunday, 18 September 2022

Applying to top Masters programs in Computer Science (MSCS)

Hi everyone,

Today I'm presenting a short guide to putting together an application for the top MS programs in Computer Science! This will be a lengthy post, so feel free to jump to the sections you are most interested in. I've tried to keep this blog post to contain general tips as far as possible, but it might be helpful to note that this is from the perspective of an Indian student applying abroad.

 Without further ado, let's get into it!

The opinions expressed below (this blog post will be full of them) are solely my own. They do not represent the views or opinions of any organizations or institutions I work for or with.

Sections

  • Materials to be submitted
  • Timeline
  • GRE/TOEFL - How to go about it?
  • Letters of Recommendation
  • Statement of Purpose
  • Resume
  • Selecting universities
  • Other miscellaneous tips
  • References
Materials to be submitted

For MS applications, usually the following materials need to be submitted:
  1. GRE/TOEFL scores
  2. Letters of Recommendation
  3. Statement of Purpose/Personal Statement
  4. Resume/CV
Timeline

If you are applying for admission in the Fall (August/September), programs usually have deadlines starting December 1 of the previous year. Therefore you should plan to finish everything by the beginning of November, so you have enough time to review your materials and make any changes. For reference, I took the GRE and TOEFL at the end of September/early October and had my other materials ready by mid-October.

GRE/TOEFL

The GRE and TOEFL are the standardized exams you must submit for grad school applications (though now the GRE is no longer a requirement in some schools). Good general tips for the GRE/TOEFL are given in this link; in this blog, I'll keep it to a brief overview and small tips.

GRE description:

The GRE (Graduate Record Examinations) is a ~3-hour 45-minute test that is roughly divided into three halves:


  • Quantitative Reasoning (Logical/Math skills, Scores range from 130-170 in 1-point increments)
  • Verbal Skills (English vocabulary, Scores range from 130-170 in 1-point increments)
  • Analytical Writing (Scores range from 1-6 in 0.5 point increments)


You can read more details of the exam online; here, I'll focus on what's essential for MSCS programs. Generally, top MSCS program applicants have a near-perfect score in the Quantitative Reasoning section (167+, say) and a reasonably good score in verbal skills (155+). A target score for the GRE should be 325-330 or above. 


Top MSCS programs are a bit lax on verbal scores, but you need an excellent quantitative score to stand a chance. Based on what I've heard (and what was said here), GRE is more of a rejection filter than a selection filter; having a 340/340 GRE will not guarantee admission, but having a 310/340 GRE will likely get you rejected. 


For analytical writing, targets should be 3.5+ on a scale of 6, with 4+ being ideal. 


Preparing for the GRE:

If you have a strong computer science background, then the quant portion of the GRE should not require too much practice (since it is primarily 12th-grade math). The verbal section requires a lot of reading and flashcards, especially if you haven't been reading novels regularly. Most people recommend downloading the Magoosh app for GRE prep, which I've found helpful. 

For the analytical writing section, I think checking out the book "Official GRE Verbal Reasoning Practice Questions" helps a lot; you'll find sample essays that scored 3/4/5/6, which will help you judge your writing skills in exam conditions. I asked a friend, and we graded each other's pieces based on the sample essays (i.e., how well-written they were compared to the ones given). A few tips for analytical writing are: You generally want to be nuanced, provide arguments for both sides of the issue, point out why the topic is not as straightforward as it looks, and give examples from real-life. Rehash your points in your closing argument to summarize your stance.

How long you should prepare for the GRE depends a lot on how you perform on a couple of practice tests; I always ask juniors to take one or two practice tests and then decide how much time is required. Some people score 330+ on their first attempt, and for them, I advise spending at most 1-2 weeks preparing, whereas, for those who require a significant brush-up of verbal skills (most common), it could be anywhere from 1-3 months. Start early; try to get this out of the way in the summer.

I want to note that more and more departments are making the GRE optional nowadays. I'm not sure if adding the GRE helps your application anymore, but if you are from a relatively lesser-known institution, having a high GRE score can help your case. You can take the GRE multiple times, so you shouldn't stress too much about the exam being a ride-or-die! (though the exam is somewhat expensive to take.)

TOEFL description:

The TOEFL test tests the ability to read/write/speak in English. It has four sections; each scored from 0-30 in 1-point increments: Reading, Writing, Speaking, and Listening. 

For TOEFL, target scores are a bit more complicated to set since some programs have some hard constraints on TOEFL scores that you need to consider, depending on where you apply. For example, some programs with TA requirements need you to score at least 27/30 in the speaking section; I believe the max cutoff I've come across is Cornell's, requiring at least 28/30 in speaking and 24/30 in the other three units.

Preparing for the TOEFL:

The Reading and Listening parts of the TOEFL are more straightforward, and practicing enough tests should be enough practice for the exam. For Writing, if you've done GRE before TOEFL (which is recommended), the TOEFL writing should be a walk in the park with a couple of caveats. Unlike the GRE writing section, you want to be more one-sided in your TOEFL essay (i.e., no need to be too nuanced). Since the TOEFL writing is graded more on the correctness of your grammar (compared to the GRE, which is more about providing a brief technical analysis of various topics), it is better to use language and vocabulary you are comfortable with. Another thing I found helpful is to vary my sentence structure, lengths, and overall paragraph styles to bring some color to my TOEFL essay.

Coming to the most challenging section of the TOEFL, Speaking, you generally want to take the version of the TOEFL test, which allows you to concentrate on your test and talk without your mask on (or, if this is impossible, practice with your mask on). Additionally, I didn't realize how much noise the center would have (because everyone is taking the speaking test around you). Once I realized this, I started rushing through my exam a little to reach the Listening and Speaking section first to avoid disturbances, which paid off.

Letters of Recommendation

When applying to MSCS programs, you'll have to ask for 3 Letters of Recommendation from people you have worked with professionally or academically. The prevailing thought is that the ideal LoRs come from Professors you've worked with on a research project, who can go into detail about your work and how impressive it was. Slightly less preferred is industry LoRs (especially if your manager does not have a PhD or MS). The last resort should be Professors you've taken a course with and done well in; generally, such letters should be avoided.


Asking for LoRs: Ideally, you should inform your LoR writers that you will be applying for grad school and would like a letter from them around the beginning of October. After they confirm that they would be happy to write you an LoR, send them a mail with the following:


  • List of schools that you will be applying to, with their corresponding deadlines
  • A copy of your resume
  • A copy of your statement of purpose
  • A copy of your transcript
  • GRE/TOEFL scores

Usually, application sites have an interface that allows you to ask for an LoR from someone via email (applicants are not sent copies of their LoRs). I strongly advise sending all emails together simultaneously for all the schools you're applying to. Professors are busy, and often they'll write/send LoRs day of, and you don't want them to miss a school because you sent it in a 17th email addendum...


Statement of Purpose

The Statement of Purpose is generally a 1-2 page document that elucidates why the school should accept you and why the school is a good fit for you. I like the tips given on this page for SOP tips; in general, I think the following structure worked quite well for me:


  • I began with my background, research interests, and why I wanted to join the program.
  • I discussed my academic background in-depth—research projects, papers, internships, etc.
  • I followed this up with a paragraph demonstrating how I gave back to society: this mostly involved teaching high school students, mentorship programs I was a part of, etc. 
  • I added a paragraph that showed I read about the department, noting 3-4 professors whose research areas and interests match mine.

One thing that I noted is that it helped me to have the following structure when talking about projects: I tried to answer the following questions in order:


  • Why was this project interesting to me? Why did I choose to do this wrt all the other opportunities?
  • What did I achieve? (This is the core of the research work)
  • What did I take away from this work? How did this change the path I was on?

Using the above prompts, I converted a mechanical list of projects into a more enticing and human story. I went through my journey and explained to the reader why I think I would be a good fit for the program based on my self-reflections while also going into some technical nitty-gritties demonstrating knowledge and understanding. I also tailored content a bit for each school; for Stanford, I added a line or two on my involvement in some entrepreneurship events. For Georgia Tech, I tried to focus less on my theory research and more on the AI side (since I saw that Georgia Tech theory track was only for PhD students), etc.


Another tip is to NOT read anyone's SoP (seniors, ones you found online, etc.) before writing your own!


Resume/CV

Generally, I recommend using Latex for grad school Resumes/CVs; you can find my CV (Last updated December 2021) here. About length - I think a 2-page resume is a sweet spot, but I decided to go with a CV, so I didn't have to worry about length too much. 


Please get your resume reviewed by seniors/people studying at your target schools since this is a crucial part of your application! 


Selecting universities

To select universities, people seem to generally follow a rough 3/3/3 rule: apply to 3 universities that are ambitious to get in, 3 universities that are a match, and 3 universities that are "safe": where you think you'll likely get in. 

This seems to certainly be valid if you are looking to study in the US in the current year for sure; as an alternate perspective, I decided to apply exclusively to programs that I would be excited to attend, because I already had a job offer that I would consider over any other programs.

While ranking universities from best to worst is a subjective process, it is definitely helpful to have some rough sense of how specific departments of universities rank against each other. For this, the most helpful website for me has been Drafty CS Rankings. Note, of course, that rankings are not everything: though I was admitted to both CMU (Rank 1 in AI) and Stanford (Rank 2 in AI), I decided to take Stanford due to other considerations, such as significantly better graduate funding (assistantships at Stanford cover 100% tuition, along with providing a generous stipend).

As a tentative list, I applied to: Stanford, CMU, UIUC, UCLA, UCSD, UMich, UT Austin, Columbia, Georgia Tech.

Some of my friends also applied to: Cornell, Princeton, UC Berkeley, Caltech, UW Madison.

Other miscellaneous tips
  • Use Grammarly to check your resume/SoP for spelling and grammatical errors! After all, language errors are a Kiss of Death for grad school applications...
  • If you have a couple of semesters before applications, it might be worth spending time pushing your GPA up. GPA definitely matters for MS programs!
  • You'll have noticed I wrote multiple times to ask people to help review your application. Sometimes, people think the quality of application materials doesn't matter if you're a great applicant. To them, I say that I've had brilliant friends who didn't get in because they made mistakes like writing that they wanted to work with a faculty member who turned out to be retired or dead - it turns out that dead people don't often take new grad students...
  • Grad school applications are an expensive process. If this is a potential financial strain for you, most schools seem to provide some financial aid, such as a subsidized application fee based on need - I'd encourage looking into this early on!
  • In keeping with the previous tip, CMU has previously had an early admission deadline of mid-November which allows you to submit your application for a reduced fee; you might want to look into such deadlines early on, to give yourself enough time to meet them!
  • When going for your GRE/TOEFL, you'll get to send scores to up to 4 schools for free, but you must do it right after the exam ends. You'll be shown your score first - go in with a threshold score in mind above which you'll send scores, and shortlist the schools you'll be sending them to. Also, remember the states these schools are in - I spent a lot of time looking for the schools because I couldn't remember US states... 🤡
  • Lastly, remember that grad school applications are a crapshoot; don't stress too much about them. I remember thinking that I'd get in nowhere, got rejected from my 2 safety schools, and then got into my top 2 choices... 
References

Most grad school references below are for PhD programs, so take them with a grain of salt. However, they are still useful, especially if you're applying from the perspective of completing a thesis in your MS.