FastPrepBounded Service Instance Registry
Problems/Bounded Service Instance Registry

Bounded Service Instance Registry

Revolut logoRevolut● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A reported graduate interview task backs this exercise. You implement a registry of services with unique addresses and a capacity of 10, and discuss registering at the same time. We chose the batch interface and the clear result labels. They keep the rule that a duplicate is found before the capacity check, and that checking and inserting must happen as one atomic step. The main task is about 90% the same as the reported question.

Implement the registration behavior for an in-memory service-instance registry. Process the attempted instance addresses from left to right and return one outcome for each attempt.

  • Return REGISTERED and store an address when it is new and fewer than 10 unique addresses are stored.
  • Return DUPLICATE when the address is already stored, including when the registry is full.
  • Return FULL when the address is new but 10 unique addresses are already stored.

Each result models one atomic register call. In a shared concurrent implementation, the duplicate check, capacity check, and insertion must occur in one critical section.

Function

registerInstances(addresses: String[]) → String[]

Examples

Example 1

addresses = ["192.168.1.1","192.168.1.2","192.168.1.1"]return = ["REGISTERED","REGISTERED","DUPLICATE"]

The repeated address is rejected without consuming capacity.

Example 2

addresses = ["a","b","c","d","e","f","g","h","i","j","k"]return = ["REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","REGISTERED","FULL"]

After ten unique registrations, an eleventh unique address is rejected.

Constraints

  • 0 <= addresses.length <= 100000.
  • Every address has length from 1 to 100.
  • Addresses are case-sensitive opaque strings.

Source note: The source image is a source-neutral excerpt of the author-reported prompt.

More Revolut Phone Screen questions

  • In-Memory URL ShortenerPHONE SCREEN · Seen Jun 2022

Similar questions at other companies

  • Rank-Based Cache with a Data SourceLinkedIn · PHONE SCREENLinkedIn interview questions
  • Single-Flight Chunk CacheModal · PHONE SCREEN
  • Cache an Expensive Service Across ThreadsOracle · ONSITE INTERVIEWOracle interview questions
  • Blocking Connection Pool Operation TraceGoogle · ONSITE INTERVIEWGoogle interview questions
  • Thread-Safe Task Storage and Worker DispatchNuro · ONSITE INTERVIEWNuro interview questions
  • Config Store with Priority OverridesMicrosoft · PHONE SCREENMicrosoft interview questions
  • ID Allocator with Assign and ReleaseSnap Inc. · PHONE SCREENSnap Inc. interview questions
  • Feature Flag EvaluationCVS Health · PHONE SCREEN
  • Smart Queue of Latest PricesCitadel · PHONE SCREENCitadel interview questions
  • In-Memory Key-Value Store OperationsOpenAI · PHONE SCREENOpenAI interview questions
All Revolut interview questionsSee Revolut hiring insights
Saved
class Solution {
    public String[] registerInstances(String[] addresses) {
      // Write your code here.
    }
}
Checking account…