โ† All CDT Flashcard Decks

Automation & Scripting Flashcards

7 cards from real CDT practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Automation & Scripting flashcards as text
  1. A Python script uses PyPDF2 to merge documents but the output PDF has scrambled fonts. What is the MOST likely cause?

    Answer: Source PDFs use embedded subsets that are not properly reconciled during merge

    When PDFs with subsetted (partially embedded) fonts are merged, font resource name conflicts can cause glyphs to map incorrectly in the combined file.

  2. Which PowerShell cmdlet would you use to iterate over all DOCX files in a directory and its subdirectories for automated processing?

    Answer: Get-ChildItem -Path . -Filter *.docx -Recurse

    Get-ChildItem with -Recurse traverses all subdirectories and -Filter restricts results to files matching the wildcard pattern.

  3. A document automation script must insert a watermark only on pages that contain the phrase 'CONFIDENTIAL'. What technique enables this conditional logic?

    Answer: Parsing each page's text layer, checking for the phrase, then conditionally stamping only matching pages

    Extracting the text layer per page and testing it with a string search or regex allows the script to selectively apply the watermark only where appropriate.

  4. When scheduling automated document processing jobs on a Linux server, which tool is most commonly used to define time-based execution?

    Answer: cron (crontab)

    cron is the standard Linux scheduler; crontab entries define the schedule (minute/hour/day/month/weekday) and the command to run.

  5. A script that automates form filling must handle a PDF where some fields are read-only. What should the script do when it encounters a read-only field?

    Answer: Skip the field or log it as a warning without attempting to write to it

    Attempting to write to a read-only field will fail or corrupt the document; the script should detect the read-only flag and log a warning instead.

  6. In document workflow automation, what is a 'dead letter queue'?

    Answer: A holding area where messages or documents are placed when processing fails repeatedly and cannot be retried automatically

    A dead letter queue captures documents that have exhausted retry attempts so they can be inspected and reprocessed manually without blocking the main workflow.

  7. Which approach provides the MOST reliable way to detect whether an automated document conversion succeeded without opening the output file?

    Answer: Validate the output file's structure (e.g., PDF header, page count) and compare against expected values

    Structural validation (checking the PDF header, page count, and key metadata) catches corrupt or truncated outputs that a simple file-size or exit-code check would miss.