Round 1: Online Assessment
Questions:
-
Given the number of movie series watched, find the minimum subarray that includes series1 and series2. The minimum subarray is counted based on the number of distinct elements in it.
Example:
s1 = 1
s2 = 2
watched = [1, 3, 2, 1, 4]
Output: [2, 1] -
Given an array, find the maximum possible number after performing a specific operation:
Remove the smallest element from the array.
Replace it with the sum of its adjacent elements (idx-1 + idx+1).
Example:
charge = [-2, 4, 3, -2, 1]
Step 1: Remove idx 0 (-2) → [4, 3, -2, 1]
Step 2: Remove idx 2 (-2) → [4, 4]
Candidate's Approach
- For the first problem, I used the minimum sliding window approach.
- For the second problem, I tackled it using an indexed heap, but I hit a time limit—15 out of 20 test cases passed.
Interviewer's Feedback
No feedback provided.
Round 2: Phone Screen
Questions:
- Leadership Principles: Customer Satisfaction & Dealing with Setbacks (30 min)
- Design a Task Scheduler to append tasks and fetch them based on priority (30 min)
Example:
class Task: def __init__(self, id, priority, code): self.id = id self.priority = priority self.code = code class TaskScheduler: def add(task): # Add a task def fetch(): # Fetch task with the highest priority
Candidate's Approach
- I structured my responses using the STAR method for the Leadership Principles round, covering key principles like Customer Obsession, Deep Dive, Being Right a Lot, and Delivering Results.
- For the Task Scheduler problem, I solved it in 10 minutes, starting with a brute-force approach (O(n² log n)) and optimizing it to O(n log n) worst case. I covered edge cases, discussed bottlenecks, and included type annotations in my code. I considered that I could have used a Binary Search Tree (BST) for optimization.
Interviewer's Feedback
- The interviewer mentioned the recruiter's name and said they would update me on the next steps. However, I later received a rejection email.