Pattern · Two Pointers

Two Pointers interview questions

141 two pointers problems tagged across recent interview reports. Drilled most heavily by meta, yandex, and amazon.

Founder's read

Two Pointers is a spatial technique where you maintain two cursors moving through a data structure, usually a sorted array or linked list, to solve problems in linear time without extra space. With 141 problems tagged this way, it's one of the most drilled patterns in interviews. Meta sees 84 Two Pointers problems in their hiring pipeline; Amazon, Bloomberg, and Microsoft each run 76 to 78. If you can't recognize the pattern or get stuck on a variant, your OA stalls. StealthCoder reads the problem in real time and solves it while you stay invisible to the proctor.

Most-asked two pointers problems

#ProblemDiff# Companies
013SumMEDIUM66
02Container With Most WaterMEDIUM52
03Find Median from Data StreamHARD31
04Happy NumberEASY22
054SumMEDIUM21
06Find the Index of the First Occurrence in a StringEASY19
07Intersection of Two ArraysEASY15
083Sum ClosestMEDIUM12
09Backspace String CompareEASY12
10Find the Duplicate NumberMEDIUM12
11Is SubsequenceEASY12
12Intersection of Two Linked ListsEASY11
13Find K Closest ElementsMEDIUM7
14Find the CelebrityMEDIUM7
15HeatersMEDIUM7
16Boats to Save PeopleMEDIUM6
17Candy CrushMEDIUM6
18Compare Version NumbersMEDIUM6
19Interval List IntersectionsMEDIUM6
20Count Binary SubstringsEASY5
21Dot Product of Two Sparse VectorsMEDIUM5
22Flatten 2D VectorMEDIUM4
23Assign CookiesEASY3
24Divide Players Into Teams of Equal SkillMEDIUM3
253Sum SmallerMEDIUM2
26Check If a Word Occurs As a Prefix of Any Word in a SentenceEASY2
27Closest Binary Search Tree Value IIHARD2
28Closest Subsequence SumHARD2
29Count Pairs in Two ArraysMEDIUM2
30Count Pairs Whose Sum is Less than TargetEASY2
31Count the Number of Fair PairsMEDIUM2
32Count the Number of Incremovable Subarrays IIHARD2
33Create Maximum NumberHARD2
34Divide Intervals Into Minimum Number of GroupsMEDIUM2
35Find Beautiful Indices in the Given Array IMEDIUM2
36Find Beautiful Indices in the Given Array IIHARD2
37Find K-th Smallest Pair DistanceHARD2
38Get the Maximum ScoreHARD2
393Sum With MultiplicityMEDIUM1
40Advantage ShuffleMEDIUM1
41Bag of TokensMEDIUM1
42Camelcase MatchingMEDIUM1
43Expressive WordsMEDIUM1
44Find Indices With Index and Value Difference IEASY1
45Find Indices With Index and Value Difference IIMEDIUM1
46Find the Array Concatenation ValueEASY1
47Find the Distance Value Between Two ArraysEASY1
48Find the Integer Added to Array IIMEDIUM1
49Flipping an ImageEASY1
50Intersection of Two Arrays IIEASY1

Showing top 50 of 141 two pointers problems by # companies asking.

The hedge for the live OA

You can't drill every two pointers variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

Two Pointers splits into a few clear subtypes: convergent (pointers start at opposite ends and move inward, used for 3Sum and container problems), divergent (pointers start in the middle and expand outward), and same-direction (both pointers move forward at different speeds, often for slow/fast linked list work). You'll recognize it when you see a sorted or partially sorted array and a target relationship, sum, triplet, partition, that smells like O(n) rather than O(n²). Drill convergent patterns first: 3Sum, 4Sum, and 2Sum variants. Then move to same-direction work like Backspace String Compare and Boats to Save People. When a Two Pointers variant hits your live assessment and you're uncertain about the pointer movement logic, StealthCoder bypasses the thinking lag and delivers a working solution in seconds.

Companies that hire most on two pointers

The honest play

141 two pointers problems. You won't drill them all. Pass anyway.

Two Pointers is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which two pointers flavor lands in your live OA. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Two Pointers interview FAQ

How many Two Pointers problems should I drill before an interview?+

Aim for 12 to 15 problems across all subtypes. Start with convergent (3Sum, 4Sum), then same-direction (linked list cycles, string matching). At 141 total problems, you're seeing depth; hit the main variants, not all 141.

Which companies drill Two Pointers the hardest?+

Meta leads with 84 problems in their hiring pipeline. Yandex follows at 79. Amazon, Bloomberg, Microsoft, and Google each have 75 to 78. If you're interviewing at any of these, Two Pointers is non-negotiable.

How do I recognize a Two Pointers problem in the wild?+

Look for sorted input, a target relationship (sum, distance, or pairing), and a need for O(1) space or O(n) time. If the naive solution is O(n²) nested loops, Two Pointers almost always cuts it to O(n) with two passes.

Is Two Pointers the most important pattern for FAANG?+

It's top-tier. Google, Apple, and Microsoft each tag 64 to 75 problems with it. You'll see it in roughly one in three problems. Binary Search and Hash Map rank alongside it, but Two Pointers is unavoidable.

What's the hardest Two Pointers subtype to drill?+

Same-direction pointer work on linked lists and strings (Backspace String Compare) trips up most candidates. Convergent (3Sum variants) is more intuitive. Practice same-direction extensively; it's where most interview flubs happen.

Problem and frequency data sourced from public community-maintained interview-report repos. Problems and trademarks © LeetCode.