Bloomberg NG 过经

背景: Ph.D. student with 2/3 internships

店面1:
Q1 - https://leetcode.com/problems/candy-crush/
Q2 - https://leetcode.com/problems/merge-intervals/

店面2:
Q1 - https://leetcode.com/problems/add-two-numbers/
Q2 - https://leetcode.com/problems/interleaving-string/

Onsite 第一轮:
Q1 - https://leetcode.com/problems/sort-characters-by-frequency/
Q2 - https://leetcode.com/problems/insert-delete-getrandom-o1/
Q3 - https://leetcode.com/problems/symmetric-tree/

Onsite 第二轮:
Q1 - Given (unsorted) heights of n blocks and a cave, what is the maximum number of blocks that we can slide inside the cave. You cannot rotate blocks, also a unit width of cave can only hold on block. You cannot stack blocks on top of each other.

Q2 - Deisgn an API to get latest message id such that no previous messages are missing. It should have following methods:

# this method should adds a message with id number as received message
def ack(number)

# this method should return the id of last message whose previous counts are not missing
def latest()

Eg. 
ack(2)
latest() => -1
ack(1)
latest() => 2
ack(5)
ack(4)
latest() => 2
ack(3)
latest() => 5