Here is some data - create a class for it and implement a few features on top of it.
Asked in the first round technical stage. The one-hour interview was described as creating a class and implementing a few features with data provided, rather than solving a LeetCode problem.
Implement DataCollection for records represented as dictionaries with a unique id. Support adding records, removing by ID, filtering by an exact field value, sorting by a field, and counting records by a field. The helper run_operations(records, operations) must return one result per operation.
records is a list of dictionaries.add, remove, filter, sort, or count.def run_operations(records, operations):