All practice tasks

Coding (Platform)

Checkout Work Queue

React · Easy · Derived State

Support agents use a checkout work queue to find orders requiring attention. The supplied React screen already renders records and controls, but it mixes tenants, ignores the minimum priority and leaves results in fixture order. Fix the derived list without replacing the existing screen.

Task

Make the status and minimum-priority controls show only the current tenant’s matching orders. Display the highest priorities first and the correct matching count after each change.

Contract

  • Component props: QueueApp receives records and tenantId. records contains {id,title,tenantId,status,priority}. IDs are unique ASCII strings. status is active or paused. priority is an integer 0..9. Props can be replaced after mount. Never mutate their arrays or objects.
  • Controls: Initial Status is active and Minimum priority is 0. The provided select elements produce valid values.

Acceptance criteria

  • Match tenantId exactly, then the selected status, then priority >= the selected minimum.
  • Sort by priority descending; equal priorities use ascending ASCII ID order. Do not sort by title.
  • Render only each matching row’s title and priority through QueueRows; do not expose tenant IDs.
  • Show N matching orders, where N counts the filtered results, and No matching orders when N is zero.
  • Control changes update the list immediately. New props update the list while preserving selected control values.

Constraints

  • At most 1000 records, with ASCII IDs of 1..40 characters and titles of 1..120 characters.
  • This is a UI filtering boundary, not a substitute for server authorization. Do not add authentication or a backend.
  • Filtering and sorting should take O(n log(n + 1)) time or better. No network requests are needed.

Editable files

  • src/QueueApp.jsx — Wire controls to the correct derived list.
  • src/selectors.js — Implement the small pure selector used by the component.
  • src/helpers.js — Optional helpers for this implementation.
  • tests/candidate.test.js — Add 2 new behavioral regressions; do not duplicate the supplied smoke test.

What this task practices

Checkout Work Queue is a coding (platform) interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as easy difficulty. It focuses on Technical Reasoning, Testing, Validation. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.