Actors
- Legacy developer and language specialist
- Claims policy SME
- Review lead assigning queues
- Auditor tracing rule to source
- Modernization engineer consuming approved rules
- Pipeline operator managing extractors
MAINFRAME ARCHAEOLOGY / MOCK 05
Design a repeatable code-analysis factory that turns CMS-scale COBOL and Assembly into line-sourced business rules and a safe subject-matter expert (SME) review workflow.
OPENING PROMPT
Read this once, then begin aloud. Spend the first two minutes establishing contract, actors, risk and what must remain authoritative.
Design RuleMine, a static-analysis and review platform for a mock 18-million-line estate of COBOL, Assembly, JCL and copybooks. It must extract roughly 100,000 plain-language business rules, preserve exact source provenance, correlate duplicates across four claims systems, and let subject-matter experts verify, edit, reject and search rules. Re-running the same toolchain on the same snapshot must reproduce the same result.
Treat extraction as a compiler and evidence pipeline, not a single LLM prompt. Immutable snapshots, deterministic intermediate representations and versioned passes establish reproducibility; a model may phrase or classify candidates but can never invent provenance.
REQUIREMENTS
These are supplied mock numbers for sizing and follow-ups. Say your assumptions before using them.
HIGH-LEVEL DESIGN
Name the authoritative state, derived projections, asynchronous boundaries and the exact point where a business decision becomes durable.
STORAGE + ACCESS
The table is logical, not a mandate for one database. Choose physical stores after access patterns, transactions, retention and rebuildability are clear.
| Entity | Primary / unique key | Important fields and purpose |
|---|---|---|
| SourceSnapshot |
(estate_id, snapshot_id)
|
manifest_hash, vcs_refs, encoding, created_at, immutable |
| SourceUnit |
(snapshot_id, unit_id)
|
path, blob_hash, language, dialect, include_graph |
| IRNode |
(snapshot_id, toolchain_id, node_id)
|
opcode, normalized_operands, source_spans |
| FlowEdge |
(snapshot_id, toolchain_id, from_id, type, to_id)
|
control/call/data/include; derivation |
| RuleCandidate |
(snapshot_id, toolchain_id, candidate_id)
|
predicate_ir, outcome_ir, evidence_set_hash, confidence |
| RuleRendering |
(candidate_id, rendering_version)
|
canonical_text, sentence_span_map, model_manifest |
| RuleCluster |
(cluster_id, clustering_version)
|
member_candidates, similarity_evidence, status |
| ReviewDecision |
(candidate_id, decision_version)
|
reviewer, state, edits, reason_code, decided_at |
POST /v1/snapshots
Register manifest; content hashes make retry idempotent
202 {snapshotId,ingestRun}POST /v1/extraction-runs
Pin snapshot + toolchain bundle + configuration
202 {runId}GET /v1/rules?system=&program=&state=&cursor=
Search candidates/approved rules with facets
200 {rules,nextCursor}GET /v1/rules/{id}/evidence
Canonical text → exact spans + derivation graph
200 {sentences,spans,runManifest}POST /v1/reviews/claim-next
Lease a stratified review item
200 {leaseId,rule}POST /v1/rules/{id}/decisions
Expected version + lease + decision + reason
200 / 40900:00 → 30:00
Answers are written in a speakable first-person style. Turn on Practice Mode to hide them, answer aloud, then reveal one at a time.
Candidate · clear top-down answerThe goal is not to ask an AI model to summarize millions of lines. The goal is to produce rule candidates that a subject expert can inspect and reproduce. Every candidate must point back to the exact old code that supports it.
Why this mattersThis gives the interviewer a map before any boxes appear, and it makes the system's most important trust decision explicit.
Candidate · clear top-down answerVersion one imports source and build files, follows includes and calls, finds likely business conditions, groups similar rules, and gives experts a side-by-side review screen. It does not automatically replace the old system or claim perfect understanding.
Why this mattersA narrow first release keeps the design realistic. It also shows which tempting features can wait without weakening the core product.
Candidate · clear top-down answerParsing 18 million lines is manageable. Human review is the bottleneck: 100,000 candidates at seven minutes each means about 11,700 hours. This math tells us to prioritize high-risk rules and group duplicates before asking experts to review.
Why this mattersThe calculation is not about perfect forecasting. It identifies the part most likely to run out of capacity or delay users.
Candidate · clear top-down answerThe main records are a fixed source snapshot, source file, parsed node, relationship, rule candidate, readable wording, review decision, and tool version. A candidate's identity comes from its logic and evidence, not from fragile line numbers. The main reads are rules by business area, all evidence for one rule, callers and data sources for one program, and every review for one candidate. Those paths guide the database and graph indexes.
Why this mattersA small set of records is easier to reason about. Exact versions keep later changes from silently rewriting an earlier decision.
Candidate · clear top-down answerFirst we freeze and hash the source. Next we expand included files, parse each language, connect calls and data flow, find conditions that affect business outcomes, and create candidates. Every stage writes a versioned result so a failed job can restart safely. An AI model may improve wording from a small symbolic slice, but a verifier rejects any sentence that cannot point back to exact source evidence.
Why this mattersSeparating the work into repeatable passes exposes coverage gaps and makes failures restartable. The model is limited to wording after deterministic evidence exists.
Candidate · clear top-down answerEvery parsing step keeps a map back to the original bytes and lines. A rule candidate stores the smallest useful evidence graph. If one sentence in the readable rule has no supporting source span, the system marks it unsupported.
Why this mattersTracing one real request proves the boxes connect. It also exposes where we acknowledge success and where a retry may begin.
Candidate · clear top-down answerWe use several simple analysis passes because each answers one question. Parse the syntax, resolve includes, map control flow, summarize what each program reads and writes, connect programs, then trace backward from business outcomes to the conditions that caused them. Unknown syntax becomes an explicit unknown node rather than disappearing. We prefer a visible coverage gap over a confident rule built from an incomplete path.
Why this mattersThe deep dive starts only after the basic path is clear. Use one concrete example, then state the speed-versus-correctness choice.
Candidate · clear top-down answerSimilar rules should be grouped, not silently merged. We compare their condition shape, outcomes, domain terms, and meaning-based text fingerprints. A strict threshold gives fewer but safer groups; a loose threshold saves more review time but may mix different policies. The screen shows matches and differences, and a subject-matter expert makes the final merge decision.
Why this mattersEvidence must be visible to a reviewer. AI may help rank or explain, but it does not become the final authority.
Candidate · clear top-down answerImportant approvals use immediate database transactions. Extraction jobs may run more than once, so each job key includes the source snapshot and tool version; writing by content hash makes repeats harmless. Separate queues protect interactive review from large imports.
Why this mattersUse immediate agreement only for decisions that cannot be ambiguous. Let rebuildable views catch up and always show their freshness.
Candidate · clear top-down answerA parser must never skip unknown syntax quietly. It creates an explicit unknown node and shows which possible outcomes are affected. A tool version cannot ship if rare-instruction tests or parse coverage become worse.
Why this mattersA failure answer should name the uncertain state first. Then explain how the system learns the truth before it repeats an action.
Candidate · clear top-down answerThe reviewer sees plain rule wording beside highlighted source, the path through included files and calls, similar candidates, and policy links. A short lease prevents two people from silently deciding the same case; if it expires, the next reviewer still sees the earlier draft. They can approve, edit wording, split, group, reject, or report a tool bug. Every decision creates a new history record rather than overwriting the evidence.
Why this mattersThe review screen keeps evidence, uncertainty, and human authority together. Leases avoid duplicate work without hiding a previous reviewer’s reasoning.
Candidate · clear top-down answerBefore a new analyzer ships, run both old and new versions on the same frozen sample. Explain every changed candidate as wording-only, evidence growth, logic change, added, or removed. Large unexplained churn blocks the release.
Why this mattersStable IDs are part of the product contract. A side-by-side tool comparison separates genuine new understanding from accidental analyzer churn.
Candidate · clear top-down answerLegacy source is highly sensitive. Keep each customer's storage, search index, encryption keys, and worker access separate. Run parsers without open internet access and with strict CPU, memory, and file limits because source files are untrusted input. Send an approved AI model only the smallest symbolic slice, and never place raw source or secrets in general logs.
Why this mattersSecurity belongs in keys, tokens, workers, and logs. It is not a single box added to the diagram at the end.
Candidate · clear top-down answerMeasure parse coverage, unresolved calls, evidence-link success, review queue age, agreement between reviewers, and accuracy on a hand-labeled sample. Start with one language and one business area, then expand only when experts trust the evidence.
Why this mattersMetrics should cover user speed, system safety, and result quality. Rollout starts read-only and earns stronger automation with evidence.
Candidate · clear top-down answerA shared internal form helps compare languages, but it must keep language-specific details it cannot understand. More model context may improve prose but increases leakage and invention risk. The biggest mistake is one giant prompt over the whole codebase.
Why this mattersEvery design choice has a cost. Name the simpler alternative and explain which requirement makes the added complexity worth it.
Candidate · clear top-down answerIn short: freeze the old source, analyze it in small repeatable passes, keep an exact map back to original code, and give experts reviewable rule candidates. AI can explain bounded results, but deterministic analysis and human approval carry the trust.
Why this mattersThe recap should repeat the user flow, the main trust rule, the hardest failure, and the most important trade-off—not every component.
DOMAIN DEPTH
These mechanisms are the interview’s differentiators. Be able to redraw each from memory and defend its failure behavior.
Each transformation preserves an origin map and derivation edge, letting an auditor walk prose back to symbolic predicate, IR and sealed source bytes.
Similarity proposes families. It never erases the distinctions that can carry policy, date or system meaning.
FAILURE MATRIX
When the interviewer injects a fault, restate the violated assumption, change state or protocol, and name the new invariant.
| Injection | Recovery mechanism | Tempting wrong answer |
|---|---|---|
| 01Unsupported opcode | Opaque reachable IR + coverage impact | Silent omission |
| 02Include cycle | Cycle-aware expansion and bounded diagnostic | Infinite worker |
| 03Parser regression | Golden corpus + version rollback | Overwrite old run |
| 04Graph explosion | Procedure summaries and SCC fixpoint | Path enumeration |
| 05Model invents rule | Evidence-ID constrained render + verifier | Prose as truth |
| 06Toolchain churn | Differential migration report | Blind review transfer |
BOTEC
Use orders of magnitude to expose the bottleneck. State what this simple model omits.
INTERACTIVE SCENARIO
Estimate mock review days; change candidates, reviewer count and focused hours.
OPERATIONS + DELIVERY
A system is incomplete without observable user outcomes, staged deployment, rollback and an answer to “how will we know?”
INTERVIEWER TRAPS
Use these as flash cards. The right column is the compact sentence you want available under pressure.
| Trap | Better move |
|---|---|
| One giant LLM prompt | Use ordered deterministic passes. |
| Line number as identity | Pin blob hash plus origin span. |
| Unknown syntax ignored | Expose opaque reachable nodes. |
| Dedup means delete | Cluster while retaining variants. |
| Prose is canonical | Canonicalize symbolic predicate/outcome. |
| Only precision | Measure missing rules and estate coverage. |
DEFINITIONS
Define the term, then connect it to a concrete invariant in this design. Avoid dropping vocabulary as a substitute for reasoning.
FINAL MINUTE
RuleMine seals an immutable source manifest and runs a compiler-like, versioned series of preprocessing, IR, control/data-flow, slicing and candidate passes. Every derived node carries origin spans and pass lineage. A bounded model may render the symbolic candidate, but a verifier requires sentence-level evidence. Similar candidates form reviewable clusters rather than being erased. SMEs work from leased, stratified queues with side-by-side source and append-only decisions. Content-addressed tasks make retries reproducible; coverage gaps, toolchain differentials and conservative rollout keep modernization evidence trustworthy.
Rehearse again