2D DP problems track a state indexed by two parameters — often two positions in two strings/arrays, or row/column in a grid. The recurrence builds a 2D table; each cell depends on its neighbors.
Longest common subsequence (LCS)
Given strings and , find the longest sequence of characters appearing in both in the same order (but not necessarily contiguous). State: = LCS of and .
time, space. Reduce to space by keeping only the last row.
Edit distance
Minimum number of insertions, deletions, and substitutions to turn into . State: = edit distance from to .
The three options correspond to substitute, delete from , insert into . time and space.
Grid pathfinding (unique paths)
Count paths from top-left to bottom-right in an grid where you can only move right or down. with . time and space — or space with row-by-row update.
Why 2D and not 3D
You CAN have 3D DPs (and 4D and higher). They show up but are rarer. Each extra dimension multiplies state count and complicates the recurrence. Whenever you can compress a dimension (the recurrence only depends on the last row, etc.), do so.
Recognition
Two strings or two arrays, asking for some optimal alignment, common substructure, or count of paths — almost always 2D DP.