#329 Parallel Fetching of Profile Data

Companies:
Lighthouse
Themes:
JavaConcurrencyPractice

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

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