Professional Documents
Culture Documents
Guide On Placements: Deepankar Umare
Guide On Placements: Deepankar Umare
Guide on Placements
Practice STL data structures like Vector, Map, Set, Stack, Queue, Priority Queue, Pair, String
and its functions lower_bound, sort, upper_bound, binary_search, etc.
http://www.cplusplus.com/ and other websites.
Know how they work and where can they be used.
To get a hold on coding, start with A2oJ ladders. Complete at least one ladder
https://www.a2oj.com/Ladders.html
(keep doing this later to get idea of your coding speed and mistakes)
Important: Don’t rely on GFG code. It’s not good for Placements. Especially Graphs. You can
write better codes. Refer to websites like Electrode how codes are written.
For Graphs(and other algorithms) Refer http://cp-algorithms.com/ [ A very high quality and
awesome codes ]
Remember, for placements you should write a consistent, short code comfortable to you.
Consistent because you might need to use same function for e.g. Merge function of merge sort,
or modify your BFS algorithm multiple times. If you use such consistent codes (i.e. you should
use proper variables every time, similar style), it would be easy to debug. If you write BFS
code differently every time, it will cause trouble. So, make sure you maintain a proper
directory of codes and snippets of functions and subroutines (like GCD, BFS, Quick Sort, DFS,
findCycleUndirectedGraph, etc) you’ve written.
Always look for time and space complexity. Just coding wont suffice, coding optimally is
important.
You must be able to estimate complexity of your approach instantly by experience (for e.g.,
Divide and conquer--> logn term)
Tip: Even time complexity requirement can eliminate various approaches you might go
otherwise. For instance, if nlogn algorithm is required (like if size of n is 105 ), then n2 DP
won’t work, etc.
Leetcode.
You’ll get hold on every topic, every algorithm here.
Start from easy, and top 100. Then you can go to medium and topicwise.
Important: Leetcode codes are of excellent quality, perfect for CP and placements.
Always view solutions with all the approaches and SEE THE DISCUSSION AND
DIFFERENT CODES OF GEEKS. This is extremely useful. Learning from others will speed
up your learning and improve it too.
IB is also very important. It will give you strong grip on almost all important topics.
CodeMonk (https://www.hackerearth.com/practice/codemonk/)
I practiced mostly from Leetcode and CodeMonk, its really good to test you topicwise coding
skills
Other awesome resources (do if you get time): Spoj, hackerrank and Hackerearth.
Links
https://www.geeksforgeeks.org/common-mistakes-avoided-competitive-programming-c-
beginners/
http://mdotsabouri.blogspot.com/2014/10/my-recipe-to-improve-your-programming.html
https://www.geeksforgeeks.org/tips-and-tricks-for-competitive-programmers-set-1-for-
beginners/
https://algs4.cs.princeton.edu/cheatsheet/
https://codeforces.com/blog/entry/64218
https://www.geeksforgeeks.org/writing-cc-code-efficiently-in-competitive-programming/
Sample template:
1. #include <bits/stdc++.h>
2.
3. #define pb push_back
4. #define pii pair<int,int>
5. #define vi vector<int>
6. #define vii vector<pii>
7. #define mi map<int,int>
8. #define mii map<pii,int>
9. #define all(a) (a).begin(),(a).end()
10. #define x first
11. #define y second
12. #define sz(x) (int)x.size()
13. #define endl '\n'
14. #define hell 100000000000000007LL
15. #define rep(i,a,b) for(int i=a;i<b;i++)
16.
17. using namespace std;
Later:
String Algorithms
1. Trie
2. Segment Tree
3. Binary Indexed Tree(BIT)
4. Bitmasking
5. Bit manipulation
Seive
NcR effiecient
Difference array
Training(optional)
https://docs.google.com/spreadsheets/d/1iJZWP2nS_OB3kCTjq8L6TrJJ4o-5lhxDOyTaocSYc-
k/edit#gid=1560625140