摘要: Implement a thread-safe bounded blocking queue that has the following methods: BoundedBlockingQueue(int capacity) The constructor initializes the queu 阅读全文
posted @ 2026-07-16 12:50 北叶青藤 阅读(2) 评论(0) 推荐(0)
摘要: Suppose you are given the following code: class FooBar { public void foo() { for (int i = 0; i < n; i++) { print("foo"); } } public void bar() { for ( 阅读全文
posted @ 2026-07-16 07:05 北叶青藤 阅读(5) 评论(0) 推荐(0)
摘要: Suppose we have a class: public class Foo { public void first() { print("first"); } public void second() { print("second"); } public void third() { pr 阅读全文
posted @ 2026-07-16 05:43 北叶青藤 阅读(3) 评论(0) 推荐(0)
摘要: Given a URL startUrl and an interface HtmlParser, implement a Multi-threaded web crawler to crawl all links that are under the same hostname as startU 阅读全文
posted @ 2026-07-16 05:02 北叶青藤 阅读(4) 评论(0) 推荐(0)
摘要: import queue import threading import time # Create a queue q = queue.Queue() def worker(): while True: # Retrieve a task from the queue item = q.get() 阅读全文
posted @ 2026-07-13 04:33 北叶青藤 阅读(3) 评论(0) 推荐(0)
摘要: part 1. 给 时间 和 IP, 看在提供的input里面如果ip 超出了一个threshold,判断为机器人,output 机器人的ip input: following string, and threshold 1, ip11, ip21, ip14, ip14, ip25, ip3 is 阅读全文
posted @ 2026-04-06 12:01 北叶青藤 阅读(13) 评论(0) 推荐(0)
摘要: Problem: Storefront Log Rate Limiter You are given a stream of log events. Each event contains at least: timestamp: arrival time (assume integer secon 阅读全文
posted @ 2026-04-06 11:07 北叶青藤 阅读(9) 评论(0) 推荐(0)
摘要: You are given a string containing text and HTML-style tags (e.g., <div>, <p>, </div>). Your task is to determine if the "labels" or "tags" are correct 阅读全文
posted @ 2026-04-06 10:31 北叶青藤 阅读(9) 评论(0) 推荐(0)
摘要: A software system logs its execution traces as a sequence of program events. Each event records either a function call or a function return. Each entr 阅读全文
posted @ 2026-04-06 09:47 北叶青藤 阅读(38) 评论(0) 推荐(0)
摘要: Given a list of unique strings words. I needed to remove every string that was a prefix of any other string in the list. A string a was a prefix of st 阅读全文
posted @ 2026-04-06 08:43 北叶青藤 阅读(20) 评论(0) 推荐(0)