Status: 6 years of data engineer experience in a pension fund (Canada)
Online Assessment
Virtual Onsite (5 rounds)
Round 1:
Given a binary tree, return the bottom view of the tree as an array of values.
* If the horizontal position of a node is x, its left child node's horizontal position would be x-1 and right child's horizontal position would be x+1.
* If 2 nodes have the same horizontal position, the node on the lower level will block the upper one in the view.
* If 2 nodes on the same level have the same horizontal position, the node to the right will block the one to the left in the view.
Example:
1
/ \
2 3
/ \ \
4 5 6
Input: [1, 2, 3, 4, 5, null, 6]
Output: [4, 2, 5, 3, 6]Round 2:
Round 3:
Implement a library that converts amongst the following 3 colour formats:
* RGB, e.g. (20, 200, 100) where each integer is between 0-255
* Floating Point, e.g. (0.023213F, 0.0322376F, 0.7628F) where each float number is between 0-1
* Hex, e.g. "#14C8F3"Lunch Break (1 hr)
Round 4:
Given an array of N balls, implement an algorithm to find the one ball that is heavier.
We may assume there is one and only one ball that is heavier while the rest of the balls have equal weight.
The following helper function is given:
/* Returns -1 if first portion is heavier, 1 if second, 0 if equal. */
public int Weigh(Ball[] balls, int start1, int end1, int start2, int end2);
Input: an array of Ball objects, but we don't have access to Ball's properties.
Output: the index of the Ball that is heavier than others.Round 5:
Result: downgraded offer to SDE1
My Takeaways:
Some LP questions that I can still remember:
Preparation: