Top Problems on Two Pointers Technique for Interviews Last Updated : 16 May, 2025 Comments Improve Suggest changes Like Article Like Report The Two Pointer Approach is a powerful and efficient technique used to solve problems involving sorted arrays, searching, and optimization. By utilizing two pointers either moving towards each other or in the same direction, we can reduce the time complexity of many problems from O(n2) to O(n) or O(nlogā”n). This approach is widely used in competitive programming and real-world applications such as finding pairs with a given sum, merging sorted arrays, and optimizing subarray problems.Easy ProblemsRemove Occurrences Move Zeros To End Unique Elements in Sorted Array Reverse a string preserving space positions Sort an array of 0s, 1s and 2s Two Sum Pair Sum in a Sorted and Rotated Array Closest Pair SumClosest pair from two sorted arrays Smallest Subarray > Sum Dominant PairsSentence Palindrome Intersection of Arrays with Distinct Medium ProblemsCount pairs with absolute difference equal to k Triplet Sum in Array Sum of Two Equals Third K-th element of two ArraysUnion of 2 Sorted with Duplicates Subarrays with Max in RangeLongest Substring with K UniqueRemove and Reverse The Celebrity ProblemHard ProblemsTrapping Rain Water Problem 4 Sum - Check for Quadruple4 Sum ā All Distinct Quadruplets with given Sum Comment More infoAdvertise with us Next Article Top Problems on Two Pointers Technique for Interviews U ujjwalroq0 Follow Improve Article Tags : DSA two-pointer-algorithm Practice Tags : two-pointer-algorithm Similar Reads VMWare Interview | Set 1 (MTS-2) VMWare interview for MTS-2 position. I Telephonic round 1. Given an array of strings. Find the maximum prefix among all the strings. Ans: First told about tries. Then went for trivial answer saying compare all the zeroth indices then first indices. 2. Similar to kadane's algorithm 3. I forgot this Q 3 min read Paytm Interview Experience | Set 5 (Recruitment Drive) I attended a Paytm recruitment drive. The requirement was for both Front-end and Backend Developers. I applied for Backend. First there was a written round. The paper consists of 4 Sections. C programming and Data structure objective questions. Aptitude Java / Node JS Subjective programming Question 1 min read OYO Interview Experience | Set 10 (On-campus for SDE) OYO visited our campus recently. Round 1: There was an online test having 20 Technical MCQs and 2 coding questions. 35 candidates were shortlisted for the interviews. Round 2: It started with the famous "Walk me through your resume", followed by two coding questions and a minor discussion on my proj 2 min read Amazon Interview Experience | Set 367 (On-Campus for Internship) 1st ROUND(Online Round :90 min) There were 20 aptitude questions based on C, DS, OS, OOPS, and 2 coding questions. Coding Questions: Find nth Magic Number Count triplets with sum smaller than a given value Since coding questions were easy those who completed both coding questions and some aptitude q 2 min read Veritas Interview Experience | Set 2 ( On Campus ) Veritas visited our college for campus hiring. The CTC offered was 9.26 LPA. There were a total of 105 candidates eligible for the recruitment test. The selection process included an aptitude test, 2 tech interviews, and HR interview. ROUND 1:(Aptitude+Technical test) The aptitude test was on Hacker 3 min read Like