Amazon Interview QuestionSDE1s
Country: United States
I think this would be easier... Note: don forget to write code to populate the tree
public class RobNTree
static int max;
static class TreeNode
public static void main(String args)
max = 0;
TreeNode root = null;
// populate tree
if (root != null)
System.out.println("The max possible loot is " + max);
private static void traverse(TreeNode node, int sum)
sum += node.val;
max = (sum > max) ? sum : max;
for (int i = 0; i < node.kids.size(); i++)
Amazon Interview Question for SDE1s being contrived to exist for many projects simply so it can be run will be the first to hit the wall, but those projects where the functions to make existing transactions cheaper in real world applications will find the elusive real world demand.
I recently attended the AWS Summit London 2018. During the afternoon session about "Open Source at AWS" there were some resources mentioned for persuading your company that open source can be a great benefit to them.
Unfortunately this wasn't one of the slide sets which has been made available after the event.
Follow my new blog if you interested in just tag along me in any social media platforms!
Looking for coaching on interview preparation?
Visit AONECODE.COM for ONE-TO-ONE private lessons by FB, Google and Uber engineers!
System Design (for candidates of FB, LinkedIn, AMZ, Google and Uber etc)
Algorithms (DP, Greedy, Graph etc. advanced algorithms and clean coding)
Interview questions sorted by companies
Ace G, U, FB, Amazon, LinkedIn, MS and other top-tier interviews in weeks of training.
Feel free to email us email@example.com with any questions. Thanks!
- aonecoding April 01, 2018