#259 Calculating the Total Order Amount

Companies:
Sberbank
Themes:
JavaStreams & LambdasPractice

Use the Stream API to calculate the total value of the amount field:

@Value
@Builder
public class Order {
    String title;
    Double amount;
}

public class OrderService {
    private final List<Order> orders;

    public Double getTotalAmount() {
        // TODO: implement method. Use StreamAPI to calculate the total value of the amount field.
        return null;
    }
}

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