You learned DP on trees. States live at nodes and flow from children to parents via post-order DFS.
The pattern: combines values. Leaves are base cases.
For path problems (diameter), track a global answer for paths passing through each node.
For selection problems (House Robber III), track multiple states per node.
For "answer at each node" problems, use rerooting: one pass down, one pass up. Tree DP shows up often. The recursive structure of trees makes these problems natural once you see the pattern.