← 返回 coinbase 的题目列表Database Design and Implementation
类型:online_judge
You need to design a database and implement the following features:
Store Data: Design a method to store the given data.
Read Data: Implement a method to read stored data by key.
Scan Data: Implement a method to scan and return data that meet certain criteria.
Expiry Time: Add an expiry time parameter for the data, so the data becomes invalid after expiry.
Backup Data: Implement a backup feature to save the current state of stored data.
Write corresponding Python methods for each feature and complete the implementation based on example test cases. Ensure the code is reusable and meets the requirements for each stage. Test cases include: input of string and integer types, operations like store, read, and scan.
Example
Input
store 'key1' 'value1' 1000