Q&A with Gayle Laakmann McDowell on Acing Programming Interviews

Last week, the renowned Gayle Laakmann McDowell, author of Cracking the Coding Interview and CEO of CareerCup.com, live streamed a 1-hour Q&A session in honor of this weekend’s Women’s Cup, an all-female online hackathon. She offered a wide range of valuable insights on how to prepare for technical interviews. You can watch the full live stream on the HackerRank Live YouTube channel here.
Here are the top 12 highlights:

Q: Is it okay to use pseudocode in an interview?

Most interviewers are not okay with pseudocode–they really want to see real code. It’s a slippery slope. It’s one thing to say the candidate doesn’t have to write semicolons–but that’s not pseudocode. Candidates can start glossing over details that can be really important. Candidates can ignore what the datatype of the list is.

That said, when I say real code–I don’t necessarily care about every little detail. If you’re implementing a method on a binary search tree, you don’t need to write the whole node class. If you want to write pseudocode as an intermediate step before writing real code, that’s okay. Just be mindful of how long you’re taking to write that because it’s taking time away from your real interview.

Q: If you were to hire somebody, would you prefer someone who’s a fast-learner or someone with strong technical skills?

It depends on the role: How long am I hiring them for? How many resources do I have?

Personally, if I’m hiring at a larger company, my bias is almost always towards someone who’s very bright because that person will have good technical judgement even if they’re not as knowledgeable. If I’m hiring someone who’s going to be the first person to architect a system in a particular technology, I’m going to hire someone who is knowledgeable in that tech. Hopefully they’re also bright.

It’s why a lot of larger companies use algorithm interviews. They have the resources to train people, so they want to hire people who are bright.

Q: How can I be great at competitive programming? How can I improve?

There are two segments to competitive programming:

  1. Problem-solving
  2. Knowledge

Interviews usually focus on #1 and competitive programming focuses on #2. So, as far as knowledge goes, know your algorithms really well. Know more obscure things. Pick up algorithms book. Know your different data structures.

With problem-solving side, it overlaps with interviewing. Practice a lot. Get used to the habit of not knowing how to solve a problem and getting past it. One of my favorite techniques for solving a problem that you don’t know how to do is really rely on examples.

There’s a technique what I call is “do-it-yourself.”

Give yourself a large, complex example–something that your brain can’t immediately see the answer to–and solve it manually. You’ll find that your brain has great intuition on how to solve a problem rather than just solving it rather than guessing. Reverse-engineer your thought process and think about what you did to find these pairs or matrix, etc.

Q: What’s the best way to deal with interview pressure?

The more practice you get, the less likely you are to be nervous. Practice with mock interviews. Also, grab a buddy and take turns being on the other side of the interview. Practice interviewing and you’ll find that a lot of what you thought the interviewer was doing to intimidate you or throw you off is just how interviewers naturally act.

During the actual interview, the way that you think you’re doing has no correlation to actual performance. People think they did well but do poorly. Or vice versa. I’ve seen this all the time. The reason of this is because when I’m evaluating you, I’m not evaluating you on whether or not you got the question right. I’m evaluating you compared to other people.

So, you might struggle on a question, but others are struggling too. You can’t say that you’re doing poorly because you don’t know if someone else is doing worse than you.  

Q: Do you think algorithmic questions are effective?

Great question, it’s one I get a lot. They’re pretty good at determining intelligence. I’ve seen over and over again that when you throw a smart person a problem, they tend to show really good judgement. That assumes they have some baseline of knowledge, which algorithm interviews assess.

I do think they have their flaws, which is true about every interview process. Realize they all have their problems.

One of the most important factors in how successful someone will be is to work hard and focus on their work and working with other people. Work ethic is really hard to interview for regardless. We do the best we can but no interview process will be perfect.

Q: What’s your favorite interview question?

Great question. I usually rotate after I get bored of one. Currently my favorite question is:

You have 2 string, one smaller, one larger…write an algorithm to figure out how many permutations of the smaller string exist in the bigger string.

It has a lot of different steps to it. There’s a lot of ways to tackle it. Everyone can find a solution to it. If you can’t find any solution to it, I’m pretty sure I wouldn’t hire you.

Then, there are many other steps. There’s a brute force solution most people come up with off the bat. There’s major optimization you can make and then there are several other optimizations you can make down the road. I don’t like interview questions that rely on one key insight or have one hard part to the problem. You might have gotten lucky with that hard part of the problem, so it’s not consistent. I like things with a lot of other hurdles.

It also doesn’t rely on a whole lot of knowledge. No one I’ve interviewed lacked the knowledge to tackle the problem.

Q: What was the biggest turning point in your programming life?

There were two moments for me:

1. I got an internship at Microsoft as one of the youngest interns (I was 18 at the time). It was a huge moment for me. When you have a job at a prestigious company, it opens up a lot more opportunities down the road. That was really big.

2. The other side of that: Leaving Google. I spent about 3 years there. It took me a while to say ‘This isn’t what I want to do.” Part of it was that I had equity in the company, which in retrospect wasn’t much. But it seemed significant at the time. It took me a while to say no. This was in 2008. So, not many people had left Google and it was still the company to join. It was hard for me to turn my back on that.

I didn’t want to be a programmer all day everyday, I wanted to do something more. I love programming, it was a good company and all but I wanted to pursue my entrepreneurial passion.

Q: How should I prepare for Big O questions?

Most common questions you’ll see will be: You design a new algorithm and you have to state the runtime of that algorithm. First of all, practice is a really useful thing. But one thing I’d be careful of is recognizing that variables have meanings. When you say inserting into a binary search tree is Log n, it’s not inherently Log n. It’s log of the number of nodes.

If you call the number of nodes “n” then yes, it’s Log n. But you could also say “n” is the depth of the tree. So you need to be specific and careful about what your variables are and what they mean. I’ve seen this mistake a lot. Be very careful of your variables. You’re better off not using “n” as a variable name at all. Instead, use logical variable names.

Also, be cautious of when you multiply and when you add. So, when you have two different steps of an algorithm and you do one thing and you’re all done. And then you do another thing, that’s an addition. When you walk through something and say every time you do this, you do that, that’s multiplying. That’s another mistake people make a lot.

Q: What’s the difference in interviewing process between Google and Facebook?

The interview process is far, far more similar than they are different. Yes, there are some differences, but they’re largely the same.

The first difference is that Facebook is usually more structured. People have a clearly defined role. E.g. for software engineer, you have an algorithm interview, design interview and culture fit/coding interview. It’s well-defined. Interviewee knows what they’re walking into.

The other difference is that Google tends to be more generalist in their hiring philosophy; Facebook has a little bit more recognition of specialties. At Google, there’s more of a tendency to hold a front end developer to the same expectations as a back end developer. Whereas Facebook is more likely to recognize: “Hey, you’re a front end developer, we really want that skill-set. We might lower the expectation for some of the more generalist algorithms.” Ultimately, you don’t have to know much less, but when comparing you to other people, they don’t expect quite as much.

Again, they’re more similar than different.

Q: Is there any interview advice you’d give women and not men?

The advice I’d give to a man is typically the same that I’d give to a woman. There are some small differences. I’ve seen more women than men be particularly nervous in interviews. And be less willing to advocate for themselves. That’s one thing I often push on women than man. It’s okay to be clear about your accomplishments. I’ve seen a lot of women are nervous about attributing their accomplishments to themselves and they’re quick to giving credit to their team. Don’t take credit for your team’s stuff, but don’t give credit for what you did.

Be aware that you shouldn’t be talking about “we the team” constantly. Attribute to yourself. That’s advice that goes to both women and men, but I’ve seen this problem more in women. I’ve had women be worried about coming off as arrogant. I haven’t seen as many women that have come off arrogant as men.

Q: What skills do you need to land a job at top tech companies, like Google?

There are two parts to this:

1. Prove to the recruiter that you have the right skills.

2. Prove to the recruiter that you can pass their interview.

If you have the right experience to do well in the job and in the interview because ultimately if your resume looks great, but you can’t pass the interview, then I won’t interview you. The best thing you can do is develop a lot of projects. Have a project on your resume. Do a lot of coding. Learn a lot of programming languages. Don’t get tied to one programming language. It can actually be a little bit of a red flag for some people.

If the candidate’s all about Java, people tend to have a bad vibe from that. Identify yourself as a great software developer, and not someone who’s just great at one programming language.

The other side of the equation is demonstrating that you can do well in an interview. Demonstrate that by showing that you know algorithms and data structures. One way to do that is with a computer science degree. If you don’t have a CS degree, show that your’e taking classes on Coursera or doing things like taking coding challenges on HackerRank. Those are actually really effective.

When I’ve reviewed people who have done coding challenges like that, I put them in the “yes” pile because I know that they are interested in algorithm challenges, which is often a good sign that they’re knowledgeable about algorithms. It’s worth giving them a chance to interview.

Q: What’s the best Github project to get noticed?

I get this question a lot. The best thing to do is just do projects. People worry about little details but what really matters is that you’re doing something. If its open source, great. If it’s your own iPhone app, great. If it’s web app, great. An individual team or company might want one thing more than another. For the most part, it doesn’t matter that much. The most important thing is you’re coding

That being said, open source has its advantages: You can what it’s like to work in a large code base. But it’s hard to attribute what exactly you did. Whereas if it’s your own iPhone app, it’s clear what you did.  Above all, pick something you’re excited about so you’ll enjoy it more….because what matters is that doing something.

Q&A with Ben Pfaff, VMware’s Principal Engineer & Open vSwitch Leader

If you’ve ever wondered what it’s really like to work at VMware, the trailblazer of network virtualization, you don’t want to miss this. On Monday June 22nd, 1 PM PST, VMware’s Principal Engineer Ben Pfaff will be live coding the solution to the unique coding challenge he created: Mac Learning. Best of all, you can ask questions and interact with him directly on VMware’s new Company Page (kind of like an AMA!).

The real-time event will happen here.

VMware’s team is working on transformative technology in Virtual Storage or the Virtual Network, among other specialties. As the first company to launch HackerRank’s new Company Pages, VMware is redefining what it means to engage with software engineers by offering a glimpse into their innovative culture.

Who is Ben Pfaff? 

Pfaff is an accomplished and experienced visionary who has most recently been working on VMware’s NSX network virtualization product, and specifically on the Open vSwitch data plane component. Before Nicira, he received his Ph.D. in computer science from Stanford in 2007 and a B.S. in electrical engineering from Michigan State University in 2001. He’s been a Debian developer since 1996 and a developer and maintainer of GNU PSPP since 1995. We had a chance to sit down and pick his brain:

1. You have quite a few achievements under your belt. What’s your biggest accomplishment thus far?

I’m proud of a lot of my work but two things stand out in my mind. The first is how we’ve managed to build up such a community around Open vSwitch. It started out as just a single-company project (as most open source projects do) but it was never our intent to keep it that way, and we’ve steadily increased collaboration over time so that it looks like in 2015 about 1/3 of the new contributions will come from outside VMware.

The second is a project from my grad student days, an educational operating system named Pintos. I built Pintos to teach undergrads about the internals of operating systems, and I put a lot of thought and care into it, and the results have been really good. Stanford is still using it, even years after I left, and several other universities have used it too.

2. What’s the most fascinating network virtualization development you’ve seen over the past 6 years?

I’m really amazed at how network virtualization has taken over the world. I’m most excited about OVN, the open source network virtualization system we’re working on.

Editor’s note: OVN is a new project from the Open vSwitch team to support virtual network abstraction. OVN will put users in control over cloud network resources, by allowing users to connect groups of VMs or containers into private L2 and L3 networks, quickly, programmatically, and without the need to provision VLANs or other physical network resources]

3. What advice would you give to developers who want to work at VMware?

VMware has such a diverse range of software products that they hire a really diverse collection of developers, from people who know the very lowest levels of desktop and server computers up to app developers. I think that there’s a place at VMware for any developer who’s really passionate about whatever their area of strength is. I tend to encourage students and other new developers to figure out what they’re most interested in and then go really deep in that area. Picking a free software or open source project to start or to contribute to is my favorite way to suggest that someone looking to deepen their knowledge in an area go about it.


4. What do you love to geek out about outside of work?

I used to be a fencer, years ago, but today I’m a cyclist. I commute by bike 45 minutes in each direction every day. I like to stick an earphone in one ear and listen to podcasts on the way. I have a wife and a daughter and I spend a lot of time with them. I’m also into learning about other cultures, and like to do that by hosting foreign exchange students.We had a student from Bosnia for about 18 months, who fit us so well that she feels like part of our family (we’re going to Sarajevo to see her and her family for a couple of weeks this August) and we’ll probably get a student from Germany for the 2015-16 school year.

5. Why do you choose to work at VMware?

I was one of the first employees at Nicira Networks back in 2007, where we came up with what became OpenFlow and Open vSwitch and NSX. In 2012, VMware acquired Nicira. I’ve been at VMware since then. It’s a pleasant place to be: good people, beautiful campus (fantastic cafeteria!), and most of all some exciting problems to solve. 

Watch & learn from Ben Pfaff’s real-time coding session on Monday June 22nd, 1 PM PST! 

Livestream Recap: SnapDragon Shares Pearls of Programming Wisdom

On May 31st, the legendary, wise and experienced Derek Kisman (aka SnapDragon) graciously answered dozens upon dozens of questions posted by passionate hackers via HackerRank Live for 6 hours! What’s more, he did the entire live cast and coding on his Microsoft Surface Pro!

Some call him the mythical man. With over 20 years of programming experience, and a reputation as a self-taught award-winning top coder for many years, SnapDragon revealed insight into solving the toughest challenges from both ICPC 2014 and ZenHacks! SnapDragon has been a judge several times for the prestigious intercollegiate coding competition. Plus, he ranked #2 in the recent ZenHacks competition. Many of you live streamers requested a link to his solutions. As promised, here it is!

SnapDragon also talked about general programming advice for coders who want to get better at their programming skills. Hundreds of folks tuned in at a time, and his livestream video recording has garnered over 6,000 views to date!

We had a chance to catch up with SnapDragon to talk about the highlights of the event. Here are just a few pearls of wisdom from legendary SnapDragon.

Let’s get right to it! What’s your advice on solving the infamous ‘G’ problem from ICPC-2014?

Only 1 team was able to solve it. Teams shouldn’t be afraid to think about a problem just because they don’t see other teams solving it. G isn’t very difficult by comparison to the so-called “stoppers” of previous years. (It has a very short solution). [4:30].

Top 5 tips for ranking at the top of the ZenHack leaderboard:

1. You don’t have to reproduce the judge’s intended solution, you just need a successful submission.

2. For Composite Numbers, I didn’t know about the Lehmer method for computing pi(n), so I just went nuts optimizing a dumber solution.

3. For Efficient Journey, I didn’t quite figure out that much of the path ended up constant, but I got close enough using an O(log N) skip list.

4. For Introduction to Algebra 2, I just proved what little I could, brute-forced a few more examples, then submitted and hoped I was done. And it worked.

5. For Travel Trouble, I ran out of contest time and couldn’t implement the O(N^2) solution… but O(N^3) with some clever heuristics squeaked by.

Your favorite question that someone asked you during the live event?

When someone asked about solving the Rubik’s Cube. 🙂 I tried to explain a nice trick for solving Rubik’s Cube based on group theory conjugation (like this one).

Advice on programming interviews:

You wouldn’t believe how many people we interview who just can’t code. If you go through HackerRank, you have to be able to think through problems, which is what companies want to see!

On creating a Mental Model when approaching problems:

I don’t think my mental model has much to do with what language I’m coding in. Granted, I’m always working in C++, but my mental model is basically mathematics, not programming. So, when I’m looking at a problem, I’m thinking: What does that look like mathematically? Then, programming is the art of transforming your mental model into something in a text file in a way that maps it as closely as possible.

SnapDragon (1)

What does it take to be a world champion coder?

Math is really important. But you don’t need to be a world champion in math to be a world champion at programming. I’m sort of the example of that. “Calculus isn’t TOO important in programming contests, but you need the basics. Like integrals.”

What’s the best strategy to practice and learn?

I don’t think I ever picked particular algorithms and studied them. Back when I was on Unviersity of Waterloo ACM team, we’d practice regional problems. We’d spend 4-5 hours and pretend it was an actual contest. Afterward, we’d figure out where our deficiencies are. Was it a new algorithm? Was it bugs? Sometimes there’s a sentence in the problem that you missed.

Is competitive programming necessary to crack companies’ coding interviews?

It does seem like companies like to ask algorithm-style questions in interviews. I’ve never seen questions that approach the complexity of some of these later ACM challenges. Because, companies aren’t really trying to see whether or not you’re an algorithm master. They want to see how you think. They give you problems that are hard enough so they can hear your thoughts as you solve it. Going through HackerRank problems is a really good way to prepare for interviews for companies like Zenefits and Google. You wouldn’t believe how many people come in for interviews who just can’t code. They can’t write a program, compile it and run it.

So, if you practice on HackerRank a lot, you’ll do really well in all those standard interview questions. You won’t need to memorize a list of questions beforehand…you’ll be able to think on the fly. They’re easier than the hard challenges you’ll find on HackerRank or elsewhere.

On Dynamic Programming:

The problem with Dynamic Programming is that it’s not just a single algorithm…it’s a concept. I learned DP a lot from experience. It’s more of a generalized approach to searching. It’s the sort of thing you have to pick up by experience. The experience is being able to recognize these states can look like. You need these to be not an exponential number. You need them to be as small as you can get them. (36:43).

On Network Flow:

Most programming contests seem to have Network Flow these days. It tends to be considered a hard problem. It’s sort of cheating in that you have an exponential search. Your path is important and you have to remember your path at all times, but you can erase it. (38:50).

How did competitive programming help you solve the logic puzzle that was unsolved for 30 years?

There was a puzzle called Panex for which the shortest known solution was something like 30,000 moves. For 30 years, it wasn’t proven. I was able to come in and apply a very hard, very advanced form of dynamic programming to solve it — to actually prove that the min was 30,000.

Favorite book recommendation for math?

  • Godel Escher Bach (thinking about the world as a computer scientist)
  • Martin Gardner’s articles in Scientific American

Watch the full live Q&A video here.

Exclusive Q&A with World-Renowned Coder SnapDragon

Derek Kisman is among the most accomplished and experienced competitive coders around. Growing up in Canada, Calgary, he’s a self-taught competitive coder who started coding when most of us play with legos!

In the 80s, while schools were still trying to figure out how to teach computer science in schools, Kisman was drawn to coding and competitions purely out of personal determination and passion. Because of a lack of accessibility in Canada to international contests during his high school years, Kisman’s very first programming contest was the tryouts  the ACM team at his alma mater, University of Waterloo. The limited access to competitive coding resourced didn’t stop Kisman from constantly pushing himself. In fact, he actually had to write his own challenges because there weren’t enough coding challenges out there!

Through intense dedication and thousands of hours of practice, Kisman consistently ranked as a top coder for several years, among many other accolades. Little did he know he would now be serving as a judge at the prestigious ACM International Collegiate Programming Contest (ICPC)!

Today, Kisman is still a strong coder and competitor. Most recently, he won second place at the CodeSprint ZenHacks (or hackathon) sponsored by the fast-growing startup Zenefits. Today, Kisman works as a developer at Zenefits!

We are very excited to announce our second live streaming 6-hour Live Q&A event in which Kisman discusses tackling the toughest challenges featured at ACM-ICPC 2015 in addition to some HackerRank challenges. Just about 3,000 passionate coder are going to be tuning in! Are you? In the meantime, here’s the exclusive interview with SnapDragon:

acm
Source: KupasKode

When did you start coding and how did you learn?

 

I started coding around age 5 or 6 on a TI-99/4a.  We upgraded it to 16 kilobytes of memory so it could run Logo. 🙂  So I’ve been programming most of my life and I’m mostly self-taught.  In university, of course, I spent a LOT of time practicing algorithm contests.

When was your first programming contest?

Canada was just entering the IOI when I graduated, so I didn’t have the chance to try out for it.  My first contest was a qualifier for the ACM team in my first year at Waterloo.  I didn’t really know what I was doing, but I made it onto a team … just barely!

 

How did you become such a skilled competitive programmer?

Lots and lots of practice.  Having a solid math background helped too, but mostly it was spending thousands of hours just solving ACM Regionals problems UVA problems (which was basically the only online judge portal back then). Our coach, Gordon Cormack, would spend a lot of time setting up the practices and discussing solutions with us afterwards.

What was the biggest hurdle on your road to where you are today?

Getting old, I guess?  I haven’t faced too many hurdles. I got pretty steadily better for a long time, until I peaked in the early TopCoder years.  Since then I’ve spent a lot less time practicing and I’ve gotten a little slower.

 

What is the technology & programming scene like where you grew up?

Growing up in Calgary, there was a school programming event every year where kids would go to show off their projects.  I entered every year and I almost always bit off more than I could chew with my projects. 🙂  When I went to the University of Waterloo is when my contest training really started.  Waterloo is very strong in the ACM scene, and there were a lot of motivated people there to learn and discuss problems with.

 

What do you think is the biggest mistake competitive programmers make?

 

 

Snapdragonquote_3

Probably getting discouraged and not practicing enough.  Or practicing only on problems they feel they’re good at.  I’ve always thought it was important to be able to tackle any problem that comes my way. So, I specifically practiced areas (like Geometry) that I was weak at.  Even when I do come across a problem I can’t solve, I try to look for what I’m missing and imagine how I would have solved it on a better day.

 

How often do you practice programming on any given day & weekend?

These days I don’t practice much.  It probably averages out to a couple hours a week, mostly helping out with test solving contests.  So I’m not as good as I used to be!  Back in my serious years, I would solve multiple 5-hour contests a week, plus many hundreds of problems on the side.  Good thing I enjoy algorithm contests so much…

 

What language is by far the best, most useful in 2015?

 

Snapdragonquote_2 (1)

 

Sadly, probably Javascript, though it’s a mess of a language.  I still use C++ (which will never truly go out of style), but I’m a bit of a dinosaur.  Python and C# do seem to be the “cool” languages today.  Fortunately, if you know one language it’s usually pretty easy to pick up and move to another.  You’ll already have a good mental model of what’s going on behind the code.

 

What language is by far the least useful?

I have a soft spot for languages specifically designed to be useless, like Brainfuck and Intercal. 🙂  In terms of real languages… well, I’ve always hated Java.  It’s slow and makes a lot of common operations annoying.  I can’t really say it’s “useless,” though, since a lot of companies still use it.

 

What factors do you believe help you win?

Experience. So many of the algorithm problems out there are just plain similar to ones I’ve solved in the past.  (It’s really, really hard to come up with truly unique problems).  Coding something for the 5th time is always going to be faster than coding it for the 1st.  The other key skill is to learn to write code elegantly and cleanly.  Ideally the code should map very simply to your mental model of the algorithm, making comments almost unnecessary and ensuring that any bugs and special cases stand out.  Since programming contests are typically extremely strict (running your code on secret data and giving you nothing but a “pass” or “fail”), it’s important that your code be nearly bug-free when you first write it.  If you can comprehend your entire program just by glancing over it, it’s much more likely to be correct.

 

Why do you choose to compete on HackerRank?

SnapDragon (1)

 

I came for ZenHacks and stayed because I really like the interface.  Out of all the sites I’ve competed on, I think HackerRank does the best job of “gamifying” programming.  Solving a task, getting that little checkmark and progress towards a badge… it’s pretty addictive! 🙂

How Mimino Solved 78 Project Euler Problems in Under 24 Hours

Last weekend, HackerRank hosted its 1st live streaming event in which Michal Danilak, more famously known as Mimino, achieved a herculean feat. Mimino solved ALL 78 Project Euler challenges in under 24 hours, at a rate of about 18 minutes per problem!

Although C++ is his best language, Mimino used at least 13 languages altogether. In fact, he learned several different languages on the spot, like parts of Bash and PHP. Here’s a breakdown of which languages he used by frequency. The graph doesn’t include Python 2 & 3 as separate languages:

Untitled Infographic

The well over 8,500 passionate folks who tuned into the live stream throughout the 24 hour event were in some grand company. The legendary world’s highest ranked competitive coder Petr Mitrichev joined the live chat to commend Mimino on this awesome undertaking and even guided Mimino through a roadblock! He said: “I’d check for int overflows, your output starts breaking around 2**16.”

Michal Forišek, Gaoyuan Chen, even the problem writers and administrators from Project Euler all joined the lively conversation to offer tips and well wishes to Mimino. The superstar of the day even live chatted with the community directly, answering questions about his approach.

Petr Mitrichev

Watching Mimino tackle all 78 problems was awe-inducing to the say the least. No matter how many times he was stuck, down to the 24th hour, Mimino never seemed too frustrated or even close to giving up. It was the perfect place for a dose of inspiration, evident by some amazing comments from community members:

  • “Mimino doesn’t sleep, he’s the real Batman!” one community member said.
  • “After seeing him code, there’s only one conclusion from it. Nothing is impossible and if you’re truly dedicated to coding. Even time cannot stop you from coding.”
  • “I have only heard about programming prodigies. Today, I’ve seen one. Hats off. Congrats on your achievement!”

We had a chance to catch up with Mimino after the event. Check out what he had to say about the event:

Mimino, how do you feel after coding live for 24 hours straight?!

I feel awesome! During those 24 hours I have received so much positive energy from the people who were watching, chatting and motivating me. It was great to see so many people excited about the competitive programming and problem solving.

How did you feel when some of the world’s greatest coders joined the live chat?

When Petr Mitrichev showed up, I was just struggling to find a nasty integer overflow bug in my code at the time. Right after he joined, he was the first one to discover it and let me know about it, so it really shows who is the best in this game.

But knowing that he is watching me now, I felt under much more pressure. But then, when he said that the event like this is a great idea, it gave me the boost for the next couple of hours. It was great to see the best of the best to stop by and cheer for me.

11166049_10200518079470376_1740731366_n

What impact do you think this feat have on you and the programming field in general?

In the Q&A interview before the event, we were talking about the recognition for top competitive programmers, and I said that the current format of the events doesn’t really support people to have fans.

What I think this event did successfully was to show that there is a big potential in this area. We saw that people can get excited about the competitive programming and competitive programmers. And we also showed that events like this can be not only educational but also entertaining. I do believe that 24-hour programming challenge was in this sense a successful proof of concept and I feel glad that I was part of it.

Some commentators wondered if you are human. What motivated you throughout?

As I have already answered on Quora, every time someone compared me to batman or terminator, I just couldn’t ruin that image by having a rest 🙂

Which were the toughest challenges for you and how did you overcome them?

I think my biggest crisis came around 6 a.m. (21 hours into the challenge) when I opened the problem #64 with continued fractions and then the problem #66 with Diophantine equation, which solution is again based on the continued fractions.

I just couldn’t get my head around how continued fractions work at that hour, so I was just blindly trying to imitate the method shown in the problem statement. My solution was really just “fake it until you make it” type of solution. But then again, I have demonstrated a couple of times during the event that I’m able to solve the problem, even though I have no idea what I’m doing.  😀

Please tell us your top 3 tips & tricks that helped you achieve this feat!

These are the main tricks and takeaways that I demonstrated throughout the event also with the representative problems for each trick:

1. Choose the right programming language for the right problem

– for speed choose C++
Challenge 60
Challenge 68

– for fast big integer arithmetic choose Java
Challenge 48

– for simplicity choose Python
Challenge 34
Challenge 56

2. Look for the patterns in the answers and then exploit them

Challenge 39
Challenge 50

3. Precompute everything you can. This is the biggest speed optimization you can get. Once you have the answers precomputed, outputting them has time complexity O(1)

– precompute the answers locally

Challenge 12
Challenge 30
Challenge 32
Challenge 33

– precompute the answers before solving the individual test cases

Challenge 10

 

If you missed out, don’t worry. Here are the links to the full video!

Part 1 
Part 2
Part 3

 

Exclusive Q&A with Mimino: Inside the Mind of Pro Competitive Coder

As a finalist in many top programming competitions and expert with 10+ years of experience, Michal Danilak–or better known as Mimino–will be coding away at HackerRank’s 24 Hour Live Coding with Mimino event on Saturday, April 25th. It’s a unique opportunity to learn different techniques used in programming competitions from a professional competitive programmer. Over 1,000 programmers in our community signed up for the event within 24 hours!

If you’re passionate about coding, sign up for the Facebook event here to ensure that you don’t miss it. In excitement for the event, we sat down with Mimino to give you a taste of his road to competitive programming. But, before we dive right into the interview, let’s clarify what to expect out of this live coding event:

What is the 24 Hour Live Coding event about?

Live programming is a relatively new phenomenon in which experienced coders interactively show other coders how they arrive to programming solutions in real-time through YouTube’s streaming channel. Mimino will solve 75+ Project Euler challenges on the HackerRank platform in a 24-hour session. This will be streamed live on YouTube on April 25th starting 9 AM CEST.

Project Euler is a series of programming challenges that require both mathematics and programming elements to solve. All of the Mimino’s source code will be available to the viewers on Github during the event only. Follow us on Twitter and like us on Facebook to get real-time updates on the live coding event. Mimino aims to not only solve all Project Euler challenges, but also to answer any questions you have to help you better understand the approaches to solve the problems.

Why join the 3,000+ coders streaming the event?

The goal of this event is for Mimino to show you the optimal approach to solving programming challenges. You can comment on what he’s doing and he will answer any questions you have that are related to problems, algorithms and programming competitions. It’s a unique opportunity to learn programming from a pro! Bonus perk: We have a special surprise up our sleeve related to the challenges that Mimino will solve! Stay tuned.

Now, let’s get dive in and get inside the mind of a top competitive programmer!

5080632838_0d347ccbb6_b

Q&A with Mimino

1. When did you start with programming?
My first programming experience was with Visual Basic, when I was 13 years old. I wanted to learn how to create computer games. Later, when I was 15, I started to learn C++ and at 16 I was introduced to the world of programming competitions.

2. What was your first programming competition and what inspired you to compete?

My first programming contest was Correspondence Seminar in Programming, which is a Slovakian contest for high school students organized by the same people that are behind the famous IPSC contest. I did it when I was 16.

There was no real inspiration to compete. My teacher just asked me if I wanted to do it, because I was the only one in our class who knew how to program and I said “yes.” Now that I think about it, that simple “yes” had a really huge impact on my life 🙂

3. What motivates you to compete?

Combination of curiosity, excitement and feeling of accomplishment. But I think these things really come up from being a part of community where we push and help each other for the higher limits.

4. What have been your achievements so far in competitive programming?

During high school, it was the 1st place in Slovak national olympiad and silver medal on International olympiad in informatics. Since then, I was lucky enough to advance to the finals of the world’s biggest programming competitions, including Google Code Jam, ACM ICPC, Yandex Cup and many others.

5. How important is math for competitive programming?

Every superstar coder has a really strong mathematical background. Most of them have probably also been on IMO once or twice. I believe it is a must-have a for a world-class competitive programmer.

Untitled Infographic (20)

6. What programming language do you use and why?

For programming competitions it is definitely C++. For real work I try to stay from C++ as far as possible and use Python instead. The main advantages of C++ in programming competitions are:

  • It is always a supported language
  • All the important data structures (binary tree, heap, stack, queue, etc.) are part of the standard library
  • Performance

The main advantages of Python in real life are:

  • Expressiveness of the language
  • There is a library for pretty much anything
  • Portability

And the greatest advantage of all for Python is that you have a direct access to the source code of all Python libraries, which you can study and play with really easily. For me it is the greatest source of real-life programming knowledge.

7. How many hours a day do you normally code? Do you still train?

I don’t train anymore, but I do program 10+ hours per day, mostly work related stuff. My biggest improvements were during university, when I was motivated enough to practice 12+ hours per day.

8. What do you think is the biggest mistake competitive programmers make?

People very often mistake programming competitions for the measure of being a great programmer in general. The truth is that neither one implies the other.

Untitled Infographic (12)

9. What’s the biggest hurdle you faced in competitive programming and how did you overcome it?

I think the most critical phase, where most people give up, is going from zero to the first success. For me, the first success was winning the Slovakian national olympiad in informatics. Since then I just enjoy the constant marathon of programming competitions and I’m always ready for the next challenge. Until then I was in doubt if I’m good enough and was probably ready to quit.

Untitled Infographic (19)

What really helped me to overcome this critical phase was the power of friends and community around the competitive programming. I cannot stress it enough how important it is not to be alone in this.

10. Is it possible to do great in competitive programming by only using resources available on Internet or in books and without any trainers?

I learned everything from either Internet or books. Community around me is the source of motivation, but the knowledge is out there for free and available for everyone. On the other hand, there are many Russian super-coders that had Andrew Stankevich as a trainer at one point. You can literally see on their rating graphs the exact moment when they started to train with him and went from mediocre rating to top-20 worldwide in a matter of months. So there is definitely a great value in having the right trainer.

mimino

11. What advice do you have for other competitive programmers?

Minimize the time until your first success. How? Either work harder or lower your standards for “success.” After that, the work transforms to fun, pain to joy and you will be less prone to give up.

12. Do you train other people?

I don’t train people on a regular basis. I love to help if someone asks me, I help to organize competitions and I write tutorials and answer competition-related questions on Quora.

13. Do you think the top competitive programmers in the world should have more recognition?

I think the current format of programming competitions does not really support people to have fans. Most competitions are done through the Internet with only the name of the competitor available to the outside world. There are only a couple of onsite competitions, but most of them has very restricted access to the competition site. And PR for the competitions is mostly non-existent. So if people do have fans, those are probably just some other competitors. I personally am a fan of some big names in the game.

14. Why did you decide to live stream yourself for the community?

Untitled Infographic (15)

As the title of this article suggests, I would like to show people what’s inside the mind of the competitive programmer. I would like to show people what it looks like to solve the problems in a matter of minutes, when some people spend hours on solving the same problems. I would like to answer the question – what do we do differently?

By doing a live stream, you will be able to see exactly what I do when solving the problems.

How much time do I spend on reading the problem statement, thinking about the solution, implementing the solution and testing? How often do I debug? How do I debug? Which programming language do I choose for which problems and why? What tools do I use?

So to answer the question, I decided to do a live stream to teach people interested in competitive programming in a way that hasn’t been tried before and has a huge potential. I really hope that this event will open the door for more live streams in the future coming from even more experienced programmers than myself. I would definitely love to watch them.

15. Why HackerRank?

I chose HackerRank because of their willingness to try new things in the area of competitive programming. I couldn’t think of a better partner for this feat.