Phone Screen - 45 Min
Q - You’re given an endless stream of integers and a non-negative threshold d; your job is to pull off three numbers as soon as they “fit together,” meaning the difference between the smallest and largest of the three is at most d, discard those three so they can’t be reused, and continue until the stream ends, returning the list of all triplets in the order they were completed
d = 2
inputStream: [10, 5, 7, 6, 8, 3, 4, 1, 2]
Result - [[5, 6, 7], [1, 2, 3]]
Interview 1 - 45 Min
Q - Given a directed graph of n nodes labeled from 0 to n-1, find the minimum number of edges in any path from a start node A to a target node B, excluding any “obstacle” nodes through which traversal is forbidden. If no such path exists, return -1.
Interview 2 - 45 Min
Q - Merged Interval (Tweaked a little)
All the questioned were worded a little differently. All the best to anyone who has theirs in the coming weeks