Prep
Code
Questions
Roadmap
CSES Set
Patterns & Comp
Companies
Profile
Sign In
Create Account
Home
Topics
Dp On Trees
Dp On Trees
30 problems
Algorithms pattern questions across top companies
All
Unsolved
Solved
Starred
Table
Topics
Filters
Timeframe:
All Time
30
Last 30 Days
2
Last 3 Months
4
Last 6 Months
8
> 6 Months
24
Showing
30
questions
#124
Binary Tree Maximum Path Sum
Hard
dynamic programming
NeetCode
Adobe
Amazon
Apple
#687
Longest Univalue Path
Medium
tree
WalkCCC
Amazon
Google
Snowflake
#968
Binary Tree Cameras
Hard
dynamic programming
WalkCCC
Amazon
Bloomberg
DE Shaw
#2538
Difference Between Maximum and Minimum Price Sum
Hard
array
WalkCCC
Directi
Media.net
#563
Binary Tree Tilt
Easy
tree
WalkCCC
Amazon
Indeed
Meta
#543
Diameter of Binary Tree
Easy
tree
NeetCode
Amazon
Apple
Bloomberg
#1519
Number of Nodes in the Sub-Tree With the Same Label
Medium
hash table
WalkCCC
Samsung
Uber
#337
House Robber III
Medium
dynamic programming
NeetCode
Amazon
Bloomberg
Docusign
#1916
Count Ways to Build Rooms in an Ant Colony
Hard
array
WalkCCC
Adobe
#250
Count Univalue Subtrees
Medium
tree
WalkCCC
Amazon
Google
Zeta
#979
Distribute Coins in Binary Tree
Medium
tree
WalkCCC
Amazon
Bloomberg
Goldman Sachs
#834
Sum of Distances in Tree
Hard
dynamic programming
WalkCCC
Amazon
Bloomberg
Google
#366
Find Leaves of Binary Tree
Medium
tree
WalkCCC
Amazon
Flipkart
Google
#2920
Maximum Points After Collecting Coins From All Nodes
Hard
array
WalkCCC
DE Shaw
#2049
Count Nodes With the Highest Score
Medium
array
WalkCCC
DoorDash
Visa
#1443
Minimum Time to Collect All Apples in a Tree
Medium
hash table
WalkCCC
Amazon
Cisco
Meta
#298
Binary Tree Longest Consecutive Sequence
Medium
tree
WalkCCC
Amazon
Google
Meta
#1530
Number of Good Leaf Nodes Pairs
Medium
tree
WalkCCC
Google
TikTok
#865
Smallest Subtree with all the Deepest Nodes
Medium
hash table
WalkCCC
Amazon
Bloomberg
Google
#1522
Diameter of N-Ary Tree
Medium
tree
WalkCCC
Meta
Salesforce
#1245
Tree Diameter
Medium
tree
WalkCCC
Amazon
Goldman Sachs
Google
#1123
Lowest Common Ancestor of Deepest Leaves
Medium
hash table
WalkCCC
Amazon
Bloomberg
Google
#1373
Maximum Sum BST in Binary Tree
Hard
dynamic programming
WalkCCC
Amazon
Bloomberg
Google
#333
Largest BST Subtree
Medium
dynamic programming
WalkCCC
Meta
Microsoft
#1273
Delete Tree Nodes
Medium
array
WalkCCC
Microsoft
#508
Most Frequent Subtree Sum
Medium
hash table
WalkCCC
Amazon
Microsoft
#549
Binary Tree Longest Consecutive Sequence II
Medium
tree
WalkCCC
Google
Meta
Uber
#2973
Find Number of Coins to Place in Tree Nodes
Hard
dynamic programming
WalkCCC
Amazon
#2925
Maximum Score After Applying Operations on a Tree
Medium
dynamic programming
WalkCCC
Google
#1372
Longest ZigZag Path in a Binary Tree
Medium
dynamic programming
WalkCCC
Amazon
Microsoft