← 返回 netflix 的题目列表Implement a Multithreaded Map
类型:online_judge
Implement a thread-safe map data structure in a multithreaded environment. Design this data structure so that it can safely perform insert, delete, and lookup operations. Ensure it performs stably even in high concurrency scenarios. Provide the function interface and relevant test cases. The data size should support up to 10,000 different key-value operations. Example:
# Example Input:
put('key1', 'value1')
put('key2', 'value2')
get('key1') -> 'value1'
delete('key2')
get('key2') -> None
Provide at least 5 different input test cases.
Example
Input
put('key1', 'value1')
get('key1')
put('key2', 'value2')
get('key2')
delete('key1')
get('key1')