Skip to main content

Command Palette

Search for a command to run...

Array + String Problem Set for Senior Engineers

Published
•3 min read•View as Markdown

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

  1. Longest Substring Without Repeating Characters
    Given a string, find the length of the longest substring without repeating characters.
    → Tags: Sliding Window, HashSet
    LeetCode 3

  2. Minimum Window Substring
    Given two strings s and t, return the minimum window in s which will contain all the characters in t.
    → Tags: Sliding Window, HashMap
    LeetCode 76

  3. Longest Subarray with Sum ≤ K (including negative numbers)
    Find the length of the longest subarray with sum less than or equal to K.
    → Tags: Prefix Sum, Monotonic Queue (advanced)


🧮 Prefix Sum / Difference Arrays

  1. 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 560

  2. Range 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

  1. Rotate Array
    Rotate the array to the right by k steps, in-place.
    → Tags: Array, Math
    LeetCode 189

  2. Reverse 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

  1. 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 4

  2. Search in Rotated Sorted Array (with duplicates)
    Modified binary search where the array is rotated and may contain duplicates.
    LeetCode 81


🧩 Complex Logic / Combinatorics

  1. Group Anagrams
    Group words that are anagrams of each other.
    → Tags: HashMap, Sorting
    LeetCode 49

  2. Count Palindromic Substrings
    Count all palindromic substrings in a string.
    → Tags: DP, Expand Around Center
    LeetCode 647

  3. Longest 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

  1. Maximum Product Subarray
    Find the contiguous subarray within an array (containing at least one number) which has the largest product.
    → Tags: DP, Greedy
    LeetCode 152

  2. Trapping Rain Water
    Given n non-negative integers representing elevation, compute how much water it can trap.
    → Tags: Two Pointers, Stack
    LeetCode 42

  3. Word 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

  1. Implement Substring Search (strStr / KMP Algorithm)
    Implement substring search function with O(n + m) time using KMP.
    LeetCode 28

  2. Custom Sort String
    Given an order and a string s, sort s based on the custom order.
    LeetCode 791

  3. Longest 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?