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.