#329 Parallel Fetching of Profile Data
Implement the getProfileInfo method:
public static class ProfileInfo {
public UserInfo userInfo;
public CompanyInfo companyInfo;
}
public static class UserInfo {
public String name;
public String age;
}
public static class CompanyInfo {
public String id;
public String companyName;
}
// the method must complete in 1 second
public ProfileInfo getProfileInfo(Long id) {
// TODO implement
}
private UserInfo getUserInfo(Long id) {
// external service call takes approximately 1 second
}
private CompanyInfo getCompanyInfo(Long id) {
// external service call takes approximately 1 second
}
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor