Competitive Programming - A Complete Guide Last Updated : 22 Aug, 2025 Comments Improve Suggest changes Like Article Like Report Competitive Programming is a mental sport that enables you to code a given problem under provided constraints. The purpose of this article is to guide every individual possessing a desire to excel in this sport. This article provides a detailed syllabus for Competitive Programming designed by industry experts to boost the preparation of the readers.Why To Do Competitive Programming?Here are some reasons about why you should start Competitive Programming:Mental Agility and Quick Thinking: By practicing competitive programming, you start thinking quickly and within the given timeframe and this improves your mental agility and helps enhance your thinking ability.Career Prospect: Competitive programming is very important when it comes to technical interviews for software engineering-related jobs. Many tech giants use competitive programming contests as a medium of recruitment. Companies like Google, ServiceNow, Atlassian, etc. have technical interviews based on competitive programming problems. Learning Opportunity: In Competitive programming, we get a wide range of variety of problems and various arithmetic concepts. Competitive programming exposes various data structures and algorithms which help us better understand the complexity of problems. Basics of Competitive Programming:What is Competitive Programming and How to Prepare for It?Competitive Programming (CP) Handbook with Complete RoadmapFast I/O: CPP, Java, PythonUseful libraries: CPP, Java, PythonInput/Output Files: Set 1, Set 2Tips and Tricks: Set 1, Set 2Input Methods: CPP, Java, PythonTemplate: CPPLanguage: CPP, Java, PythonTime Complexity: Analysis Setting up Competitive Programming Environment: Sublime: CPP, Visual Studio: CPP and PythonCSES Problem SetBasics Of Array , String, Greedy and Bit ManipulationReverse an array(Related Problems: Problem 1, Problem 2)Sum of DigitsProgram to Check if a Given String is Palindrome in C, Python (Related Problem)Sum of array elements(Related Problem)Maximum and Minimum element of array(Related Problem)Counting frequencies of array elements(Related Problems: Problem 1, Problem 2)Float and Precision: CPP, Java, PythonPrefix sum, 2D Prefix Sum, Difference Array | Range update query in O(1): (Related Problems: Problem 1, Problem 2)Coordinate Compression: (Related Problem)Kadane Algorithm: (Related Problem)Activity Selection Problem: (Related Problem)Job Sequencing Problem: (Related Problem)Sliding Window: (Related Problem)Logical Operators: CPP Set 1, Set 2, Java, PythonBit Manipulation: Set 1, Set 2, Set 3(Related Problems: Problem 1, Problem 2, Problem 3)Bitset CPPTop 50 Array Coding Problems for InterviewsTop 50 String Coding Problems for InterviewsNumber Theory and CombinatoricsPrime Number(Related Problem)Sieve of Eratosthenes(Related Problem)Segmented Sieve (Related Problem)Find all divisors of a natural number (Related Problem)Least prime factor of numbers upto N (Related Problem)All prime factors of a number(Related Problem)Prime Factorization using Sieve O(log n) for multiple queriesSum of all factors of a number(Related Problem)Gcd of Two numbers, Lcm of two numbers(Related Problem)Linear Diophantine EquationsEuclidean algorithms (Basic and Extended)Euler’s Totient Function(Related Problem)Euler’s Totient function for all numbers smaller than or equal to nInclusion Exclusion Principle Pigeon Hole PrincipleModular OperationsModular Inverse: (Related Problem 1, Problem 2)Chinese Remainder Theorem: Set 1, Set 2Power(x, y) in O( logN )Power(x, y) % mod: (Related Problem 1, Problem 2)Matrix Exponentiation: (Related Problem)Permutation and Combination: Set 1, Set 2, Quiz 1, Quiz 2nCr: Set 1, Set 2nCr % mod: Set1, Set 2: (Related Problem)nCr % mod for multiple queries: (Related Problem)Catalan numbers: Applications and Related ProblemGaussian EliminationSearching, Sorting and Basic Data StructuresLinear Search(Related Problems: Problem 1, Problem 2)Binary Search, Unbounded Binary Search(Related Problems : Problem 1, Problem 2, Problem 3)Inbuilt sorting O(logN): CPP, Java, Python(Related Problems: Problem 1, Problem 2, Problem 3, Problem 4)Merge Sort(Related Problems: Problem 1, Problem 2)Quick Sort(Related Problems: Problem)Stack: Implementation in CPP, Java, Python(Related Problems: Problem 1, Problem 2, Problem 3)Queue: Implementation in CPP, Java, Python(Related Problems: Problem 1, Problem 2 , Problem 3)Deque: Implementation in CPP, Java, Python(Related Problems: Problem)Priority Queue: Implementation in CPP, Java, Python(Related Problems: Problem 1, Problem 2, Problem 3)Tree and GraphsTree BFS, Tree DFS (Related Problems: Problem 1, Problem 2, Problem 3)Graph BFS, Graph BFS 2, Graph DFS (Related Problems: Problem 1, Problem 2)Dijkstra’s Shortest Path Algorithm(Related Problems: Problem 1, Problem 2)Bellman – Ford Algorithm(Related Problem)Floyd Warshall Algorithm(Related Problem)0-1 BFS, Dial’s AlgorithmDetect cycle: Directed, Undirected(Related Problems: Problem 1, Problem 2)Disjoint set(union-find): Set 1, Set 2, Set 3(Related Problem)Topological Sorting, Kahn’s Algorithm(Related Problem)Minimum Spanning Tree: Prim’s Algorithm, Kruskal Algorithm(Related Problem)Bipartite or not, M-Coloring(Related Problems: Problem 1, Problem 2, Problem 3)Strongly Connected Components: Tarjan, Kosaraju(Related Problems: Problem 1, Problem 2)Euler Path: Undirected, Directed(Related Problem)Flow Algorithms: Set 1, Set 2, Dinic’s Algorithm(Related Problems: Problem 1, Problem 2)Diameter of TreeCentroid DecompositionLowest Common AncestorTop 50 Tree Coding Problems for InterviewsRecursion and Dynamic ProgrammingRecursion: Quiz 1, Quiz 2, Quiz 3, Quiz 4, Quiz 5, Quiz 6, Quiz 7 (Related Problems: Problem 1, Problem 2, Problem 3)Backtracking: (Related Problems: Problem 1, Problem 2)Dp Introduction: Set 1, Set 2, Set 3, Set 4, Set 5Most useful Dynamic Programming questionsAdditional DP Problems : Problem 1, Problem 2, Problem 3, Problem 4Dp on Trees: Set 1, Set 2Dp on Bit Masking: Set 1, Set 2, Set 3Digit DpTop 50 Dynamic Programming Coding Problems for InterviewsString AlgorithmsSuffix Tree: Set 1, Set 2Z AlgorithmKMP Algorithm, Rabin-Karp Algorithm(Related Problem)Manacher’s Algorithm: Set 1, Set 2, Set 3, Set 4Suffix Automation: Set 1, Set 2Geometry and Game TheoryClosest Pair of PointsHow to check if two given line segments intersect? (Related Problem)How to check if a given point lies inside or outside a polygon?Convex Hull: Set 1, Set 2(Related Problem)Given n line segments, find if any two segments intersectCheck whether a given point lies inside a triangle or notHow to check if given four points form a square: (Related Problem)Combinatorial Game Theory: Set 1 , Set 2, Set 3, Set 4Minimax Algorithm in Game Theory: Set 1, Set 2, Set 3, Set 4, Set 5Variation in Nim GameFind the winner in nim-gameOptimal Strategy for a GameAdvance Data StructuresTrie: Set 1, Set 2, Set 3, (Related Problems: Problem 1, Problem 2, Problem 3, Problem 4, Problem 5)Fenwick Tree: Set 1, Set 2, Set 3, Set 4, (Related Problem)Segment Tree: Set 1, Set 2, Set 3 (Related Problem)Sparse Table: Set 1, Set 2Sqrt Decomposition: Set 1, Set 2Heavy Light Decomposition: Set 1, Set 2Meet in the MiddleMO’s Algorithm, ProblemPolicy based Data StructureYou may also check Geeksforgeeks Online Courses to Learn Data Structures and Algorithms, well designed courses taught by Industry Experts. Comment More info K kartik Follow Improve Article Tags : DSA Explore DSA FundamentalsLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 2 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 14 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 6 min read Problem of The Day - Develop the Habit of Coding 5 min read Like