## Recent Interview Questions

More Questions »- 0of 0 votes

AnswerFind LCA for list of nodes of a tree

- neer.1304 July 17, 2019 in United States

Function defined as below -

TreeNode findLCA(TreeNode root, List<TreeNode> nodes)| Report Duplicate | Flag | PURGE

Amazon SDE-2 Algorithm - 0of 0 votes

Answers

- vejon July 16, 2019 in United States`Given a number n, make a set of m integers such that the integers lie between [1, n] and the sum of two integers should produce an integer which is in the set. Eg. **Input** n=20, m=5 **Output** [3, 6, 11, 14, 17]`

| Report Duplicate | Flag | PURGE

ThoughtWorks Applications Developer - 0of 0 votes

AnswersWhich test types we can use for drinks vending machine testing? Especially for check dimension, length, appearance of machine and cups?

- lolkaolig July 14, 2019 in United States| Report Duplicate | Flag | PURGE

Testing / Quality Assurance - 0of 0 votes

AnswerA set of points in the 2D plane. Find the first k number of points with the shortest distance to the point (0, 0), where k is a positive integer.

- fz July 13, 2019 in United States

e.g.

Input

{[-16, 5], [-1, 2], [4, 3], [10, -2], [0, 3], [-5, -9]}

k = 3

Output:

{[-1, 2], [0, 3], [4, 3]}

.| Report Duplicate | Flag | PURGE

Algorithm - 0of 0 votes

AnswersA matrix represents a sequence of travel points. One only can travel either left/right or up/down. Some of those points are dead points which one can't travel any further. There is a destination point in the matrix. Find the shortest path from the top left point (1, 1) to the destination.

- fz July 13, 2019 in United States

e.g.

Input

[

[‘O’, ‘O’, ‘O’, ‘O’],

[‘D’, ‘O’, ‘D’, ‘O’],

[‘O’, ‘O’, ‘O’, ‘O’],

[‘X’, ‘D’, ‘D’, ‘O’],

]

Output

Route is (0, 0), (0, 1), (1, 1), (2, 1), (2, 0), (3, 0) The minimum route takes 5 steps.| Report Duplicate | Flag | PURGE

Algorithm