LESSON 9 · Advanced

Interview lab: design, troubleshoot and code

Plain-English notes, code examples, IBM i commands, and a checkpoint before the deeper question bank.

Practise this lesson with saved progress →

After this lesson
In this guide · 3 sections
  1. Use a repeatable answer frame
  2. Find the hidden failure window
  3. Explain code in both RPG styles

Learning notes

Use a repeatable answer frame

For a design question, state the business goal and constraints first. Then name the object or service you would use, show the data and job flow, and explain authority, commitment, monitoring, and recovery. End with one trade-off and one test that would change your decision.

For a troubleshooting question, state the symptom you would measure, the first log or command you would inspect, and the safe mitigation. Interviewers are looking for a controlled investigation, not a list of commands.

  1. Clarify the goal and constraints
  2. Choose the smallest IBM i design that fits
  3. Name failure, authority, and consistency behavior
  4. Describe observability and recovery
  5. Give a test and a measured trade-off

Find the hidden failure window

Tricky questions often hide an assumption: a library list is stable, a queue entry is processed once, a record is unlocked, a service program interface never changes, or a batch job can simply be rerun. Challenge the assumption and offer a safer design with an operator path.

When a requirement is ambiguous, state what you would ask before coding. A short clarifying question can prevent a technically correct answer from solving the wrong problem.

A compact investigation checklist

DSPJOB JOB(*) OPTION(*JOBLOG)
DSPLIBL
DSPOBJAUT OBJ(APPDATA/*ALL) OBJTYPE(*ALL)
WRKACTJOB SBS(*ALL)
DSPJOBQ JOBQ(APPDATA/BATCHQ)

Explain code in both RPG styles

The fixed and fully free examples should express the same business behavior. In an interview, describe the input, lookup, status check, update, and test cases before showing source. Mention what you would add in production: prototypes, error handling, commitment scope, logging, and a concurrency decision.

Keep the code skeleton intentionally small. The goal is to show safe control flow and the questions you would resolve with the team, not to pretend a five-line snippet is a complete application.

Safe update skeleton

Fixed format

FProducts        UF   E             K DISK
C     productId    CHAIN     ProductRec
C                   IF        %FOUND(Products) AND newQty >= 0
C                   EVAL      quantity = newQty
C                   UPDATE    ProductRec
C                   ENDIF

Fully free

**FREE
dcl-f Products keyed usage(*update);
chain productId ProductRec;
if %found(Products) and newQty >= 0;
  quantity = newQty;
  update ProductRec;
endif;

Open the detailed question chapters

Quick Revision · 2-minute recap

Keep these in mind

  • Clarify inputs, outputs, volume and business invariants first.
  • Explain why an operation fits the requirement.
  • Name the normal, boundary and failure paths.
  • Account for locks, rollback, retries and restart behavior.
  • Prove the outcome with test evidence, not just successful compilation.

Reasoning flow, not executable code

read → validate → change → commit
conflict → preserve evidence → reject or bounded retry

Common mistake: A confident opcode name is not a complete design explanation.

Think it through

Two users change the same customer. What should your answer include?

Show the reasoning

Explain locking or version checking, conflict feedback, transaction ownership and a test proving stale updates are rejected.

Practice checkpoint

Answer all five, then review the explanations. The interactive site stores your completed learning checkpoints in this browser.

  1. 1. Who should commit an order that changes stock and accounts?
    1. Each low-level update independently
    2. The printer program
    3. The queue consumer before validation
    4. The coordinator of the complete order unit
  2. 2. Does normal job termination prove every intended row was posted?
    1. No
    2. Yes, always
    3. Only for CLLE
    4. Only on an empty queue
  3. 3. Which is the best response to an absolute performance claim?
    1. Accept it because the opcode is older
    2. Compare equivalent operations and measure the workload
    3. Reject all measurements
    4. Choose the shortest source line
  4. 4. CPF9801 usually means:
    1. The object was not found in the job's resolution context
    2. The printer has no paper
    3. A cursor reached end of data
    4. The service-program signature is valid
  5. 5. Complete the keyed RPG read: _____ customerId CustomerRec;
    1. chain
    2. setll
    3. read
    4. update
Show answer key and explanations

1. D — The coordinator of the complete order unit The complete invariant must hold before the unit commits.

2. A — No Business completion needs explicit counts/outcomes and transaction verification.

3. B — Compare equivalent operations and measure the workload Semantics and measured conditions matter more than folklore.

4. A — The object was not found in the job's resolution context Confirm the qualified object, type, library list, and dependent objects before changing code.

5. A — chain CHAIN retrieves a record by key and sets the found status used by the following condition.

IBM documentation for this path