hey everyone today I'm super lucky to be with my friend and colleague Pasha who also happens to be an II medalist but before we talk a lot about competive program today do you want to quickly introduce yourself thanks Kevin I'm Pasha I'm Kevin's friend and colleague we're meeting here in Chicago to discuss coding F programming and more awesome so you're from bellus right yeah I'm sure most viewers are from bellus so can you briefly describe the qualification process for your country it's actually a very similar to most other countries where you have certain um stages
in the competition and four best contestants in the nation are selected to go to the international level of the II for each country yeah I see it's only four per country when it comes to competitive programming specifically I was not taking it very seriously and three times in a row I was making it to the kind of regional City level and and I did very poorly on that level 3 years in a row and then eventually in high school I realized that I really want to get into the national level and get a medal in
the uh national competition because I didn't want to study for exams because if you took a mle of the national level you could pass to any University with no entrance exams so I was like okay I I really want to get this medal on the national stage and then I started taking it very seriously I see ended up getting a bronze medal at the II awesome uh throughout the process of preparing what are some like the common mistakes that you made that you would probably tell other competitors to avoid focusing on the theory is a
very common mistake where why is that isn't it all theoretical well not really really it's not theoretical at all because at the end of the day you need to uh write the code that works ah I see uh yeah and uh the best way to get better at writing code is writing code so I think I've made the same mistake before when I learned programming like I would try to read a lot to understand something but then I realized eventually that the fastest way to obviously get better at problem solving is to solve problem so
I totally I totally see what you mean and you you remember better this week yeah exactly you wrote it down right right exactly yeah for sure for sure uh what are some other like common mistakes you made during your preparation process it's Al very common not to prepare for the for the mental component of the competition you're sitting in a room it's an open space you can hear everything you can hear them typing for example that's stressful yeah timer and annoying absolutely absolutely right and the annoyance is negatively correlated to how well you're doing right
the competition yeah if you're not doing well you're getting more annoyed fair enough and you can spiral down I was sitting once I read through the statements didn't know how to solve anything at the Nationals glanced at my neighbor yes he had 300 points where some competitions it's a whole open scoreboard and everyone sees how you're doing you you can see how everyone else is doing and uh you need to emulate a competition at home you need to set yourself a timer you need to try to emulate the stress to be fully prepared for that
too right so back to what you said about the importance of problems solving what are some things that you did when you were like solving more problems that helped you you know prepare better what I did is I downloaded a timer on my phone where I increase the timer every time I solve the problem so that's like a positive uh feedback Lo right right you kind of gamify it becomes a game but the game could be cheated if you just solve a lot of easy problems which is also a common mistake that people make which
you can't do you're going to stop St progressing this way right yeah you're you have to solve hard problems harder that you can solve mhm and you need to read editorials to learn what did you miss and then implement the solution even if you if you think you understand the solution you have to also write it submit it anyway to remember so I would pull out my laptop and start solving problems while in Biology class or any other class where the teacher would let me to do that really yeah they all thought they all thought
I was like playing Minecraft or something they only have so much time I 1 and a half 2 years in high school I had to go from almost zero to iy so no time for anything else optimize everything to reach the goal invest as much time as possible into that one thing yeah pretty you solve problems on the train too on the train I know train trains in Europe are on the train I was so I I I had to take a train to school every day on on the train I was dreaming I was
dreaming about winning these competitions that's good that's motivating was I think a lot of people underestimate how hard you have to work to reach this level of competition how hard did you work if you were to like count the hours or whatever describe it uh in Greater detail it really depends I did work a lot I solve problems all the time every day all the free time I had I was writing down algorithms solving thousands of problems a lot there were people that didn't and did much better than me there are people that solved much
less problems were much less and they absolutely destroyed me at every competition how is that the case how's that possible if you have the capability you can do that right like there there's there genetic unicorns right right of course so it it very much depends but even even if you are such a person the harder you work the better you'll do right so the people that are genetic universe and then they solve thousands and thousands of problems s are the ones that become one of the best in the world are the ones that become top
10 top 20 on C forces get get the golden medals so when you were preparing what kinds of resources helped you the most yeah the thing is that to prepare for these competitions you can absolutely do it online on yourself on your own by yourself all the resources are available so you have CP algorithms. comom you have code forces.com where you can solve all kinds of problems and you can read editorials and you can talk to people ask them how did you solve this why does this work why does why this doesn't you have also
websites of just competitions that happened like National Olympians of most countries all the problems online you can read about algorithms on Wikipedia so those are those are the things I used I see that makes sense how do you feel about Le code Le code is different Le code is just for interviews pretty much it's interview questions so what's the difference I guess the main difference is just the competive program problems are just 10 times harder yeah like I've heard uh I was solving 22 23 2400 score problems uh in high school there and uh yeah
and and I was solving thousands of problems MH right so it's like um you said you had like a counter thing right how how many problems did you solve by the time of my career I had 1,16 on that counter and those are like hard problems where you those are only hard problems that's crazy count I don't think I've solved 1,000 follows in my life that's well maybe you learn faster than me maybe no no absolutely not some people don't have to solve that many problems but yeah that's this the number I had so yeah
if you want to if you want to if you want to prepare for competitive programming competitions you probably shouldn't do weak maybe like in the beginning a little bit but then you should progress into some harder stuff for sure so what are some of the algorithms or data structures that you think are most helpful for competitor yeah so so the way it works is that you have certain uh Basics there some core basic algorithms that probably every software engineer should know basic tree algorithms you have your connected components BFS DFS shortest paths you have your
string algorithms you have your segment tree you have your binary trees you have your list and stacks and cues um I don't know what a seg is so I guess it's not too much day-to-day but it's it's very important right so have those very kind of uh core algorithms M and if you study those really well I think it's going to do 80% of the job for you and then you get like kind of the 20% stuff where you have more complicated algorithms you have your like menot right suffix table Havey light DEC composition of
trees you have your aoic automata but then it gets a little bit less use useful and then those algorithms become more rare and they're also less useful in real life right so so it depends it depends on your strategy I did learn those other things just to gain a little bit more Edge a little bit more Competitive Edge right like what if they give me a problem on heavy light decomposition I better know that right but you can you can definitely get even an II medal without that that makes sense yeah so you made II
in 2020 right yeah which was during yeah I'm sure that the experience could have been much better but I'm sure it was still awesome regardless so tell me about what high I was like in 2020 yeah so we were coding in in like a small uh classroom we had an online stream where they showed online all the cool places in Singapore right instead of being on site there the competition right but yeah I I didn't really care about anything like that because for me it was such an insane dream which seemed absolutely impossible to accomplish
in my first year of high school I was still 10th in the country and then at the selections I will I made it to the selections to the Iowa I was a candidate of the Iowa in 10th grade um I was completely destroyed and I got 12 place out of 12 wow so for me even even with like a golden me medal in the Nationals was it seemed absolutely impossible I think just no chance mhm um because you have to make make it in the top four right So eventually I did make it and eventually
in the in the next year in 11th grade it did make it in the top four I was the second this time was the second in the country nice and the Nationals and then the third of the selections it's absolutely insane a whole Beyond a dream come true and I was coding the second day of the II on my birthday too mhm I had to write that on my birthday it was on my 18th birthday that I coded Iowa that's that's awesome that's crazy that like for sure yeah yeah it's my 18th birthday that's really
cool yeah I did not care i' love to see it um so to wrap up what kind of advice would you give aspiring like CS Majors or software Engineers what would you tell them based on your experience if you're a CS student in general it's not a time to rest at all cuz it's a brutal competition and uh the more you can do in college the better you'll set yourself up right right so and the the earlier your start the more experience you'll accumulate the better it will be for you and it's the same game
as with the ioi where the more time you put in the better your outcome will be the more you'll get out of it so I started doing interships and I want to get as much experience as I can learn as many things as I could so that's why that's why I did that basic weren't you weren't you able to chill cuz you had already become an IA manist or chilling is boring chilling is boring this is much more fun right I see this is this stuff is much more fun what can be more fun than
working towards achieving a dream let's redo that oh that's good Z nice let's go [Music]