# Aws engineer Interview Questions

# 254

Aws Engineer interview questions shared by candidates### Hardest Q was: Here's a binary tree: find the longest path within it. So, find a path between any two leaf nodes, where the path is the longest.

3 Answers↳

class Solution{ int ans[] = new int[1]; //O(n) public int efficientDia(TreeNode root) { if(root == null) return 0; int left = efficientDia(root.left); int right = efficientDia(root.right); ans[0] = Math.max(ans[0], 1 + left+ right); return 1+ Math.max(left, right); } //O(n^2) public int getDiameter(TreeNode root) { if(root == null) return 0; int leftHeight = getHeight(root.left); int rightHeight = getHeight(root.right); if(ans[0] < 1 + leftHeight + rightHeight) { ans[0] = 1 + leftHeight + rightHeight; } return Math.max(getDiameter(root.left), getDiameter(root.right)); } Less

↳

int ans[] = new int[1]; //O(n) public int efficientDia(TreeNode root) { if(root == null) return 0; int left = efficientDia(root.left); int right = efficientDia(root.right); ans[0] = Math.max(ans[0], 1 + left+ right); return 1+ Math.max(left, right); } //O(n^2) public int getDiameter(TreeNode root) { if(root == null) return 0; int leftHeight = getHeight(root.left); int rightHeight = getHeight(root.right); if(ans[0] < 1 + leftHeight + rightHeight) { ans[0] = 1 + leftHeight + rightHeight; } return Math.max(getDiameter(root.left), getDiameter(root.right)); } private int getHeight(TreeNode root) { // TODO Auto-generated method stub if(root == null) return 0; return Math.max(getHeight(root.left), getHeight(root.right))+1; } Less

↳

Indians at all companies always ask tree questions, it makes them giggle inside. I know, because I'm half indian and have interviewed people... tee hee hee Less

### What happens when you delete the Sysvol folder?

1 Answers↳

Never delete the Sysvol File since it a critical file that regulate replication among domain controllers. It also manage File Replication Service to share files and Scripts as well as Group Policy to get applied in the domain. Once deleted please refer to your next backup DC to restore your PDC or the deleted DC's Sysvol. Less

### come avresti disegnato il seguente DB data le richieste dell'esercizio a casa?

1 Answers↳

DB relazionale con PKs e foreign key etc.

### About VPC Peering Auto scaling Concept EMR S3 GIT Docker

1 Answers↳

About my Experience which already come across

### Find the longest palindrome in a string

1 Answers↳

So there were 5 interviews in total? Did you have a lunch interview?

### Behavioural questions and one session for technical questions

1 Answers↳

I made a mistake of using the same answer in different questions