Beyond basic permutations and combinations, a few patterns recur in interview problems and are worth memorizing.
Stars and bars counts the number of non-negative integer solutions to :
Place identical "stars" and "bars" in a row; the groups separated by bars give the values of the .
Catalan numbers count an astonishing variety of structures: balanced parentheses with pairs, monotonic lattice paths that don't cross the diagonal, binary trees with internal nodes, and triangulations of a convex polygon. If a counting problem feels like it should be but is mysteriously about half that, try Catalan.
Many counting problems factor cleanly into recurrences. Count by conditioning on the last move, the smallest element, or any natural structural choice. The classic example is the Fibonacci recurrence for tilings of a board or for binary strings with no two consecutive 1s.
Inclusion–exclusion generalizes the union formula to any number of overlapping sets: alternating sum of intersections of all sizes. Use it whenever a "none of these" or "at least one" question doesn't reduce neatly to independence.