Onsite Round 1 (Technical)
Given a list of people and their shift schedules, return a final merged schedule that shows each time segment (start time, end time) and the list of everyone on shift during that segment.
Example input:
roster = [
["Mary", 10, 40],
["John", 30, 50],
["Peter", 50, 80],
["Crystal", 100, 150],
["Jane", 120, 180]
]
Example output:
res = [
[10, 30, ["Mary"]],
[30, 40, ["Mary", "John"]],
[40, 50, ["John"]],
[50, 80, ["Peter"]],
[80, 100, []],
[100, 120, ["Crystal"]],
[120, 150, ["Crystal", "Jane"]],
[150, 180, ["Jane"]]
]
Onsite Round 2 (Googlyness & Leadership)
Questions and follow-ups based on my resume and personal experience:
- Deep dives into the project details on my resume, to understand what my specific responsibilities and contributions were.
- The classic Googlyness behavioral questions on teamwork, communication, and handling challenges.
Onsite Round 3 (Technical)
Implement an ad service class AdService with two APIs:
- InsertAd: takes a content (str) and a score (int).
- GetAd: returns an ad.
GetAd has to satisfy three conditions:
- Each call must return the ad with the highest current score.
- No ad can be returned twice in a row.
- After an ad is returned, its score is decreased by 1.
Onsite Round 4 (Technical)
Given a string s made up entirely of lowercase letters. Two non-empty strings s1 and s2 are called a magical string pair if the sets of distinct characters they contain are exactly the same.
Find the total number of triples (i, j, k) that satisfy:
- The index constraint i <= j < k.
- The substring s1 (s[i: j+1]) and the substring s2 (s[j+1: k+1]) form a magical string pair.
Discussion
Loading comments…