How to master C++ for Competitive Programming and Job Interview?

Aniket Kumar
3 min readMay 13, 2021

If you have arrived at this post, you are lucky.
When I was preparing for my JEE Exams, to solve any Physics question my Physics Sir always told me have certain number tool in hand before attempting the question.
Most of the people start their journey without paying attention or much emphasis in learning programming language and directly start solving the question.
But you must have a sword, before you enter a battlefield.
Here, C++ is your sword.
Let’s start what to study.

Resources are avail online, but here’s a compiled list.
Topics

1: Array
2: Vector
3: String
4: Pair
5: Set and Unordered Set
6: Multiset and Unordered Multiset
7: Map and Unordered Map
8: Multimap and Unordered Multimap
9: Deque
10: Common Math Function
11: Priority Queue
12: Forward_List or Single Linked List
13: List
14: Queue
15: Stack
16: Pointer

Flowchart inspired by David Moore’s version, made by Mikael Persson

Some more important concept to learn, usually C++ STL is enough to implement Queue, Linked List, and so. But it is important to implement these things from scratch to further help in getting your concept clear.
Hence, I would recommend to implement Linked List (Most Important), Queue, Stack and Heap.

https://www.programiz.com/dsa

I am not writing covering about the basics of C++. But if you are an absolute begineer with no knowledge of programming. I would recommend you to get started with this site.
1) https://www.learncpp.com/
2) https://docs.microsoft.com/en-us/cpp/cpp/?view=msvc-160

Personally I am a big fan of documentation. So anything as long sticks to the documentation -cppreference, cplusplus, or book by the creator of C++Bjarne Stroustup can be considered to be a genuine source of Knowledge.

Algorithm Resources
https://cp-algorithms.com/
https://discuss.codechef.com/t/data-structures-and-algorithms/6599

Visualization plays an important role, if you don’t understand any particular data structure or algorithm. Check out these sites.
They will definitely help you

https://visualgo.net/en

https://www.cs.usfca.edu/~galles/visualization/Algorithms.html

Further, Check out this link and try to implement these algorithm in your own version. http://www.cplusplus.com/reference/algorithm/ . The link present some basic per-defined functions which is very important when solving question involving much deeper understanding. Only if you have mastered the basics, spent time mastering the language and algorithm you will be able to solve question be it for your interview or competitive programming.

Critical Thinking plays an important role in cracking the job interview. You must keep your mind in healthy shape to ensure it keep functioning.

When I was going Gym, the first thing my trainer told was to warmup. This is because you need to tell your body that you are about to do some physical exercise and some heavy lifting.
Mind works in the same way. If you pick up some heavy weight or a tough problem, then chances are high you will take more time to solve the problem or won’t be able to solve. I am not demotivating you, but if you want to see some genuine results. You have to start with basics and repeat the same thing over and over. Once you are sure with basics, its time to move to the next level. To build a stronger biceps, you perform certain number of reps and only then you can see the results. If you look at Data Structure Algorithm, it works in the same way. Practice multiple problem of the same type or topic, to ensure you have understood the topic well enough and confident enough that you will be able to solve any problem. Consistency is the key. Resources are available online, you just need to be consistent enough and stop procrastination to able to master DSA.

Seriously you have Youtube which is the greatest resource if you are stuck anywhere. Read some blogs, Google, Search on Youtube, you will eventually get it.

Other Important Topic
Bit Manipulation

Site to practice coding problem for interview preparation (Select any 1)
1) https://leetcode.com/
2) https://www.hackerrank.com/dashboard
3) https://www.hackerearth.com/practice/
4) https://www.interviewbit.com/
5) https://binarysearch.com/problems

Competitive Programming (Select any 1)
1) https://www.codechef.com/
2) https://codeforces.com/
3) https://atcoder.jp/
4) https://www.spoj.com/

--

--