<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Waabi计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(2)
OOD(0)
Algorithm(2)
System Design(0)
高频题(0)
Math(0)
全部(2)
OOD(0)
Algorithm(2)
System Design(0)
高频题(0)
Math(0)
1.Message Delivery System Constraint Handling
2.Delivery Order Delay Problem
1. Message Delivery System Constraint Handling
In a message delivery system, ensure that there are no duplicate messages within k seconds. The problem statement is lengthy and obscure, requiring careful reading. The solution uses a hash map to record messages and their timestamps. When a new message arrives, check if its timestamp is within k seconds of the last message. Some test cases did not pass, and the reason is unclear.
2. Delivery Order Delay Problem
Given an array representing delivery order pairs such as [[a1, b1], [a2, b2], ...], where a1 must arrive after b1, a2 must arrive after b2, and so on. If a certain location has a delay, determine all the delayed points that follow in the delivery sequence. The solution involves constructing a directed graph based on the array and then, given a location, searching for all points that come after it in the graph using BFS. Discuss the time complexity and consider the case where some hidden test cases did not pass due to long execution time.