Is Competitive Programming Helpful for Tech Interviews?

Can CP help you get your dream job?

Dhananjay Trivedi
Feb 26 · 4 min read
Photo by Kaleidico on Unsplash

In this piece, we will try to understand the importance of competetive programming (CP) and how it may or may not be helpful for your tech interview.

Competitive programming, for those of you who don’t know, is a type of mind-sport where you have to solve some programming problems with time and memory constraints and come up with an algorithm to do so.

It’s mostly about passing the test scenarios within the time and memory constraint — this sometimes requires you to think outside the box.

For example, there’s a problem — you read the problem, you understand it, you code it, you debug it and you finally successfully submit it. It might take you 10 minutes.

Meanwhile, some guy in the leaderboard has submitted the solution in 30 seconds. It’s simply because he was able to come up with a simple idea for the solution.

What makes some programmers so fast?

  • He didn’t have to go through the whole dataset making sure it's correct.
  • He didn’t need to get more clarity about the problem statement.
  • He didn’t have to think of edge cases.

With some simple, logical assumptions, he was able to come up with a simple solution, code it and submit it.

People don’t check your code in competitions, they want you to pass all the decided test scenarios.

Sometimes, for very complex problems, all the test cases can’t be predicted so the competition might miss a test case and you don’t have to worry about it.

That’s the beauty of competitive programming.

At the same time, competitive programming problems are harder than interview questions and they involve more advanced algorithms and data structures.

Photo by Nik MacMillan on Unsplash

In a coding interview, you can’t afford to assumptions. When you are given a coding problem in your interview, before you jump into actually coding it, you are expected to:

  • Ask good questions to get a better understanding of the problem.
  • Think of all the edge cases and be sure to cover them.
  • Be able to optimize your solution according to the specified requirements.
  • Write clean, solid code.

Coding interviews can ask questions that can’t be only solved by one computer, for example, parallel or distributed systems.

Interviews can also ask you to come up with some specialized algorithms for special cases — this might not be the best fit solution for a competitive programming problem but fits perfectly for the scenario of your interview.

Does Competitive Programming make Good Software Engineers?

Photo by Phil Hearing on Unsplash

Competitive programming helps sharpen your brain for programming and people at the top of the competitive programming domain are really smart. Also, some of their exceptional qualities like their maths and coding skills might be overkill for some SDE jobs.

But not all competitive programmers make good software engineers.

There are a lot of other skills that competitive programming doesn’t teach you (and yes, you’re supposed to learn them on your own).

For example:

  • The art of writing clean code.
  • S.O.L.I.D principles.
  • Asking the right questions around the problem statements.
  • Scalable system designs.

The above-mentioned skills don’t help in CP. If your goal is to become the god of CP, you don’t have to worry about acquiring these skills.

But if you see yourself as a software engineer, then these are must-have qualities.

Should You do CP or Not?

This depends on where you are in your career.

Yes. You should invest as much time as you can to do competitive programming. It’s one of the best investments you can make in yourself.

It will sharpen your brain and you’ll learn some really strong computer science fundamentals, which are essential in programming jobs.

The companies interviewing you right after college won’t really look for the above mentioned SDE qualities. You’ll learn these as you progress into your career — it’s a cherry on top if you can learn some of them.

You can use the CP contents to attract your potential employers and even win the good prize money. But you don’t have to win those contests to get a job offer from the big tech companies — you just have to be amongst the top performers to attract them.

Yes. You should at least practice one problem a day, to keep your programming mind sharpened. Working on projects doesn’t really push your brain and skills to the required extent. Over time you will lose your problem-solving abilities.

But you shouldn’t invest all your time and skills into competitive programming as you are already a professional. Invest time in upskilling your professional qualities as well.

CP will help you stay at the top of your problem-solving abilities and will give you the confidence to be interview-ready.

You can use the CP contests to get your next great job offer, earn some extra prize money.

Where Can You Practice Competitive Programming?

There are some popular coding competitions that you can practice and compete in:

  • Top Coder
  • Hackerrank (personal suggestion for beginners)
  • Codeforces
  • HackerEarth
  • Codechef
  • Leet Code
  • Google Codejam
  • Facebook hacker cup

I hope this has brought some value to you!

Have I missed anything? I would love to learn more from you.

Happy Hacking!

Better Programming

Advice for programmers.

Thanks to Zack Shapiro

Dhananjay Trivedi

Written by

Developer who loves to build beautiful apps and write great Medium stories to share what I have learned. Helping bring humanity back with Softway ♥️

Better Programming

Advice for programmers.

More From Medium

More from Better Programming

More from Better Programming

More from Better Programming

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade