Day 11 - Two Pointer Approach

30-Day Python Coding Interview Challenge

📌 Interview Questions on Two Pointer Technique

  1. Find if there exist two numbers in a sorted array that sum up to a given target.
  2. Remove duplicates from a sorted array in-place and return the new length.
  3. Return a new array of squares from a sorted array, sorted in non-decreasing order.
  4. Find all unique triplets in an array that sum up to zero (3-Sum Problem).
  5. Sort an array containing only 0s, 1s, and 2s (Dutch National Flag Problem).
  6. Check if a given string is a palindrome using two pointers.
  7. Find the maximum water trapped between two vertical lines (Container With Most Water problem).
  8. Merge two sorted arrays into one sorted array in-place using two pointers.
  9. Find the intersection of two sorted arrays using the two pointer technique.
  10. Check if there exists a pair in a rotated sorted array that sums to a given target.

Shaivi Connect © 2025