FastPrepValidate and Resolve Evaluation Chains
Problems/Validate and Resolve Evaluation Chains

Validate and Resolve Evaluation Chains

Plaid logoPlaid● MediumFULLTIMEINTERNPHONE SCREENONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The report directly preserves evaluation-to-evaluation or Boolean links, multiple independent chains, final truth values, and cycle invalidation. The judged contract adds deterministic serialization and dangling-reference handling and matches the report at about 95%.

Special thanks: 🌷 A special thank you to a lovely, amazing fren who shared that this question appeared again on October 29, 2026! (˶˃ ᵕ ˂˶) .ᐟ.ᐟ 🩵

Each row of links is [evaluation, target]. A target is either another evaluation name or the literal true or false. Evaluation names are case-sensitive; the two literals are case-insensitive.

Every evaluation must eventually reach one Boolean literal. A duplicate definition, a reference to an undefined evaluation, or a cycle makes the complete input invalid; return ["INVALID"].

Otherwise, return one name:value string for every evaluation, sorted by name.

This result also exposes the two rule-chain decisions: the rules are valid exactly when the output is not ["INVALID"], and they are eligible exactly when they are valid and every resolved value is true. Cycles and missing rules are detected as invalid inputs.

Function

evaluateChains(links: String[][]) → String[]

Examples

Example 1

links = [["E1","E2"],["E2","true"],["E5","false"]]return = ["E1:true","E2:true","E5:false"]

E1 follows E2 to true, while E5 is an independent false chain.

Example 2

links = [["A","B"],["B","A"]]return = ["INVALID"]

A and B form a cycle.

Example 3

links = [["check","missing"]]return = ["INVALID"]

The referenced evaluation has no definition.

Constraints

  • 1 <= links.length <= 10^5.
  • Names are non-empty ASCII alphanumeric strings and are never the reserved literals.

More Plaid problems

  • Total Pipeline Completion TimePHONE SCREEN · Seen Sep 2026
  • Rule References: Validity and EligibilityPHONE SCREEN · Seen Aug 2026
  • Bounded Token-Bucket Request QueueONSITE INTERVIEW · Seen Jul 2026
All Plaid interview questionsSee Plaid hiring insights
Saved
class Solution {
    public String[] evaluateChains(String[][] links) {
        // Write your solution here.
    }
}
Checking account…