Marqeta Interview Question

How to implement locking on resources. Pros/cons