Andersen Lab interview question

Code: Q1. Design and implement a distributed cache system in Java, capable of handling high-throughput read and write requests across multiple nodes. The goal is to ensure data consistency and fault tolerance in case of node failures. Implement the following features: 1. Data Partitioning: Use consistent hashing to distribute data across multiple cache nodes. 2. Fault Tolerance: When a node fails, ensure that its data is redistributed to other nodes without losing information. 3. Read and Write Operations: Provide efficient APIs for put(key, value) and get(key) operations. 4. Concurrency: Ensure thread-safe operations for the cache. 5. Scalability: Allow dynamic addition and removal of nodes without affecting system performance. Constraints: • Implement the solution in a single Java class for simplicity. • Do not use third-party libraries for consistent hashing. Deliverables: • A working Java implementation of the distributed cache. • Explanation of your design decisions, including trade-offs.