AO
Back

Source Key-Value Override in First-Seen Order (NXT OA)

OAAsync OALast reported October 2025Low Frequency

Problem Overview

Online assessment (NXT Engineering Test): the first of two coding problems.

You are given sources, a 2D array of strings. Each row is one source: a list of key-value entries such as P1:a. Return a 1D array of strings with one value per key, where

  • a later source overrides the value an earlier source gave the same key, and
  • the keys come out in the order they were first seen.

Example (as posted)

sources:
  P1:a  P3:b  P5:x
  P1:b  P2:q  P5:x

output: b b x q

The keys first appear in the order P1, P3, P5, P2. P1's value a from the first source is overridden by the second source's b, but P1 keeps its first position.

Notes from the report

  • The poster calls the description convoluted but the problem itself simple string processing.
  • Not reported, so confirm before coding:
    • the exact entry format: one "KEY:value" string per entry (as here), or key and value in separate cells, and whether spaces can sit around the colon (the post writes both P1: a and P3:b);
    • what happens if one source lists the same key twice.
  • No input sizes were reported.

What Reports Emphasize

Observed variants: Given a 2D array of sources with key-value pairs (e.g., P1:a, P3:b, P5:x), return a 1D array of values in order of first appearance, where later occurrences of the same key override earlier values.

Practice

Write your own against 8 test cases, or read the worked solution — approach, complexity, and code that runs.

Prepping for Citadel with friends?

Send them this page. It is free to read, no account needed.

More Citadel Questions

Free preview

Every question in the Citadel catalog gets this depth

What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 62 Citadel questions, refreshed monthly from new candidate reports.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
Citadel · OA · Reported 1× across candidate reports
Is this helpful?