#538 Adaptive Loading of Valid Accounts

Companies:
DigitalSector
Themes:
JavaConcurrencyPractice

There is service A and authorization service B.

The DataService class is used to obtain accounts from service B over REST. It has three methods:

  • dataService.getCount() returns the number of accounts;
  • dataService.getPersons(int from, int to) returns accounts from service B ordered by index in the range from from to to;
  • dataService.getAllPersons() returns all accounts ordered by index.

These methods cannot be changed.

Some accounts are known to contain additional heavy data in Person.description. Because of this, the gateway may block the response due to a response-body size limit.

Implement the fastest possible retrieval of all valid Person objects.

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in