2dbi

Resolve loan status from dispute events (+ fix failing tests)

viaGlassdoor

You are given an existing program for evaluating loans. A loan can have multiple dispute events, each with a status of OPEN, CLOSED, or FRAUD. Complete the method that, given an ArrayList of dispute events for a single loan, returns the loan's final status according to these rules (evaluated in priority order):

  1. If any dispute is FRAUD → return FRAUDULENT.
  2. Else if any dispute is OPEN → return UNDER_INVESTIGATION.
  3. Else (all disputes are CLOSED) → return OK / valid.

Some helper methods are already implemented. As a second part, a few unit tests are failing — find and fix the bug in the existing helper code.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account