Become a Creator today!Start creating today - Share your story with the world!
Start for free
00:00:00
00:00:01
Inside the World of Competitive Coding (with Mathis Hammel) image

Inside the World of Competitive Coding (with Mathis Hammel)

Developer Voices
Avatar
930 Plays1 year ago

Whether you’re trying to ace the coding interview, sharpen your programming skills or just have some fun learning new things, the world of competitive coding has something to offer you. Some people join with dreams of hitting the podium, and plenty of others are just competing to be their better selves.

Either way, Mathis Hammel is a veteran of the competitive coding scene and he’s going to give us a view into that world, tell a few war stories and share some tips how you can play better, faster and stronger…

ICPC: https://icpc.global/
Advent of Code: https://adventofcode.com/
Advent of Code, Day 18, 2022: https://adventofcode.com/2022/day/18
Clash of Code: https://www.codingame.com/multiplayer/clashofcode
CodeForces: https://codeforces.com/
CodeWars: https://www.codewars.com/
HackerRank: https://www.hackerrank.com/

Mathis on Twitter: https://twitter.com/mathishammel
Kris on Twitter: https://twitter.com/krisajenkins
Kris on LinkedIn: https://www.linkedin.com/in/krisjenkins/

Recommended
Transcript

Why Choose Programming?

00:00:00
Speaker
This week's episode of Developer Voices kind of unifies a few of the biggest reasons that people get into programming in the first place. You've got a love of learning new things. You've got the fun of solving puzzles and technical challenges. And you've also got the very real need to find a good job.
00:00:19
Speaker
I've always considered that we're very lucky in this profession that we can combine those three things fairly successfully. So this week we're going to take a peek into the world of competitive coding solving algorithmic challenges against the clock. You can do it solo, you can do it as a team sport.
00:00:35
Speaker
And while you're definitely going to pick up a few very useful tips for gaming programming interviews, we're mostly talking about the game for the game's sake. How can we play with computers? How can we play better? And where's the most fun to be had? Joining me to discuss it is a veteran of the competitive coding world, and these days a coach to younger teams, Matisse ML. And I think by the end of this, he'll have you convinced that
00:01:01
Speaker
He could ace any programming interview that's based on algorithmic tests, that that's probably not the right way to interview new candidates, but we're going to carry on doing it anyway. And most of all, that if we focus too much on coding to get the job, we'll be missing out on a whole lot of fun. So let's get into it. I'm your host, Chris Jenkins. This is Developer Voices, and today's voice is Mati Samel.

Weather Chat in Europe

00:01:39
Speaker
With me today coming live from France, it's Matisse Amel. Matisse, how are you doing? I'm doing great. How about you? I'm very well, yes. Enjoying the warm weather we seem to be unusually having on the continent. Yeah, same. We have a lot of heat right now, but I think it's more variable than yours. Yeah, over in England, we buckle quickly under the hot weather.

Matisse ML's Career Journey

00:02:04
Speaker
But enough weather, I got you in because you've got such a varied CV. There are like a million and one things we could talk about. We're going to get onto the actual topic. But you've been like head of cybersecurity for Capgemini. You've done talks on quantum computing. Give me your history and try and give me a unifying thread of what you're interested in.
00:02:28
Speaker
Yes. Well, the unifying thread, I think it's pretty simple, is I'm very tech curious. So anything that makes me think, wow, this is an interesting topic, I just get into it and sometimes I make it into a job. But yeah, I've always been fond of
00:02:50
Speaker
anything, especially related to competition, I'm like, I'm not doing that, like to beat others and show myself that I'm better than others. But just the fact that I have, you know, this spirit of competition and actually playfulness. And so yeah, I've worked in AI.
00:03:15
Speaker
My first job was in AI. Then I moved to cybersecurity. Yes, that's one thing I've been exploring for a long time, since I was in high school, I think.
00:03:30
Speaker
And now i'm more on the. I'd say technical recruitment and competitive programming sites which is also competitive programming i think we're gonna talk about that in detail but i've been enjoying that for like ten years i think.
00:03:50
Speaker
I can see a competitive thing in AI, especially game-based AI, there's an actual competition there. Cybersecurity is kind of a geek's war between two different sides. But the world I really have no experience of, even though it's obviously competitive, is competitive coding.
00:04:12
Speaker
So other than those algorithms you were supposed to learn at university, do those really fast. That's the whole of my knowledge of it. So take me through what it's like to be on a competitive coding team.

Platforms for Competitive Coding

00:04:27
Speaker
So competitive programming, I think the most common experience people will have will be in some websites like CodeWars or CodeForces coding game.
00:04:40
Speaker
I work for coding game by the way but i enjoy a lot of our competitors as well and also you have advent of code which by some people is played competitively like myself i enjoy doing that as fast as i can.
00:04:57
Speaker
So yeah, the principle is really simple actually it's the format varies but You have maybe two or five or twelve hours to solve a set of problems As fast as you can and as many problems as you can so usually you will have like gradually increasing difficulties and Yeah, you you are ranked based on the time and the number of problems you solve basically and
00:05:27
Speaker
Advent of code I know right as like the thing I love about that is the programming puzzles and sometimes it takes me most of the day to finally crack it and then you look at the leaderboard and there's somebody who got up at 3 a.m. and cracked it within two minutes.
00:05:44
Speaker
Yeah, I am one of those people. How do you become a person like that? I'm not sure I'm ever going to get up at 3 a.m. and do knapsack algorithms in three minutes. But if I wanted to, would I get to that level? I'd say it's... I'm not really sure, actually, how you, like, really get into that. Just the idea of...
00:06:12
Speaker
getting the best out of what I can do and really trying my best to crack one puzzle as fast as I can and really get my brains going is one thing that keeps me going in the kind of training even though I don't really consider
00:06:32
Speaker
Anything i do being training it's more like i play and overtime i get better at doing that so you know there's not really like two phases like one competition and one practice where i just do something really specific over and over but how do you get.
00:06:55
Speaker
Um, into that, I think it's just like, Oh, I played that. It felt good. I mean, let's do another one next week or something. And that's, uh, that's it. You just keep playing the game over and over and eventually get better.
00:07:12
Speaker
Yeah, that's about it. Well, at some point, and it will usually come very fast, you'll realize that you need to have theory and you need to read some stuff and read some books or papers or whatever to actually get what you need and learn what you need. But it's mostly practicing and so mostly playing. And it's also a very good thing because
00:07:41
Speaker
I don't think I would have like the willpower to do like 12 hours of practicing before any contest or anything. So my training

Improving Through Practice

00:07:53
Speaker
is just more competing, which is very efficient for me because I really love competing and not really training, I guess. You're not trying to get to the very top of the podium, you just love being in the game.
00:08:06
Speaker
Yeah, that's about it. And over time, after doing all of them, you'll get better inevitably. So even if I'm not trying, I'll get better and better rankings.

Solving Complex Problems

00:08:24
Speaker
And so that's also very satisfying to get that. What's the actual experience like?
00:08:33
Speaker
My impression of these things is you read a puzzle and it's dressed up in some fancy way, but eventually the penny drops and you realize, oh, this is the A star algorithm. And then you try and remember how to implement A star and is it like that?
00:08:48
Speaker
Yeah, that's it depends some I'd say the easier competitions are like this. So they disguise an algorithm that's exactly as it's designed like in any book or something. So you just need to find which which one to apply to whatever problem you need. But for more advanced stuff, it's more like, okay, this
00:09:15
Speaker
It really depends but it's usually a way of applying a family of algorithms and you need to actually create your own algorithm. So I'm not really sure I have an easy example but one very classic one is dynamic programming which is
00:09:34
Speaker
basically one way of modeling mathematically a problem. And this modeling is really not standard based on different problems. The way of actually computing the solution based on the formulas you create, yeah, it's easy. It's always the same. But creating those and actually cracking that little thing that allows you to
00:10:03
Speaker
Detects what exactly you need to do is is actually the heart of the problem and usually it's On the more difficult side in when when you're playing easier competitions. It's either Algorithms, so usually it's pretty simple algorithms. Like yeah, you mentioned like graph path search or shortest path and things like this or it's something we call speed coding which is
00:10:31
Speaker
Very, very simple exercises that only need implementation, basically. So a good example for that would be like the first five to 10 days of advent of code, which usually you don't need to know a lot of algorithms to solve. Yeah.
00:10:48
Speaker
Yeah, you can sort of mentally brute force those ones, right? And then they gradually ramp up the difficulty to where you need to be up to speed with some of the latest papers sometimes. Yeah, that's

Coding Efficiency Tips

00:11:01
Speaker
that's about it. Yes. And so sometimes you immediately know what you need to know what you need to do. And this is what's
00:11:09
Speaker
you actually implement. So sometimes it's pretty complicated. I've had speed coding exercises with 100 lines of Python, for example. It doesn't mean that it's very easy to do and very fast, but the algorithm, it's pretty simple and you could do that by hand.
00:11:27
Speaker
And some other times, yes, you need to identify actually the algorithm that's hiding behind that. And this requires a bit more knowledge. And oftentimes, if you are competing, it also requires knowing a few tricks to code them faster. So for example, for Advent of Code, in the last three editions I've played, I haven't coded a single graph algorithm.
00:11:54
Speaker
Because I'm using libraries, so I'm defining my graphs. I'm using network X in Python, which is super efficient for that. And yeah, I'm just modeling my stuff and let the algorithms coded by other people better than me do the job. So these days you're going into a event of code, which for those that don't know is like 25, 24 daily programming puzzles leading up to Christmas.
00:12:24
Speaker
These days, you're going into that with your pre-prepared, hand-tailored library. Like you're sharing all these tools at arm's length. I have a template. It's not that big. It's like 50 lines long, but it does three very important things. So I have in the first lines of the code, I have imports of the most common stuff, and I have a few defined functions.
00:12:50
Speaker
For example, one that parses a list of numbers that are. So I give that function a string containing numbers separated by spaces. And it gives me back a list containing these integers. So this kind of easy functions also, I define constants for, for example, the four directions. So up, right, down, and left. So with the deltas.
00:13:16
Speaker
in each direction, stuff like this that I'm pretty sure I'm going to have to use in that computation. So this is the first thing, pre-imported and prepared code. Also, I have a part with my cookie, my session cookie on the website, which allows me to do
00:13:37
Speaker
download the problem statement. No, not really the problem statement because I read it on the web, but download automatically the input for that day. Put that in a string and then I can process it instantly instead of doing what everybody normal does, which is downloading the inputs, putting that in a file, opening the file, reading that. It loses you even if you go fast. This can lose you a minute and a minute is like
00:14:08
Speaker
way too much in that. And that's an easy gain of time. Other people do way more extreme stuff to gain like five seconds. I don't go to these lengths. But yeah, I think I'm pretty optimized. And of course, the third part of my template does the submitting of the result. And so I automated it to that degree.
00:14:33
Speaker
Sorry? You've automated it to that degree. Everything that's done every day or that I have to do frequently, I have it prepared so I don't lose time actually doing the implementation of whatever I need to do. Do you have a similar thing for like, so there's the ICPC, which is the big international coding contest. Can you wander in there with your pre-prepared library?

ICPC Challenges

00:15:03
Speaker
Yes and no. So the ICPC has much different rules. So first of all, it's student only. So I used to have played twice in the ICPC regional qualifiers. It's not really that impressive because it's open to everybody.
00:15:22
Speaker
The first time I played actually was absolutely terrible. We weren't prepared. We got the news that our team had their spots. We got the news five days before, and it was in another country. So it was a lot of stuff to prepare, even on logistics. So we weren't really prepared. And in the team, we were two French guys and one German guy. So language barrier.
00:15:50
Speaker
I was coding in Python. My fellow French friends was coding in C++ and the German guy was in Java. So yeah, that's a lot of incompatibility and inefficiencies, especially combined with not training a lot. But yeah, as I mentioned, it's played in teams of three. I think it's
00:16:15
Speaker
Yeah, it's pretty much the only, no, no, it's not the only, but it's one of the rare competitions where you play in teams.
00:16:23
Speaker
Another classic example would be Google hash code, which rest in peace because it's been shut down by Google. But yeah, there's not a lot of competitive programming played in teams. This one is also very specific because you have five hours to solve between 12 and 15 problems and you don't have internet access and you only have one computer.
00:16:47
Speaker
You have checked EPT there, right? But that's one thing you're allowed and the only external resource that you're allowed to have is one notebook that I think you're allowed 25 pages of whatever you want. So usually you will have most of the classic algorithms that you're not like.
00:17:12
Speaker
coding by heart. So a few like string matching algorithms that you use in very specific cases and stuff like this. Yeah, it's actually you don't you usually don't really need this notebook. It's only for safety.
00:17:28
Speaker
I've used it once it was for a convex whole algorithm which i think we would have gotten but it's there's much more comfort in having that prepared in your notebook some teams some teams will have their template and copy that
00:17:48
Speaker
at the beginning of the contest because you start on a computer that's basically brand new, like there's a fresh new install, so you don't have any files and you are only allowed to touch the computer when the contest starts.
00:18:04
Speaker
It's basically you have to choose either you start coding immediately or you have someone start implementing your whole template. So like 300 lines of prepared functions and stuff to get faster later. But usually the teams will not do that. I instantly thinking I would lose a lot of time to just setting up my favorite editor.
00:18:29
Speaker
Yeah, so first, you're allowed to ask for any specific ID you want in that content, which is good. But usually, even in that case, we usually use very simple stuff like Sublime Text or VS Code because there's three teammates and it's
00:18:50
Speaker
not really common to have all three teammates use the same IDE in their daily life. So usually we pick the more simple and common stuff. So yeah, that's it. But yeah, you have
00:19:04
Speaker
a practice day before. So you have a shorter contest on the day before, which is two hours, and you are in the same condition. So you have like our notebook, you have the same blank computer that allows you to understand how to get started, also make a few submissions on the judge website to make sure that everything's working and stuff.
00:19:32
Speaker
And so this is the only part of the contest where the contestants are allowed to chat with their coaches. On the real contest, we are in another building. So there is actually like a coach on court.
00:19:51
Speaker
Yeah, the first day. Nowadays, I'm a coach, so I'm not a student anymore. So I've been coaching my former team. So it's well, former team, actually, it's my, my university where I graduated from.
00:20:08
Speaker
I coach them still. So the team changes basically every year because once people graduate, they can't be in the team anymore. And so yeah, it's very nice to have like fresh blood people to work with and teach them how to get better. It's also very frustrating because sometimes you lose like a great element. One of the best students graduates or goes into academic exchange because we
00:20:35
Speaker
We have a lot of Erasmus exchange programs. And so they live oftentimes, they live for the last year. So actually, we have students up until fourth year and all the fifth year students live to go to go abroad and sometimes competing in their own universities.
00:20:56
Speaker
You know, this is off topic, but I'm thinking of all those like Disney movies where a coach comes in and coaches the team to great success. And they've got loads of those for every sport.

Competitive Coding as Entertainment

00:21:09
Speaker
Right. And this is a missing gap in the Disney stockpile. Yeah. We should make a movie about competitive programming. I think. Yeah. Yes. I've got all those feel good success stories you want.
00:21:21
Speaker
Yeah, on a very niche audience, but I think it will work. I love niche audiences. We live in them, right? How does this actually play out? If you've got a team, you said it was 12 to 15 questions, three people sit down and they're not even using the same programming language. What do you do? Do you race through the list of questions and the Java guy says, I'll have that one and that one and that one? Well, first of all,
00:21:49
Speaker
having three different languages is not really a good idea in a team. It was just because we made our team last minute. Usually we will try to have people on the same language and also people speaking that same language because we also have incoming exchange students. And so usually we'll have one team that speaks only in English. And so you saw the problems are given to you in
00:22:17
Speaker
In random order so you don't know which ones are easier so the first step is to actually read through all of them and find out which
00:22:28
Speaker
one or two are the easiest. So we call them ad hoc problems, which will be the ones you really need to start coding first, because there is also a time element. Basically, your score is, you are ranked, the team is ranked based on the number of problems they solved. So usually the most like the bulk of the competition, solves between two and five problems.
00:22:56
Speaker
When you start getting into six, seven, eight, nine, it's really like the top 20% or something. So most of the teams will not solve half the problems.
00:23:08
Speaker
And you really need to get started fast because it's, yeah, the rule is pretty weird to explain, but there's, in case of a tie, so for example, all the teams that solved four problems, they will be ranked based on time penalty, which
00:23:28
Speaker
is basically you take the sum of the times of submissions of the problems. So you have solved one problem after five minutes, another after 20 minutes, that's a 25 minute penalty. And so you have to get fast, especially on the first problems.
00:23:46
Speaker
and you have to submit them in the first minutes. So the first part is actually searching very fast. So you split usually 12 problems. Three people, it's perfect. You have four problems each, and you try to find the easiest problem in the problem set, basically. And one person will actually get started coding on that and submitting that as fast as they can. Usually, it takes
00:24:14
Speaker
The first correct submission takes maybe one or two minutes max. From the gate opening? Yes. Geez. Okay. That's really far. I mean, they must be going at breakneck speed. Do you get people drilling their typing speed as well? Yeah, there's a warm-up. I've known some people who've, like,
00:24:41
Speaker
who warmed up actually before their contest. They do like typing stuff. They are only typing words. I think they, they should do that with code, but, um, just to get their fingers warm. I don't really do that kind of exercises. Uh, I think same. It's like a lot of effort to gain like six seconds or something. It's, I'm not really into that, but, uh, some, some people really need also to get
00:25:09
Speaker
in that spirit. So like, get focused and stuff. So how far up the rankings did you get with this? Obviously very into it, but fairly casual attitude.
00:25:22
Speaker
So in the European qualifiers with my best, so in the European championship basically, which in the southwest of Europe is called SWERK, so S-W-E-R-C, which is a qualifier for the world finals. The world finals, there's like a hundred teams. In southwestern Europe, we'll usually have like three or four of these spots.
00:25:50
Speaker
Many of those come from Russia, many of the world finalists. But in the European qualifiers, last year I played, there were I think 120 teams and we ended up 24th, so pretty happy with the result. It's been like five years now. But this year I've been also playing Advent of Code competitively.
00:26:19
Speaker
The thing is, they get released at midnight Eastern time in the US, which is 6am here in France. And I'm not waking up at 6am every morning. That's not something I'm doing in December.
00:26:37
Speaker
I cannot compete on the global leaderboards because to avoid cheating and stuff, they time everybody starting from the release of the problem, which is perfectly normal. But yeah, I can't compete because people usually
00:26:54
Speaker
complete it in five to 15 minutes, usually most of the days. So I cannot play it whenever I wake up. So what I've been doing was having a virtual timer, which is a Chrome extension that times the moment, between the moment I open a problem statement.
00:27:19
Speaker
until the moment I finally solve the problem. And so it allows me to basically know my ranking if I were playing at 6am every day. And yeah, this year I've been pretty successful. I'm pretty sure if I was in the top 100.
00:27:41
Speaker
I think I have my actual virtual ranking. I mean, I've played Advent of Code, seriously some years, casually others, but then speeds of the top ranked players just astonish me. There are people solving it before I've finished reading the problem statement. I just checked if I were playing normally, I would have been 46 on the global leaderboard.
00:28:10
Speaker
Really? This recent year? Yeah. Who's a huge number of competitors for Advent of Code? Yeah, I've been, uh, let me check my best ranking was, I think, yeah, one, one day I was a 14th globally. From a 14th? Took me, yeah, took me six minutes.
00:28:28
Speaker
to solve both parts. And if you want to compete with me at home, it was on day 18. Day 18 of 22. Yeah. Oh, sorry. It took me eight minutes. That's six minutes between parts one and two. Okay. I'm going to link to that particular problem in the show notes. If you have a look at that as a listener, I'm sure you'll see quite how fast that is. Because they get harder and harder as the clock goes on. So day 18 is a lot harder, right?
00:28:57
Speaker
Well, that one I think must have been very easy because day 19 took me an hour and 19 minutes. Very easy as relative, depending on your skill set. This is huge fun, but weirdly for you, it seems to have translated into a spot in your career, right?
00:29:20
Speaker
Yeah, I've been. So yeah, there's not a lot of work in competitive programming or cybersecurity for that matter, because I've been enjoying that a lot in the past as well. There's not really a lot of
00:29:38
Speaker
work. I mean, people want you to build websites or apps to make money. They don't want you to like, yeah, great. You've been 50th place on the advent of code. Wow.
00:29:52
Speaker
Well, we're really going to earn money from that, right? Yeah. But I've managed to find some interesting stuff. So for competitive programming, my current job, I kind of do that. I also now I'm an independent consultant. And so I do work with one of the biggest providers of coding contests in Europe, which is called Isograd.
00:30:22
Speaker
And they what, especially in France, they make like most of the big competitions. And so now I'm, I create the problems and I proofread those from other reductors. So yeah, I'm kind of on the other side, I was first a participant, then a coach, and I'm actually in the creators.
00:30:44
Speaker
I've actually also participated in the finals of Google Code Jam as kind of a volunteer because I was interning at Google the first year Code Jam was in Dublin.
00:30:58
Speaker
And I was there in Dublin, and when they requested for volunteers, of course, I was in. So that was also a nice experience. And also in cybersecurity as well. There weren't any jobs in competitive cybersecurity, so I made mine. So we were in charge.
00:31:21
Speaker
So with my as a freelancer with my brother we were in charge of organizing a big contest for Capgemini in France and we met the director of cyber security.
00:31:35
Speaker
And we were like, let's do more stuff together. And so I actually ended up working there for two years. And one of my jobs was to create the first semi-professional CTF team, so competitive cybersecurity teams. So I had seven people in the team plus me.
00:31:56
Speaker
who were basically paid one day a week to train and compete in public events to get the name of the company out and be like, it's also good employer branding because now students because it's played a lot by students. They realize, okay, this is a good team.
00:32:18
Speaker
I cannot want to play with them. They are good. I want to work there. And so we actually got a few candidates coming from that source and we were also paid to have fun and travel Europe. So it was very nice. Nice work if you can get it. Yeah. But yeah, okay. So that's almost getting into the like those sponsored e-sports teams. I don't think we're...
00:32:46
Speaker
It's a bit pessimistic, but we've been trying for years to have something that looks good visually for competitive technical competitions. It's very hard to do because video games or even maybe chess or Go or whatever competitive thing you can see online or on TV.
00:33:08
Speaker
It's very visual you can understand not really like with the deep level of analysis but understand who's winning and who's not and it's very active and you have like this action in competitive programming.
00:33:24
Speaker
The basically the thing you can have is watching, watching a screencast of the teams or the, or of the players, which is interesting. If you are into that and you can understand what they're doing, they're like, they'll be playing in, in other languages and stuff. So even people of my level, I can't really understand what they're doing. If they're coding in C plus plus, for example.
00:33:48
Speaker
And so basically the only thing you have left would be
00:33:55
Speaker
their leaderboard. So the leaderboard when once a problem is submitted or something, you see the update and you see, congrats, they move there. And that's basically it. But it's super boring to watch. Actually, there's a there's like one update per minute, especially at the end of the contest. So in the European Championships, the first, I think,
00:34:19
Speaker
More than half the problems more than half the submissions happen in the first hour and so the rest of the next four hours it's. The pace goes down and down and until like every team is basically stuff stuck so.
00:34:39
Speaker
we've tried to find ways to make this watchable and interesting, but yeah, we haven't cracked the code yet. And does have an idea, please get in touch and we're, we're going to be rich. But my solution is to let people gamble on it. If enough people gamble on it, then someone will figure out a way to televise it.
00:35:03
Speaker
Yeah, true. But there's like, there's one player you would always gamble on and you would always win. Really? Yeah, Gennady Korokiewicz is his nickname is tourists.
00:35:17
Speaker
And he's the best player in the world by far. Every contest he plays, he wins basically. He's won like six Google code jams in a row. I think he's won the world championships twice.
00:35:37
Speaker
the reason being he that you cannot play more than twice in the world finals so he won twice and the following year actually he went back and so he wasn't allowed to compete but he went back to stream the contest
00:35:57
Speaker
So I think he was a coach or something and so he live streamed himself Solving the contest with his two friends which are also very good and he made like much better performance than any of the teams And so this guy he's yeah, he's basically invincible in in competitive programming right also in so I I practice a lot on code forces, which I
00:36:23
Speaker
resembles a lot the set up of world championships and European championships. And usually you have like 10 to 20,000 people playing each contest. So there's like contests twice a week or something, which lasts two hours. And this guy, if he doesn't finish first,
00:36:48
Speaker
he will actually go down in ranking. So there's like kind of an ELO system. And if he finishes second out of 20,000 people, he will actually lose points. So that's how far up he is. Well, maybe now it has changed. I've not heard of him in a while, but
00:37:14
Speaker
Yeah, he's, he used to be excellent. I'm sure it's still the same today. Maybe he's retired. Yeah. Wow. So, I mean, it sounds like you're saying you're not going to get to that level any day soon or no one is, and I'm certainly not, but I do enjoy these kinds of coding puzzles.

Fast Problem-Solving Tips

00:37:34
Speaker
Have you got any tips for me to get from like, I can do, I can do them in the day too. I can knock them out quickly.
00:37:42
Speaker
So I have two things. One is if you want to get better at thinking of a solution fast and implementing that
00:37:55
Speaker
as quickly as you can. And the other tip would be on how to expand your horizons and broaden your knowledge to be able to solve more problems. So to do this kind of fast solving things and get better at speed coding would be Clash of Code, which is game mode on Coding Game. So again, I work for Coding Game and I've been a user, a happy user for six years now.
00:38:27
Speaker
And we have this format, which you have a room with eight people. It's eight real people. There's a lot of people playing, so you'll usually wait not more than like 30 seconds before the room fills up.
00:38:44
Speaker
there's people of every levels, we don't really match people with similar skill. And that's also to allow people to progress learning from people better than them. Okay. And so this you have
00:38:59
Speaker
a 15 minute problem. Usually if it's like a simple one, it usually takes not more than like two minutes for the best players to solve it. And yeah, you have a very simple, it's very much like advent of code.
00:39:17
Speaker
you can code in any language you want and the goal so we have three goals but mostly it's be the fastest we also have like more formats which is
00:39:29
Speaker
make the shortest code. So here you have actually to learn other languages. That's why I actually started learning Ruby a while ago, because Ruby is more efficient at code goal. So that's short code. And also we have one other mode, which is also fastest. So you need to do the fastest code, but you don't have the problem statement. You only have the test cases.
00:39:55
Speaker
So input and expected output. And you have to kind of guess what you need to do. So usually it's like processing numbers and finding like the right formula. Like you add A plus B and you multiply by C or something. But it also gets your brain going. But most of the time you'll find fastest problems. So a normal problem that you have to solve as fast as possible. And this is good to actually
00:40:22
Speaker
sets your brain in a mode that makes you think about a solution instantly as while you're parsing the problem, you're already getting the solution and you can start coding as fast as you can. And this is also very, very helpful for coding interviews. I've my story is always that I've played
00:40:49
Speaker
this is so clash of code on coding game for a week straight before my Google interviews. And then I asked them so I got the internship there.
00:40:59
Speaker
And yeah, this is so to really get good at speed coding and solving more simple problems. This is a very, very good way because also you can read after the after the 15 minutes ends, you can read your competitor's goals and you can often discuss we have a discord as well. It's a very open community. There's not a lot of actually like
00:41:27
Speaker
very strong competition. And oh, I hate my opponent and stuff. We're all friends in that world. And it's, it's actually not really competing. I should rather say playing. It's right. And so for for my second piece of advice to how to get better at actually more complex algorithms, but it also works actually for the more simple stuff. But what's the better players do to improve?
00:41:57
Speaker
is called up solving. So you play a contest. So usually it's on code forces, the more so we have a lot of others, but code forces, I think is the main one. You play a contest, it lasts two hours, you have six problems also. And usually you so it's in divisions. So if you're like, between that and that ranking, you will play in this range of problems. So actually, there's like,
00:42:25
Speaker
Per a competition, you have like 12 problems, but you only see six of them, depending on the kind of the window depends on where you are ranked, because you're not going to ask like world class player to solve the very easiest problem.
00:42:42
Speaker
And for the more beginner, we're only going to show them the easiest six problems. And it's usually more than enough to get you stuck. You already start a bit on more difficult problems. So usually you can solve like maybe three out of the six. And the thing is after the event, so you have read
00:43:05
Speaker
usually one or two problems above what you actually manage to do. And these two problems, you are going to read the solution. So it's usually published in the form of an editorial. So the author of the problem will publish just a few lines to explain the solution. You also have the code, but you don't really have to read it. The most important thing is
00:43:29
Speaker
read the solution, understand it, because it's much easier to read a solution than to come up with a solution to any given problem. And so what you do is you make sure you understand that, and then you go back to your editor, you code the solution as you understood it, and make sure that you manage to solve that. And so you submit after the event, and you check that your solution implemented was correct.
00:43:59
Speaker
and that means you learn something at that point and you learn how to go just a bit above your level and so by doing that over and over it will teach you a lot and a lot especially patterns that come back often and sometimes you see like okay there's a list I have to count whatever and you're like okay I know this is a permutation problem I know about
00:44:22
Speaker
permutation signatures or something that I didn't know about so they said that and that and it allows you to really Strengthen your skill sets in algorithms. Yeah. Yeah gradually like Continually just finding out where the edge of your personal knowledge envelope is and stepping me on that it seems to me those two tips kind of split into Like speed coding right it's kind of
00:44:50
Speaker
Tell me if you think this is true, but it's kind of the speed coding is only really useful for gaming job interviews, which in my opinion aren't great interview techniques for figuring out how good you'd actually be at the job. The other side, the second tip is actually going to expand your toolkit for programming in the real world.
00:45:10
Speaker
I'd say yes and no. First of all, because you are saying the only useful skill is the one I don't enjoy. I'm more of a speedcoder actually. I completely agree with the fact that it's an easy way to cheat coding interviews. I'm not a good developer, I'm aware of that. I would say I'm a great speedcoder, but I'm not a good developer in general.
00:45:39
Speaker
Yeah, because I can get any job I want if they only test for simple problem solving, which is 99% of interviews. But on the other hand, it's also playing competitive programming and speed coding especially, it's not useless in the way that
00:46:02
Speaker
It will teach you a lot of things about your own language and making you more comfortable with coding. So I, for example, I don't need to check any documentation for if, if I'm coding something in Python, all the buildings, I know them by heart, the arguments and stuff. So I don't need to go check that it makes also.
00:46:25
Speaker
more sense in my head like when I need to implement a function that does something pretty simple. I don't need to think really hard about it. I kind of know the best way to do that in terms of efficiency and stuff.

Coding as a Game

00:46:40
Speaker
But yeah, that's true that it's
00:46:44
Speaker
more like a game than any other thing. If you do that with the only intent to be a better programmer, I would say just do other stuff. Code your own side project. You're going to progress much faster.
00:47:01
Speaker
But if you like having fun, that's more like it. I don't consider that a way of really improving a lot compared to the time you spend on that. It's more of finding your boundaries and playing very hard stuff.
00:47:21
Speaker
basing your head for two hours on a given problem and then having it done on you in your sleep. It happens to me a lot. When I was practicing for the European Championships, I used to often dream about algorithm problems that I kind of made up in my head and
00:47:43
Speaker
During my my dream and in my dream. I was like, oh, this is a very hard problem It's very interesting and and I wake up and I'm like, oh no, the problem actually is interesting, but it's very easy to solve Yeah, it's it's pretty funny to You know fine find a way of a Game, I mean it's like playing sports. Actually. It's yeah if you want to be a pro in that there's like a
00:48:12
Speaker
100 people that are pro in that in the world, maybe, and that's it. But if you want just that for fun and to do something that you're good at already, well, that's a good thing. Yeah, yeah. Not every single thing in the universe has to be about productivity, right? Yes, exactly.
00:48:34
Speaker
Well, okay, that sounds, one other thing I was going to ask you, because, I mean, I found Advent of Code. I keep coming back to Advent of Code because that's my reference point for this. I found it a lot of fun. I'm okay at it. I'm not great, but I do it for fun. Sometimes I do it to like exercise a new language they want to learn.
00:48:54
Speaker
A lot of people will actually do that to learn a new language. You solve a few puzzles in that first to make that easier on yourself because coding like a several thousand line projects from scratch on a new language, it's going to be very painful and you are going to regret the choices you made at the very beginning and stuff.
00:49:18
Speaker
whereas you solve puzzles, your code is like 20 lines, you throw it away at the end. And when you throw it away once, you know, you get all the test cases passing, and you get better after that, but you're not like, haunted by the mistakes of the past. And when when you were starting to learn so, and that's also a good way to have like,
00:49:41
Speaker
atomic problems that you don't need like very specific stuff to do. So for example, if you're building a side project, you're going to spend most of the time trying to figure out, okay, I'm going to use like this framework. And so I need this to make the connections between my database and code and stuff. So it's mostly like configuration and figuring out which libraries are used and stuff. Whereas you solve simple puzzles and small competitions.
00:50:07
Speaker
you're gonna have only the distillate of that and you're gonna have pure code,
00:50:16
Speaker
Yeah, pure functional, I wouldn't say. It's a confusing term, but yeah, that's... Isolated into a specific... The nice thing about that too is side projects, they're almost infinite. If they go well, they keep growing. It's nice to have something that occasionally has a definite end. Yes. And I'm doing only that, basically. I have a...
00:50:38
Speaker
very few side projects actually but yeah when I'm bored or something I just I can just go on any website that I enjoy and say okay today I'm going to move up in ranking because also
00:50:51
Speaker
I enjoy solo playing, which is not truly competitive, which one, two examples. So coding game, we have that like a XP system, you solve a problem, you get like that amount of XP, and then you've got levels. One website that really has mastered this, I think is code wars, which you have like problems with KU. And so it's like belts that you move up. And so sometimes I'm like, yeah, I'm going to move like
00:51:21
Speaker
half a level up today. And so I set up my mind on a few problems that would allow me to do that. And just having this kind of satisfaction, and it really shows you, okay, now you are better than you were before coming here. And this is really satisfying as well. Yeah, that's my favorite kind of competition, competing with the version of me that didn't make the effort. True, yeah.
00:51:49
Speaker
Yeah, absolutely. So are those your top recommendations for where I should because the thing about Advent of Code, it's great, but it's only one month a year and it's the busiest month of the year, which is destroyed my Christmases once or twice. You can play the archive. You can play the archive.

Unique Features of Coding Game

00:52:09
Speaker
When do you go for the most fun?
00:52:11
Speaker
Oh, um, where I have the most fun. Well, I would say, um, coding game, but it's not a sponsored, uh, episode. Uh, I, I really enjoyed, um, the website and everything it has to offer. Um, especially clash of code, which is my favorite format of all the website. We have also, um, uh, very unique.
00:52:38
Speaker
formats, which is AI competition. So basically you have like board game, any kind of game, usually we
00:52:49
Speaker
take inspiration from actual board games or we just make our own. It's a small video game that's on the window on the left and you have to code an AI that drives itself and tries to win the game against another AI. And we have twice a year a big competition on that and we also have, if you want to solo practice, we have like a hundred of those
00:53:13
Speaker
If so, there's like chess, if you want to learn how a chess AI is made, you won't beat Stockfish, of course. But it's fun to learn how different kind of AIs work and stuff. So this is usually where I go for fun. And for more hardcore competitive programming, CodeForces would be my recommendation. The UI is
00:53:40
Speaker
Um, debatable. It's a bit weird, but, uh, yeah, it's, uh, it's the content is extremely good. Okay. I'm going to go and check them out. Been wanting to sharpen some of my gleam programming skills. So I might head there and I'm going to log in anonymously because I didn't want anyone listening to see my times. Yeah, that works.

Closing Remarks

00:54:04
Speaker
On that note, Matisse, thank you very much for joining us. Thank you for having me.
00:54:10
Speaker
Thank you, Matisse. I'll put links to all the sites that you mentioned into the show notes, so if you want to go and play with one of those coding challenge sites, that's the place to look. We've also got a few back episodes of this podcast covering new and interesting languages like Gleam and Kotlin and Gran and some others, so if you want a new language to pair with your new programming challenge site, that could be the right place to look.
00:54:34
Speaker
All we need now is a sommelier to choose the right wine to pair with them. That'd be awesome. Another day, perhaps. As ever, if you've enjoyed this episode, please take a moment to like and rate and share and subscribe. And while I'm thinking about it, someone told me yesterday that we weren't on Amazon podcasts, which I didn't know about, but we are now. I fixed it and we're there now. So this podcast should be available on all the platforms that you like.
00:55:00
Speaker
But if there's a favourite one that's missing, please do let me know. My contact details are always in the show notes. And with that, I think it's time for us to all run off and play. Until next week, I've been your host, Chris Jenkins. This has been Developer Voices with Matisse Amel. Thanks for listening.