LinkedIn Senior Software Engineer | Final Round | US
Anonymous User
1586

Nov 2024

Tech Screen:

  1. Similar to https://leetcode.com/problems/valid-parentheses/description/?envType=company&envId=linkedin&favoriteSlug=linkedin-six-months

  2. https://leetcode.com/problems/nested-list-weight-sum-ii/description/?envType=company&envId=linkedin&favoriteSlug=linkedin-three-months

Final:
Coding 1:
Similar to https://leetcode.com/problems/find-the-celebrity/ except the list is a 2D array representing relations.

	Example Input:
	Input List: numbers = [0, 1, 2, 3]

	Relation Matrix:
	relation = [
	  [0, 1, 1, 1],  // Person 0 knows 1, 2, 3
	  [0, 0, 1, 1],  // Person 1 knows 2, 3
	  [0, 0, 0, 1],  // Person 2 knows 3
	  [0, 0, 0, 0]   // Person 3 knows nobody
	] 

System Design:
	Top K shared posts 

Coding 2:
	Question 1:
		Given a tree with an arbitrary number of children, sort the nodes by the order in which they would "fall" off a tree. At every step, all the nodes which have no children are deleted from the tree. This process is repeated until only the root node remains, at which point it falls off the tree as well.

		For example, given the following tree:
		      A
		     / \
		    B   C
		   / \ 
		  D   E

		- At the first step, leaves "D," "E," and "C" fall off the tree. That leaves us with the following:
		      A
		     /
		    B

		- At the second step, only leaf "B" falls off the tree.
		- At the third step, the root "A" falls off the tree.

		Therefore, for the example tree, this method should return: [{C, D, E}, {B}, {A}]

		Another way to think about the result is as follows:

		- Given some nodes, group the nodes into a list of sets such that the following two properties are satisfied:
		  1. A node appears later in the list than its children.
		  2. A node appears as soon as possible in the list.

		class Solution {
		    // Reminder of some of the useful methods of the TreeNode interface
		    public interface TreeNode {
		        // Get all the children of a node
		        Collection<TreeNode> children();
		    }
		}

	Question 2:
		https://leetcode.com/problems/max-consecutive-ones-iii/description/
		Note that the part was worded differently but almost exactly the same.
	

Reject : (

Comments (4)