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

Rubrik计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(3)
OOD(0)
Algorithm(1)
System Design(2)
高频题(0)
Math(0)
全部(3)
OOD(0)
Algorithm(1)
System Design(2)
高频题(0)
Math(0)
1.Leaky Bucket as a Rate Limiter
2.Design a Data Structure for Ranking and Scores
3.Schedule Tasks Problem
1. Leaky Bucket as a Rate Limiter
Implement a rate limiter using the leaky bucket algorithm. Additionally, use this rate limiter to create a blocker that prevents multiple password attempts in a short period. Discuss how you would handle the rate limiter in a distributed database environment.
2. Design a Data Structure for Ranking and Scores
Design a data structure that supports the following operations in logN or faster time complexity: 1) Find score by rank, 2) Find ranking by score, 3) Change score to update ranking, 4) Add or remove data. Propose a solution and discuss how you would implement it, possibly using a customized binary search tree (BST).
3. Schedule Tasks Problem
You are given a bunch of tasks and a helper function 'nextTasks' that always provides the current tasks that need to be done. The basic approach is to continuously check 'nextTasks' using a for loop, start threads as needed, and ensure to save the currently completed task. Additionally, there is a requirement to exit all global tasks if one task fails. Provide a solution in Go or Python, discussing how you would handle these requirements.