What is pessimistic locking in Rails? How do you use `lock`/`with_lock`, and what are the risks?

Topic: rails, Concurrency. Level: Intermediate.

The full answer to this question is available to Interview Reader members. See what is free and what Premium adds.