revolut logo
Revolut· Graduate Java Developer

Graduate Java Developer

Posted
14 Oct 2026
3 reads

Summary

I faced a load balancer design problem during a Graduate Java Developer interview at Revolut.

How it went

Interview Question: Implement a Load Balancer in Java

I encountered this question during a Graduate Java Developer interview at Revolut and thought it would be interesting to discuss with the LeetCode community.

Problem Statement

Implement a simple load balancer that acts as a registry for services and their instances.

The load balancer should maintain a record of registered service instances, identified by their addresses.

Requirements

  1. Register an instance: The load balancer should allow a new service instance to be registered using its address.
  2. Unique addresses: Each address must be unique. Registering the same address more than once should not be allowed.
  3. Maximum capacity: The load balancer should accept a maximum of 10 addresses.
  4. Service registry: The registry should be updated whenever a new service instance comes online.

Example

Suppose we register the following addresses:

register("192.168.1.1");
register("192.168.1.2");
register("192.168.1.1"); // Duplicate address

The first two registrations should succeed, while the third should be rejected because the address is already registered.

Once 10 unique addresses have been registered, any additional registration should be rejected.

Questions for discussion

  • Which Java data structure would you use to store the registered addresses, and why?
  • How would you prevent duplicate registrations?
  • How would you enforce the maximum capacity of 10 addresses?
  • How would you design the register() method to handle these cases cleanly?
  • What additional considerations would matter if multiple threads tried to register instances simultaneously?

I'd be interested to see different Java implementations and hear how others would approach this problem in a coding interview.

Questions asked (1)

  1. 01

    Load Balancer Implementation

    Data Structures & Algorithms

    Problem Statement

    Implement a simple load balancer that acts as a registry for services and their instances.

    The load balancer should maintain a record of registered service instances, identified by their addresses.

    Requirements

    1. Register an instance: The load balancer should allow a new service instance to be registered using its address.
    2. Unique addresses: Each address must be unique. Registering the same address more than once should not be allowed.
    3. Maximum capacity: The load balancer should accept a maximum of 10 addresses.
    4. Service registry: The registry should be updated whenever a new service instance comes online.

    Example

    register("192.168.1.1");
    register("192.168.1.2");
    register("192.168.1.1"); // Duplicate address
    

    The first two registrations should succeed, while the third should be rejected because the address is already registered.

    Once 10 unique addresses have been registered, any additional registration should be rejected.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Revolut recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!