Automation Coding Concepts
AutoOps+ · 62 questions
- A city 311 routing script declares a queue name at module scope, then a helper function assigns the same name to a temporary overflow queue. Overnight tickets land in the overflow queue citywide. What change keeps the helper from overwriting the citywide ticket queue name?
- A county permits portal must send weekend submissions to an on-call clerk queue instead of the weekday planner queue. Which conditional pattern correctly implements that after-hours routing?
- A county assessor job must apply the same valuation patch to a fixed list of parcel identifiers already loaded in memory. Which loop construct is most appropriate?
- A water-utility meter sync job hard-codes a single plant ID inside the sync function. Crews need the same function for three plants next quarter. Why should the plant ID become a function parameter instead?
- A library Wi-Fi guest-access script should record whether voucher creation succeeded or failed. Which logging practice best meets that goal without exposing resident PII?
- Courts clerk exports arrive as semi-structured email text containing case numbers like CV-2026-01482 mixed with free-form notes. What is the best use of regex in the intake automation?
- Housing-authority automation must send a waitlist status update to an HTTP API and also keep human-editable runtime settings for batch size and retry count. Which representation pairing is most appropriate?
- A parks reservation script multiplies pavilion capacity (an integer) by remaining open days. A developer concatenates the capacity value with a string status code before the math runs, producing nonsense totals. What went wrong?
- School-district wireless controller logs are large text files. Technicians need only lines that show failed DHCP renewals. Which CLI approach best fits?
- A daily 311 export is a delimited text file with a category column. Analysts want a quick per-category ticket count on the jump host. Which tool is the best fit?
- Transit AVL automation scripts still reference a deprecated hostname after a depot rename. Operators need a reliable in-place string replacement across many script files. Which CLI helper is the appropriate choice?
- An open-data portal returns nested JSON for streetlight outage records. A night job must pull only the outage status field from each object. Which CLI tool is designed for that extraction?
- County IT needs a repeatable inventory of services on Windows jump hosts used for after-hours admin. Which approach best fits PowerShell automation?
- An EMS CAD status poller retries after transient timeouts. A naive retry calls the 'create incident ticket' API again and duplicates tickets. What must a safe retrying function ensure?
- Developers validating an elections ballot-dropbox sensor parser cannot reach live hardware in the lab. How should they still unit-test the parse logic?
- Several city departments import a shared module that syncs SSO group membership. The module's maintainers need a practice that keeps updates safe for every consumer. Which choice is best?
- A public-health lab automation job expects a CSV of specimen rows. Occasionally the file arrives with a valid header but zero data rows. What is the safest automation behavior?
- A fire-station printer deploy script can change device settings across many sites. Operators want a preview of intended changes before anything is applied. Which parameter pattern best supports that?
- A sanitation route-optimization job should record routine completion and also highlight API authentication failures. How should log levels be used?
- A maintenance-window script must accept a list of library branch codes from a config file. Which YAML form correctly represents that list as script input?
- Building services wants a reproducible way to package a permits plan-review helper and its OS-level dependencies for every county runner. What role does a Dockerfile play?
- County build agents install Python libraries for an assessor geocode utility. Last month an unpinned dependency floated to a breaking release overnight. What should the team do?
- Courts IT considers bumping a major version of a library used by the e-filing notifier before the next production cut. Why does that change need careful review?
- City Linux automation runners need a container base image policy. Which practice best matches a minimal trusted base image approach?
- A transit GTFS validator must produce the same dependency tree on every CI agent. How do lockfiles differ from floating version ranges for that goal?
- A school-district automation team maintains shared Python modules used by several campus scripts. Installs from the public PyPI index keep failing authentication for those private modules. What should the team configure?
- A city open-data team containerizes an ETL helper. Build tools and compilers are needed during image creation but must not remain in the image that runs in production. Which Dockerfile practice best meets that goal?
- A county jump host needs the jq command available in interactive shells and cron jobs, not as an importable Python library. How should jq be provided?
- A municipal platform engineer finishes local edits to 311 bot playbooks and wants those changes recorded in Git before anyone else reviews them. Which local sequence is correct?
- A laptop clone of the city’s GitLab automation repo is behind the remote main branch. The engineer needs remote-tracking refs updated and the local branch integrated with the remote’s latest commits. Which approach is appropriate?
- The city’s permits API client library removes a response field that calling scripts previously required. Which semantic version bump should the maintainers publish?
- A parks department developer is fixing a reservation bug and must keep work isolated until peer review. What source-control practice should they follow?
- County finance needs a stabilized cut of the tax portal for a quarterly hotfix window while feature work continues elsewhere. Which branching approach fits that need?
- County IT wants Git branch names that support audit reviews of who changed which automation ticket. Which naming convention best supports that goal?
- Housing-authority casework scripts briefly contained a cloud API key in a working-tree file. What source-control control best stops that secret from being committed?
- Public-works IoT automation jobs must meet a shared Python style guide before code reaches CI. Which practice enforces that earliest?
- Clerk workflow automations need Git history that auditors can understand months later. Which commit practice best supports that?
- Several technicians share an elections-office workstation used for Git commits to automation repos. Commits have been attributed to the wrong person. What should each technician configure before committing?
- The library catalog sync tool reached a build the team wants to mark as releasable for operations. How should that milestone be recorded in Git?
- The city’s IaC monorepo protects main so infrastructure changes receive review. Why are direct commits to main typically blocked?
- A developer updates a 311 feature branch that diverged from remote main and plans to rebase onto the latest mainline commits. What should they do first?
- The open-data portal client library adds a new optional endpoint while keeping all existing endpoints behaviorally unchanged. Which SemVer bump is appropriate?
- Maintainers fix a typo in generated text inside an EMS runbook generator without changing any API contracts or observable behavior for callers. Which SemVer bump applies?
- City automation teams struggle with painful merges after weeks of isolated work. Which branching practice reduces that merge pain?
- Multiple city departments need the same VPC networking pattern in IaC. Copy-pasting the networking code into each department repo has caused drift. What IaC approach should they adopt?
- Permits web nodes were patched by SSH hotspot edits, and each server now differs. Leadership wants immutable infrastructure practices instead. What change aligns with immutability?
- A library kiosk lockdown configuration must be safe to apply repeatedly during nightly automation. What IaC property ensures repeat runs converge to the same end state without compounding changes?
- County security wants firewall baselines expressed as the end state the devices should have, leaving the tool to calculate required changes. Which IaC style is that?
- EMS needs a brand-new jump box built once before any declarative agent can manage it. Which approach is still appropriate for that first bootstrap?
- School-lab account automation must create a standard student user when missing but must not error if the account already exists on a re-run. Which semantics should the job use?
- A transit authority wants AVL worker nodes that never accumulate one-off SSH patches. Which IaC immutability practice should the ops team follow?
- A parks department needs identical Wi-Fi SSID definitions across twelve park sites without copying the same block into twelve separate files. What IaC reusability approach should they use?
- A 311 platform team wants the worker replica count expressed as desired state rather than scaling pods by hand during every storm surge. Which approach matches declarative IaC?
- After a weekend emergency, a county engineer discovers undocumented console changes on the permits firewall. How should the team treat the IaC repository going forward?
- An assessor import job exits immediately with a parser complaint and never opens the county GIS API. What class of code life-cycle problem is this?
- A public-health notification script fails with an undefined-variable error after someone renamed the LABFEEDURL environment variable but not every reference. What should the technician conclude?
- A courts e-filing notifier starts cleanly, then crashes when the API returns an unexpected null for a docket field. How does this differ from a syntax failure?
- Two city engineers edited the shared Ansible inventory for library branches and a pull request now shows conflict markers. What does that indicate for the integration?
- A librarian checks out an old catalog-sync tag to compare behavior and then makes a new commit that never appears on any branch tip. What Git state explains this?
- A municipal platform engineer cannot push playbook updates; the remote returns authentication failure. What is the most likely cause among code life-cycle Git issues?
- A permits portal workflow YAML shows conflict markers after two hotfixes landed on the same lines. What should the engineer do before the pipeline can run again?
- A sanitation route job finds its CSV on a technician's laptop via a relative path but fails on the municipal CI agent with a missing-file runtime error. What should the team recognize?