Array + String Problem Set for Senior Engineers
Here’s a curated list of challenging array and string problems that are ideal for Senior Software Engineer level candidates. These problems focus on problem-solving, optimization, edge-case handling, and deep understanding of data structures, often involving sliding windows, two pointers, hashing, dynamic programming, and custom sorting logic.
🔁 Two Pointers / Sliding Window
Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.
→ Tags: Sliding Window, HashSet
LeetCode 3Minimum Window Substring
Given two stringssandt, return the minimum window inswhich will contain all the characters int.
→ Tags: Sliding Window, HashMap
LeetCode 76Longest Subarray with Sum ≤ K (including negative numbers)
Find the length of the longest subarray with sum less than or equal toK.
→ Tags: Prefix Sum, Monotonic Queue (advanced)
🧮 Prefix Sum / Difference Arrays
Subarray Sum Equals K
Given an array of integers and an integer k, find the total number of continuous subarrays whose sum equals to k.
→ Tags: HashMap, Prefix Sum
LeetCode 560Range Sum Query with Updates (Mutable)
Implement a data structure to perform range sum queries and point updates.
→ Tags: Segment Tree / Binary Indexed Tree
LeetCode 307
🔄 In-Place Modifications / Reversals
Rotate Array
Rotate the array to the right by k steps, in-place.
→ Tags: Array, Math
LeetCode 189Reverse Words in a String (No extra space)
Reverse the words in a string in-place with O(1) extra space.
→ Tags: String, In-place
LeetCode 151
🔍 Sorting & Searching
Median of Two Sorted Arrays
Find the median of two sorted arrays of size m and n in O(log(m+n)).
→ Tags: Binary Search, Divide & Conquer
LeetCode 4Search in Rotated Sorted Array (with duplicates)
Modified binary search where the array is rotated and may contain duplicates.
LeetCode 81
🧩 Complex Logic / Combinatorics
Group Anagrams
Group words that are anagrams of each other.
→ Tags: HashMap, Sorting
LeetCode 49Count Palindromic Substrings
Count all palindromic substrings in a string.
→ Tags: DP, Expand Around Center
LeetCode 647Longest Valid Parentheses
Given a string containing just'('and')', find the length of the longest valid (well-formed) parentheses substring.
→ Tags: Stack, DP
LeetCode 32
🧠 Advanced / Optimization
Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
→ Tags: DP, Greedy
LeetCode 152Trapping Rain Water
Given n non-negative integers representing elevation, compute how much water it can trap.
→ Tags: Two Pointers, Stack
LeetCode 42Word Ladder II
Find all shortest transformation sequences from start to end word using a given dictionary.
→ Tags: BFS, Backtracking
LeetCode 126
🧪 Bonus: Custom Implementation Challenges
Implement Substring Search (strStr / KMP Algorithm)
Implement substring search function with O(n + m) time using KMP.
LeetCode 28Custom Sort String
Given an order and a string s, sort s based on the custom order.
LeetCode 791Longest Consecutive Sequence (Unsorted Array)
Find the length of the longest consecutive elements sequence.
→ Tags: HashSet, O(n)
LeetCode 128
📊 Want These in a Table Format or Downloadable Doc?
Let me know if you want this list in:
A Notion page / PDF / CSV
With difficulty levels & estimated time per question
With company tags (e.g. asked at Google, Meta, etc.)
Would you like that?