← revolut Interview Insights

revolut·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Revolut technical screen for a software engineer role. The whole thing was basically one meaty concurrency problem about bank transfers, which makes sense given what they do. Not a bad experience but it definitely tests whether you actually understand locks or just know the buzzwords.

Questions Asked (1)

Q1

Design and implement a thread-safe bank transfer function that moves money between accounts atomically, handles concurrent calls correctly, and avoids deadlocks.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

This is the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (e.g., single-process vs distributed, blocking vs non-blocking) and then present a solution that uses fine-grained locking with a global lock ordering to prevent deadlocks. Emphasize atomicity via locks or transactional memory, and discuss trade-offs like lock contention, throughput, and alternative approaches (e.g., optimistic concurrency, STM).

Pro tip: Mention that in real-world systems like Revolut, you'd likely use a database transaction with row-level locks or a distributed lock service, but for an in-memory implementation, lock ordering is key. Also, consider using a lock manager or tryLock with timeout to avoid deadlocks entirely.

1. Clarify Requirements and Constraints

Ask about the environment: single JVM or distributed? Are accounts in-memory or in a database? What are the performance and consistency requirements? This shows you think before coding.

2. Design the Data Model and Locking Strategy

Define an Account class with a balance and a lock. Choose a locking strategy: e.g., lock both accounts in a consistent order (by account ID) to prevent deadlocks. Alternatively, use a single global lock for simplicity, but discuss its drawbacks.

3. Implement the Transfer Function

Write pseudocode or actual code: acquire locks in order, check sufficient funds, debit one account, credit the other, release locks. Ensure atomicity: either both operations succeed or neither does (e.g., using try-finally to release locks).

4. Analyze Concurrency and Deadlock Avoidance

Explain how the lock ordering prevents deadlocks (circular wait). Discuss other issues: race conditions, visibility (use synchronized or ReentrantLock), and potential for lock contention. Mention alternatives like optimistic concurrency with retry.

5. Discuss Trade-offs and Extensions

Compare fine-grained vs coarse-grained locking, blocking vs non-blocking, and single-node vs distributed. Mention how you'd handle failures, timeouts, and scalability. This demonstrates depth and awareness of real-world systems.

Key Points to Mention

  • Deadlock prevention via global lock ordering (e.g., always lock lower account ID first).
  • Atomicity: ensure the transfer is all-or-nothing, using locks or transactions.
  • Thread safety: use synchronized blocks, ReentrantLock, or atomic references.
  • Performance: lock contention, throughput, and scalability concerns.
  • Alternative approaches: optimistic concurrency (CAS with retry), software transactional memory, or database transactions.
  • Error handling: insufficient funds, lock acquisition failures, and rollback mechanisms.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.