Explain CAP, indexing, locks, and logs | Bytedance Interview Question