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