Practice: Extend an Unfamiliar System and Learn a New Query
Extend an unfamiliar system using only its supplied documentation, as practiced in Palantir's FDSE learning round. Map each documented rule to a stage in a new query language, choose a stage order that selects current state before filtering, and predict complete ordered outputs before running code. Extend the same function for a changed requirement, handle missing and unmatched values exactly as documented, and write checks that expose ordering and mutation bugs.
device_queue.py already exposes open_history(tables), and the repository includes a complete tuple-query runtime. Your handoff is to add current_open_queue(tables, unassigned_only=False) while preserving the existing function and engine. The application needs a queue of devices that are open now, including devices missing from its registry. The challenge is making the supplied contracts determine your implementation and expectations.
What must change in device_queue.py?
A December 2025 Government FDSE candidate report described receiving a database schema and documentation, then implementing functions using them. That account supports practicing documentation-driven work; it does not predict a particular language or guaranteed interview format.
The language and application here are course-authored preparation materials, not Palantir technology, a reported interview question, or an official scoring rubric. You receive a complete runtime: Implementing a parser or query engine is outside the task.
Use the independent Python 3.12 workspace supplied below. It starts with four files and generates a fifth after both recorded attempts:
tuple_query.py: The complete, read-onlyrun(tables, stages)runtime.device_queue.py: The existing history wrapper and your extension stub.test_device_queue.py: The ordered fixture, existing history regression, and space for your checks.device_query_contract.txt: The documentation packet and fixture.device_queue_solution.txt: The worked implementation and traces, generated after both recorded attempts. This static workspace cannot securely conceal the solution generator intest_device_queue.py; do not read ahead.
Do not import or change files from earlier exercises. Your implementation and prediction fields start empty. First implement the default queue; a follow-up request will appear after that attempt.