Friday 27 March 2020

How to start with Competitive Programming?

So you want to start with Competitive Programming? Good, you’re at the right place :)

The following are the steps to help you get started.

Pick a language

Language is the most crucial thing for communicating ideas. An ideal language should be the one that can help you pass the time and space constraints. Python may not be the ideal solution here. Sure it involves a lot of built-in functions but one cannot deny it increases your time of execution putting an impact on CPU memory since it uses an interpreter for line by line execution.

So what to choose? As you can see below is a clear comparison between codes written in .py and .cpp. Surely it depends on the programmer’s ability to shorten code but not too much to create such a big difference. 

2 of the best programming languages known for competitive programming are C and C++. We would recommend C++ here. Both of them take less time of execution than Python but one cannot deny how C++ STL makes your life easier.

Start with Basic Problems

Start your journey by solving basic problems like how to find a prime number, the number of factors of a number, factorial of a number, find greatest/lowest among array, insert an integer into an array, string operations using ASCII values, the sum of the digits of a number, etc. You can find a bunch of such problems on SPOJ.

You might not realize the worth of solving these problems but practicing these more frequently could help you shorten the code than earlier which you used to right and help you save time. Additionally, you will learn how to write error-free code.

Learn Data Structures and Algorithms

Data Structures and Algorithms are going to be your biggest friends if you choose to make them! Not only in your Competitive Programming journey but also in your Placement Interviews.

And it’s super fun to learn them. Once you dive into it, you’ll enjoy the essence. You’ll be amazed at the scope of DSA usage from Google’s fastest search to quickest commute in Uber, DSA plays a role everywhere!

Hey, wait! Are you practicing?

Tried HackerRank? CodeChef? HackerEarth? Practice is highly important to understand the types of problems. Also, practice improves your question reading skills which can help you save time. Mathematics is super fun and you’ll be amazed to know how mathematical functions can be used to find solutions to such complex scenario problems.

As you finish the warm-up problems move on to implementations, strings, sorting, search, recursions, debugging and several other sections that’ll help you master the art of solving problems. 

The best part about these platforms is they not only help you prepare but also enhances the spirit of competition, the spirit of winning. One just cannot express the feeling of satisfaction when you get solving problems. The feeling which you get achieving the Gold badge is amazing! Nobody can take it from you, it’s yours!

Why not involve your friends?

In today’s era, nobody can complain of being not aware of current technology trends. If you’re ignoring this, you’re missing out on a lot my friend!

Practice Competitive with a group of friends or a community. Most colleges now have IEEE, CodeChef Chapters in their universities which are non-profit organizations that help increase technical awareness among young students. Even though these opportunities are present in almost all colleges people usually prefer to procrastinate on this. Some students often tell - “I’ll join them next semester” or “I think maybe I can do it much better sitting in my hostel room” and later you find these guys watching Naruto in their hostel rooms. Make sure it’s not you!

Are we practicing?

Practice must never stop! Practice! Practice! Practice!

Even if you don’t get time, make it to just 5 - 7 problems a day. Learn about more algorithms like Greedy, Dynamic Programming, Backtracking, etc. And don’t forget to revise Data Structures and Algorithms regularly.

Competitions Define Us

Take it a positive way. Competitions. Yes, they do help us know where we stand. Even while you began practicing Problem Solving on HackerRank there would have already been over a million people and you’ve practiced daily to get to your favorite badge. True?

The same is with Competitions. Don’t get stressed. You may not want to directly target ICPC. But you can at least get started involved with regular challenges on platforms like CodeChef. There are many competitions that take place in colleges too, keep your eyes open to all. Don’t miss out on any opportunity.


Yes, dedication is important because you’re investing a large part of your time here! You have to get serious about your Competitive routine. You have to constantly analyze the problems which you couldn’t solve earlier or the ones which were taking a long time. Don’t get disheartened if you’re not getting a solution. Look out for help. Again solve until you become perfect. Soon you’ll realize it doesn’t take long enough to get to a Star Ranking on CodeChef. 

Wait! Don’t get complacent! Solve tougher problems. Remember during Engineering Exam preparation, some of us used to solve I.E Irodov problems in Physics. Why? Simple because we could differentiate ourselves from others and hence adopt the same here!

There are a lot of prestigious competitions and tournaments like ACM ICPC, Google’s Kickstart, HashCode, etc. Many of them are sponsored by big tech giants and there are absolutely big prizes!

Additional Readings
All the best!

Contributed by: Dhairya Ostwal

Wednesday 25 March 2020

What are some basic projects in machine learning?

The best way to learn Machine Learning, or for that matter any skill, is to take-up projects. Projects help you get a realistic perspective of how things work at the ground level. Here are some interesting project ideas in Machine Learning which you may want to work on in order to build a great resume:
  • Handwritten Digit Recognition: this is the standard project that everyone takes-up and you should also do it. The project is about one of the simplest Machine Learning datasets - “the MNIST dataset
    ” which contains a set of handwritten images containing numbers from 0 to 9 and you are asked to train a Machine Learning algorithm that can correctly identify the digits. By taking up this project, you will learn a lot of aspects of Machine Learning - loading and cleaning data, data preprocessing, applying various ML algorithms on a given set of data, finding the right metrics to measure the algorithm performance, etc.
  • House Price PredictionHouse Price Prediction problem
     is another interesting problem that is focused more on applying Regression techniques. Linear Regression is a simple, yet powerful Machine Learning algorithm and knowing how to apply it would be extremely useful to solve a variety of ML problems. Further, if you ever apply for an ML-related job, expect a question or 2 around Linear Regression.
  • COVID-19 Global Forecasting: this is a new problem that has emerged in the recent COVID-19 outbreak. Here is the dataset
    . The world is going through a crisis and any contribution from the Technology community in terms of predictions or helping the society would certainly be beneficial.
  • Iris Flower Prediction DatasetThe Iris dataset
     contains 3 flower classes of 50 rows each containing the data-points like the height of petal, the width of petal, the height of sepal, and width of the sepal. Based on these 4 parameters, you are supposed to classify a new data-point into one of the 3 flower classes.
  • Titanic Survival Prediction: This is the “Hello World! problem on Kaggle
    ”. The idea is to use parameters like age, gender, etc., and predict whether the person survived the Titanic crash or not. There are some interesting observations which you will learn about when you play with the Titanic Dataset.
Some other problems which are of interest to the world:
  • Sentiment Analysis: analyzing sentiment is an old problem. Every day new solutions to this problem are being created to solve this problem.
  • Credit Card Fraud Detection: a relatively well-known problem which is also quite important for the Industry. If you build something around it, Banks would love to purchase.
  • Insurance Fraudulent Claim Detection: Insurance companies spend millions of dollars every year to ensure that they don’t pay out a fraudulent claim. If someone solves this problem, they will make a ton of money.
I would recommend the below resources to learn ML and take-up projects:
Further readings: