Pergunta de entrevista da empresa Salesforce

How would you implement a read/write lock for a table in a database?