DSA Pattern Guide

Arrays & Strings Pattern Guide

Array and string interview problems are almost always one of a small set of patterns: prefix sums for range queries, in-place manipulation to hit O(1) extra space, and frequency counting via hashing. The pattern matters more than the specific problem — once you recognize which one applies, the implementation is usually short.

11
Array problems in Ediky's DSA bank
5
String problems in Ediky's DSA bank
Code-judged, in-browser IDE
Bank

The patterns that matter

  • Prefix sums — turning O(n) range-sum queries into O(1) after an O(n) precompute
  • In-place manipulation — reversing, rotating, or partitioning without extra space, using two indices
  • Frequency counting / hashing — "have I seen this before" problems, O(n) instead of O(n²)
  • Single-pass tracking — running min/max/count while scanning once, no second pass needed

Real problems from Ediky's DSA bank

Actual problem titles from Ediky's code-judged bank:

  • "Interesting Pairs of Numbers" (Array)
  • "Maximum Points on a Horizontal or Vertical Line" (Array)
  • "Alibaba and Passwords" (String)
  • "Cryptic Temple Secrets" (String)

Practice Array & String problems

16 tagged problems in Ediky's DSA bank with a full in-browser IDE.

Open Array problems