Analyze Constraints

Look at the constraints. Often, you can figure out the approach to be taken simply from looking at the input size. In an interview, ask your interviewer about the constraints will also show your attention to detail.

In Letter Combinations of a Phone Number problem, the length of the input is extremely small, 0 <= digits.length <= 4. With such small input sizes, we can safely assume that a brute force solution in which we generate all combinations of letters will be accepted.

Whenever you have a problem where you need to generate all combinations/permutations of some group of letters/numbers, it is a cue for backtracking.

Backtracking algorithms can often keep the space complexity linear with the input size.