Implement an in-memory database with record locking | Meta Interview Question