Basic Algorithm Techniques Not Taught in Academics Last Updated : 14 May, 2020 Comments Improve Suggest changes Like Article Like Report We generally study most of the algorithmic techniques in academics like Searching, Sorting, Dynamic Programming, Greedy Algorithms, Divide and Conquer, Backtracking, etc. But below techniques are generally not taught and used a lot to solve questions in interviews and competitive programming. Prefix Sum Technique In this technique we preprocess the array and make another array called prefix sum array. Prefix sum array computes sum of elements from index 0 to current index. Equilibrium index of an array Find if there is a subarray with 0 sum Maximum subarray size, such that all subarrays of that size have sum less than k : Prime numbers which can written as sum of most consecutive primes. Longest Span with same Sum in two Binary arrays : Maximum subarray sum modulo m Maximum subarray size, such that all subarrays of that size have sum less than k Maximum occurred integer in n ranges : Minimum cost for acquiring all coins with k extra coins allowed with every coin : Random number generator in arbitrary probability distribution fashion : Important Links : Practice Problems on Prefix Sum Recent Articles on Prefix Sum Two Pointer Algorithm Two pointers is really an easy and effective technique which is typically used for searching pairs in a sorted array. Find the closest pair from two sorted arrays Find the pair in array whose sum is closest to x Find all triplets with zero sum Find a triplet that sum to a given value Find a triplet such that sum of two equals to third element Find four elements that sum to a given value Important Links : Recent Articles on Two Pointer Practice Problems on Two Pointer Window Sliding Technique This technique shows how a nested for loop in some problems can be converted to a single for loop to reduce the time complexity. Maximum of all subarrays of size k Find subarray with given sum | Set 1 (Nonnegative Numbers) Anagram Substring Search (Or Search for all permutations) Count ways to reach the n’th stair Subarray of size k with given sum Important Links : Practice Problems on Sliding Window Recent Articles on Window Sliding Apart from these STL in C++ and Collection in Java are not taught in academics and these are super important if your program in C++ and Java respectively. BONUS TIP: Whenever you solve a problem, make sure that you analyze it properly. Here, the Analysis not something about its efficiency, "it's about finding a pattern in a problem ." Have a practice of grouping problems under a category of pattern will make you better. This is because when you look at a similar problem again, your brain identifies the pattern instantly and just picks it up and gives it you. This seems to be quick and makes you feel a bit confident too.. Happy coding!!! Comment More infoAdvertise with us Next Article Basic Algorithm Techniques Not Taught in Academics S sowmyathiru5 Follow Improve Article Tags : Algorithms Competitive Programming Write From Home DSA prefix-sum sliding-window two-pointer-algorithm +3 More Practice Tags : Algorithmsprefix-sumsliding-windowtwo-pointer-algorithm Similar Reads How can one become good at Data structures and Algorithms easily? Let us first clarify the question. There is not any easy way to become good at anything but there is an efficient way to do everything. Let us try to understand the difference between easy and efficient here with the help of a programming question! Consider the problem of "Searching an element in a 4 min read How to develop an Algorithm from Scratch | Develop Algorithmic Thinking Algorithms are step-by-step instructions used to solve problems. Developing algorithmic thinking helps in breaking down complex problems into smaller problems and then solving the smaller problems and combining them to make solutions for that complex problem. Developing Algorithmic Thinking via Solv 3 min read Microsoft Interview experience | Set 115 (4 Years Experienced for IDC) 1st Round : 1)https://www.geeksforgeeks.org/maximum-product-subarray/ 2)https://www.geeksforgeeks.org/sort-an-almost-sorted-array-where-only-two-elements-are-swapped/ 3) Delete all nodes whose value is greater than K 2nd Round (1 hr 30 mins) 1) Clone a Binary Tree 2) There is a rack of shelves havin 2 min read Number Theory for DSA & Competitive Programming What is Number Theory?Number theory is a branch of pure mathematics that deals with the properties and relationships of numbers, particularly integers. It explores the fundamental nature of numbers and their mathematical structures. Number theory has been studied for centuries and has deep connectio 3 min read QuickSort Based Practice Problems Problems based on Partitioning AlgorithmSorting an Array of Two Types.Stable Binary SortingStable Binary Sorting with O(1) SpaceThree Way Partitioning Around a RangeThree Way Partitioning Around a ValueSorting an Array of Three TypesProblems based on Quick SortKth Smallest ElementK Smallest Elements 1 min read Like