Analytics engineer: Transformation Tests and Contracts
Original technical interview practice in executable data contracts, SQL validation, independent oracles, coverage, freshness, compatibility, and release evidence.
These prompts are original practice. They are not questions from a named employer or a live hiring loop.
1.A model contract validates column names, physical data types, and nullability. All checks pass, but its amount field changed from cents to dollars without a type change. What does the pass fail to establish?
Show answer and explanation
- The tested nullability rule passed on the checked data
- The declared columns exist with the tested types
- The field's business unit and meaning stayed compatible
- A structural contract can be evaluated at all
Answer: The field's business unit and meaning stayed compatible
A structural schema check does not by itself validate units or business semantics. The same numeric type can represent incompatible quantities. Unit and meaning changes need corresponding contract and consumer validation.
2.A transformation is specified to produce
duration_seconds, but emits a numeric duration in milliseconds. Its schema still declares a numeric column. Which fixture directly tests the unit contract?Show answer and explanation
- The output column name has the expected spelling
- An input lasting 2 seconds must produce 2, not 2000
- The output column contains at least one non-NULL number
- The column can be sorted numerically without an error
Answer: An input lasting 2 seconds must produce 2, not 2000
A known-duration case tests the semantic conversion. Schema shape and numeric validity do not distinguish two seconds from two thousand seconds under the mislabeled output.
3.Source identifiers '001' and '1' are distinct by contract. A staging transform casts both to integers before generating keys. What test should expose the semantic loss?
Show answer and explanation
- Only agreement of the maximum numeric ID after normalization
- Distinct source identities must survive the conversion
- Only a non-NULL integer result for every source ID
- Only successful integer casting
Answer: Distinct source identities must survive the conversion
The conversion maps both strings to integer one, collapsing identities that the source contract distinguishes. Validation must test the intended identity semantics, not just successful casting.
4.An ordinary SQL table has
CHECK(finish_tick>start_tick)but no NOT NULL constraint onfinish_tick. A row hasstart_tick=4 andfinish_tick=NULL. Under CHECK semantics that permit TRUE or UNKNOWN, what happens?Show answer and explanation
- NULL is converted to start_tick+1 automatically
- The CHECK makes finish_tick non-NULL by definition
- The CHECK necessarily rejects the row as FALSE
- The CHECK alone permits the row
Answer: The CHECK alone permits the row
The comparison evaluates to UNKNOWN, which the stipulated CHECK semantics permit. A mandatory finish requires a separate presence rule or an expression that explicitly handles the missing value.
5.A data contract requires both endpoints and
finish_tick≥start_tick. A failing-row query uses WHERENOT(finish_tick≥start_tick). Why can it miss a row with NULLfinish_tick?Show answer and explanation
- The row is guaranteed valid because no violation row was returned
- UNKNOWN remains UNKNOWN under NOT and is not selected by WHERE
- SQL compares every NULL endpoint as positive infinity
- NOT automatically converts every NULL comparison into TRUE
Answer: UNKNOWN remains UNKNOWN under NOT and is not selected by WHERE
The predicate is neither true nor false for the missing endpoint. WHERE selects true rows only. A failing-row query must explicitly include missing required values rather than rely solely on negating the comparison.
6.A nullable foreign-key column permits NULL to represent an optional relationship. The table contract is later changed to require that relationship on every row. What must be added beyond checking non-NULL references exist?
Show answer and explanation
- Sorting rows by the dimension label before checking references
- Only a wider integer key type
- Reference existence assumed to prove the value is present
- A required-presence rule for the key
Answer: A required-presence rule for the key
Existence checks on supplied references and required presence are distinct rules. A relationship allowed to be absent must gain an explicit non-NULL or equivalent requirement when the business contract makes it mandatory.
7.A composite relationship requires
tenant_idanditem_idto be either both present or both absent. Its configured foreign-key mode skips checking if either component is NULL. Which extra validation is needed?Show answer and explanation
- A skipped check interpreted as proof of all-or-none presence
- Reject partially missing key pairs
- Only duplicate fully present pairs
- Any supplied component treated as a complete relationship
Answer: Reject partially missing key pairs
A mode that skips partially NULL keys does not enforce all-or-none presence. The source/consumer contract needs a matching presence constraint or an appropriate supported composite-key mode.
8.Every order line passes an amount≥0 check. A separate contract requires each order's line amounts to sum to its header amount. What does the row-level pass establish about that reconciliation?
Show answer and explanation
- The header total must equal the line sum
- Every order must contain exactly one line
- Nothing sufficient about the cross-row sum
- A row check automatically recomputes every related aggregate
Answer: Nothing sufficient about the cross-row sum
A row-local bound and an aggregate relationship are different invariants. Nonnegative lines can still sum to the wrong header amount. Reconciliation must use the defined order grain and applicable line population.
9.A validator checks a reference table's category only when a fact is inserted. The reference category later changes, making stored facts violate the intended rule. What enforcement gap does this reveal?
Show answer and explanation
- The reference category cannot affect an already stored fact
- Insert-time validation guarantees every future database state
- Later dependency changes are outside the insert-only check
- A passed insert check freezes the reference table automatically
Answer: Later dependency changes are outside the insert-only check
A cross-dataset rule can change truth when a dependency changes. Validating only one write path does not maintain that invariant continuously. Enforcement or recurring validation must cover the allowed dependency changes.
10.A load inserts child rows before their parents within one transaction. The engine supports a deferrable reference constraint, and the complete transaction will contain all parents. What useful guarantee can deferral provide?
Show answer and explanation
- Permanently disable reference integrity after the first child insert
- Make every intermediate statement visible as a completed release
- Validate referential consistency at the transaction's defined check point
- Allow the transaction to commit with missing required parents
Answer: Validate referential consistency at the transaction's defined check point
Deferral changes when the constraint is checked, not the required final relationship. It can permit a valid multi-step load while still rejecting a transaction that reaches its check point with broken references.
11.A validator checks row counts from one committed release and dimension membership from a later release while both datasets are changing. It reports a single consistent pass. What is missing?
Show answer and explanation
- A coherent snapshot or equivalent version context
- Only equal query durations
- Individually valid queries assumed to share one database state
- Faster queries assumed incapable of observing version changes
Answer: A coherent snapshot or equivalent version context
Checks over different states do not automatically describe any one published dataset. The validation needs a consistent snapshot, release/version pin, or another justified method matching the consistency claim.
12.A source introduces a new business-valid status Paused. A downstream contract currently allows Running and Stopped only. What should the contract-change process assess?
Show answer and explanation
- Dropping all Paused rows while claiming complete coverage
- Consumer semantics and compatibility of the revised domain
- Widening accepted values until the test passes
- Relabeling Paused as Stopped without a semantic review
Answer: Consumer semantics and compatibility of the revised domain
A newly legitimate source value can require an intentional contract evolution rather than silent acceptance, deletion, or relabeling. Consumers and completeness/meaning requirements must be evaluated under the revised domain.
13.A parser converts any nonempty string to true. The source contract encodes booleans as the strings 'true' and 'false'. What value does this parser incorrectly assign to 'false'?
Show answer and explanation
- False
- An empty string
- NULL
- True
Answer: True
The supplied parser tests string emptiness rather than the agreed boolean tokens. 'false' is nonempty and therefore becomes true. Contract tests need token interpretation cases, not just successful string ingestion.
14.An identifier contract treats composed and decomposed Unicode spellings of the same visible label as equivalent. Two systems compare raw bytes without the agreed normalization. What test is relevant?
Show answer and explanation
- ASCII character counts substituted for normalization checks
- Only rendered appearance
- Equivalent spellings must follow the normalization policy
- Identical bytes assumed from visually matching labels
Answer: Equivalent spellings must follow the normalization policy
Different code-point/byte sequences can represent equivalent text under a defined normalization policy. Tests must exercise that policy explicitly. The correct behavior depends on the identity contract, not on appearance alone.
15.A field has a six-byte UTF-8 limit. Its value consists of four 'é' characters, each encoded in two bytes. What does a four-character length check miss?
Show answer and explanation
- Every non-ASCII value is forbidden regardless of byte count
- UTF-8 byte length is always identical to character count
- The value occupies eight bytes and exceeds the limit
- The value necessarily contains only four bytes
Answer: The value occupies eight bytes and exceeds the limit
The encoded size is 4×2=8 bytes. A character-count check addresses a different limit. Validation must use the unit of length declared by the interface.
16.A decimal contract allows precision 6 and scale 2, with four digits before the point and two after. Which value exceeds its positive representable range without considering any rounding?
Show answer and explanation
- 9999.99
- 10000.00
- 0.01
- 1234.56
Answer: 10000.00
Precision counts all stored decimal digits, while scale reserves two fractional digits. The largest positive value under the stated contract is 9999.99, so 10000.00 needs one more integral digit.
17.A decimal field has precision 6 and scale 2. Its declared conversion rounds half upward to two fractional places before checking integral capacity. What happens to the exact positive decimal input 9999.995?
Show answer and explanation
- It becomes 999.99 because precision rescales the value
- It rounds to 10000.00 and exceeds the capacity
- It must truncate to 9999.99 under the stated rounding rule
- It fits because the unrounded value is below 10000
Answer: It rounds to 10000.00 and exceeds the capacity
Rounding at the specified tie raises 9999.995 to 10000.00. That result needs five integral digits, exceeding precision-minus-scale=4. Contract checks must consider the declared conversion order and rounding semantics.
18.A test adds the two binary64 operands 0.1 and 0.2, then compares the result with separately represented binary64 0.3 using exact equality. Why can that fail despite equality of the intended decimal quantities?
Show answer and explanation
- Every floating-point sum is guaranteed to be an integer
- Their binary rounding paths can produce different stored values
- The type declaration automatically supplies exact decimal arithmetic
- Addition is mathematically noncommutative for all decimal values
Answer: Their binary rounding paths can produce different stored values
Common decimal fractions are not exactly representable in binary64. Appropriate exact decimal/integer representations or justified error bounds must match the intended quantity and contract.
19.A supplied validator uses IEEE unordered NaN comparisons and rejects x only when x<0 OR x>100. Why can NaN escape that predicate?
Show answer and explanation
- Both ordered comparisons are false for NaN
- NaN is larger than 100 under the stated IEEE comparison rule
- Every numeric parser rejects NaN before validation by definition
- NaN is necessarily the ordinary number zero
Answer: Both ordered comparisons are false for NaN
Under the explicit unordered-comparison premise, neither comparison flags NaN. A finite-value/domain requirement needs its own check. Database-specific NaN ordering must not be assumed to match this supplied predicate.
20.A reconciliation checks
abs(actual−expected)/abs(expected)≤0.001. Expected can be exactly zero. What must its acceptance policy address?Show answer and explanation
- Replacing all zero expected values with one without justification
- A guarantee that the formula works unchanged for expected zero
- Zero/near-zero reference behavior and an appropriate absolute scale
- Only a larger relative percentage until division stops failing
Answer: Zero/near-zero reference behavior and an appropriate absolute scale
The relative denominator vanishes at zero and can be unsuitable nearby. A justified absolute component or a separately defined zero case can make the policy meaningful without silently changing the measurement's scale.
21.A numeric contract accepts
abs(a−e)≤max(0.01,0.001abs(e)). For e=2, which pair of outcomes follows for a=2.009 and a=2.011?Show answer and explanation
- First fails; second passes
- Both fail
- Both pass
- First passes; second fails
Answer: First passes; second fails
At expected value two, tolerance is max(0.01,0.002)=0.01. Errors are 0.009 and 0.011, respectively, so only the first is within the stated bound.
22.A reconciliation tolerance is repeatedly increased until a faulty transformation's output passes. No source-precision, business, or uncertainty basis is supplied. What is missing?
Show answer and explanation
- Another run at the widened threshold
- Any nonzero tolerance treated as automatically justified
- Every reconciliation failure classified as a defective test
- An independent basis for the acceptance tolerance
Answer: An independent basis for the acceptance tolerance
A tolerance should follow the intended correctness and precision requirements. Fitting it solely to observed erroneous output can conceal the defect. A changed acceptance rule needs its own rationale and review.
23.A custom test harness treats every returned row as one violation. A query SELECT
COUNT(*)FROMvalid_rowsreturns a single row containing zero whenvalid_rowsis empty. How many violation rows does the harness see?Show answer and explanation
- One, despite the scalar value being zero
- Exactly the number of source rows, regardless of query shape
- NULL, because aggregate queries never return a row on empty input
- Zero, because every harness reads the scalar automatically
Answer: One, despite the scalar value being zero
The declared harness counts result rows, not the COUNT value inside a row. Aggregate-result shape must match the harness protocol, or the test can report a failure unrelated to the intended condition.
24.A failing-row test finds no invalid records because its input table is empty. The release requires a complete batch of 100 records. What remains unproved by the zero-violation result?
Show answer and explanation
- That no observed row violated the tested predicate
- A guarantee that invalid rows were returned by the query
- The required batch's presence and completeness
- The mathematical meaning of an empty result set
Answer: The required batch's presence and completeness
A universal row condition can hold vacuously on an empty set. The separate batch coverage/completeness requirement needs its own evidence. Zero violations does not mean the expected data arrived.
25.A transform should produce the same keyed totals regardless of input row order. A test shuffles an unchanged input fixture and compares outputs after canonical key sorting. What property is it testing?
Show answer and explanation
- A requirement that physical output row order always stay unchanged
- The source's absolute freshness in production
- Permutation invariance under the stated contract
- Proof that all conceivable input values were tested
Answer: Permutation invariance under the stated contract
The relation checks whether a nonsemantic input order affects the result. It is a useful metamorphic property under the given contract, but does not by itself prove correctness for all values or production freshness.
26.A model should compute
extended_amount=quantity×unit_amount. Its test derives expected values from the model's ownextended_amountcolumn instead of independent input-based expectations. What defect in evidence can result?Show answer and explanation
- Input fixtures cease to need quantity or unit_amount values
- The output becomes correct merely by naming it expected
- Every arithmetic bug is detected twice automatically
- The test can repeat the same erroneous result as its oracle
Answer: The test can repeat the same erroneous result as its oracle
An expected result that simply reuses the produced result is not an independent check of the transformation rule. Hand-derived cases, trusted source relations, or suitable independent properties are needed to challenge the implementation.
27.A sum transform always returns zero. It passes a test requiring equal results before and after input permutation. What additional evidence is needed to challenge this faulty implementation?
Show answer and explanation
- A guarantee that permutation invariance implies correct arithmetic
- Known nonzero expected results or other discriminating properties
- Only checking that zero is representable in the output type
- Only more permutations of the same inputs
Answer: Known nonzero expected results or other discriminating properties
A constant output is permutation invariant but need not be the correct sum. Useful properties can leave incorrect implementations undistinguished. Fixtures and properties should include cases that discriminate relevant failure modes.
28.A model sums amounts of distinct valid events, one row per event ID. A test duplicates every event's amount under new, distinct valid IDs and includes both sets. What output relation follows from this contract?
Show answer and explanation
- The total stays unchanged because all amounts were repeated
- The total must become zero
- The new IDs make every original event invalid
- The total doubles
Answer: The total doubles
Each new identity represents another additive event under the stated contract, so the total becomes twice the original sum. Replaying the same IDs under a deduplication contract would be a different test.
29.A contract accepts integer quantity q when 0≤q≤10. An implementation uses 0≤q<10. Which single input directly distinguishes the two predicates?
Show answer and explanation
- q=0
- q=10
- q=−1
- q=5
Answer: q=10
Ten is valid under the contract but rejected by the implementation. Five and zero pass both, while negative one fails both. Boundary cases can expose a mismatch missed by ordinary interior examples.
30.Three boolean flags have a defect only when all are true. A test set uses 000, 011, 101, and 110, covering every possible pairwise flag combination. What coverage is still missing?
Show answer and explanation
- The three-way combination 111
- Every pair involving the first flag
- Every pair involving the second flag
- The all-false case 000
Answer: The three-way combination 111
Pairwise coverage does not imply every higher-order combination is present. This set contains all four settings for each pair but omits 111, so the stated three-flag interaction can escape.
31.A very large dataset has independently sampled rows, each with probability 0.01 of violating a rule. Under that model, what is the probability that 100 sampled rows contain no violation?
Show answer and explanation
- Exactly 99%
- 0.99¹⁰⁰, about 36.6%
- Exactly zero
- 0.01¹⁰⁰, effectively zero
Answer: 0.99¹⁰⁰, about 36.6%
Each independent draw misses a violation with probability 0.99. All hundred miss with probability 0.99¹⁰⁰≈0.366. A passing sample can therefore leave substantial uncertainty about a rare defect under this model.
32.A model claims correctness across all tenant partitions. Its test fixture contains many rows but only one tenant. What aspect of coverage is unsupported?
Show answer and explanation
- The fixture row count alone
- Coverage of tenant-specific cases and boundaries
- Nonempty data treated as coverage of all tenant partitions
- The tested tenant's own observed results
Answer: Coverage of tenant-specific cases and boundaries
More rows from one partition do not exercise other tenants' schemas, policies, mappings, or boundary conditions. Fixture population must match the dimensions of the claimed coverage.
33.An approximate distinct-count sketch has an error larger than one row at the dataset's scale. A release contract requires exact uniqueness. What is wrong with treating a matching sketch estimate as the sole proof?
Show answer and explanation
- The estimate cannot establish the exact uniqueness requirement
- A sketch automatically lists every duplicate key
- Approximation error disappears when the contract is stricter
- Every approximate estimate is necessarily numerically wrong
Answer: The estimate cannot establish the exact uniqueness requirement
An approximate summary can be useful for monitoring, but its error can mask the difference relevant to an exact constraint. The release gate needs evidence appropriate to that exact key property.
34.Two key sets are {1,2} and {0,3}. A checker compares only row count and XOR of integer keys. What does it observe?
Show answer and explanation
- Different XOR values of 1 and 3
- A collision-free proof of identical membership
- Different counts that prove the sets differ
- Both count 2 and XOR 3, despite different sets
Answer: Both count 2 and XOR 3, despite different sets
Both sets contain two keys, and 1 XOR 2 = 0 XOR 3 = 3. These summaries do not uniquely determine membership. A matching aggregate fingerprint is not an exact set comparison.
35.A release digest covers sorted primary keys only. Every amount value is accidentally doubled while keys remain unchanged. What can the unchanged digest fail to detect?
Show answer and explanation
- The fact that sorted keys are unchanged
- The number of keys included in the digest
- The changed non-key payload
- The specified digest's computation over its chosen fields
Answer: The changed non-key payload
A digest checks only its represented content under its hashing assumptions. Key-only coverage cannot detect changed measures or attributes. Release verification needs the fields and contract context relevant to its claim.
36.A raw batch contains three delivery copies of one event and one copy of another. The target contract deduplicates by event ID. What expected canonical event count should a fixture use?
Show answer and explanation
- 2
- 4
- 3
- 1
Answer: 2
There are two distinct event identities, even though there are four delivered rows. A raw-row-count equality would test a different population from the canonical one-event-per-ID contract.
37.Source keys are {1,2}; target keys are {1,3}. Both sides have two rows. Which reconciliation identifies the membership changes?
Show answer and explanation
- Source-minus-target={2}; target-minus-source={3}
- Both differences are empty because counts match
- Only the total row count can distinguish the sets
- Source-minus-target={3}; target-minus-source={2}
Answer: Source-minus-target={2}; target-minus-source={3}
The first direction identifies missing source key two; the reverse identifies extra target key three. Equal counts do not imply equal identities, and one direction alone does not fully characterize both kinds of mismatch.
38.A model is required to exclude synthetic test events. A reconciliation compares its output with an unfiltered source population that includes those events. What must be aligned before interpreting the difference as a defect?
Show answer and explanation
- Only physical table names
- Decimal precision of the displayed row count
- Every source record assumed required in every model
- The source and target business populations
Answer: The source and target business populations
A legitimate selection rule changes the expected population. Reconciliation must compare the same business scope and identity semantics. Otherwise an intentional exclusion can appear as an unexplained loss.
39.A transform deliberately aggregates one output row per order from many valid line rows. Its test requires output row count to equal input line count. What does that test misunderstand?
Show answer and explanation
- The declared transformation grain
- Every valid transform being required to preserve source rows
- The ability to count an output table
- The input rows existing
Answer: The declared transformation grain
Aggregation changes row grain by design. Correct tests should establish the expected output key population and measures rather than preserve a source-row count that the contract does not require.
40.A batch has 100 received records with distinct receipt IDs, 93 accepted records, and 7 explicitly quarantined records. No record should vanish or appear in both outcomes. What accounting relation supports that processing contract?
Show answer and explanation
- Only 93+7=100, with no identity checks needed
- Accepted and quarantined form a disjoint partition of received IDs
- Accepted IDs must equal quarantined IDs
- Every quarantined row can also remain accepted without affecting coverage
Answer: Accepted and quarantined form a disjoint partition of received IDs
The count equality is necessary but can hide overlaps and omissions that offset each other. Identity coverage and disjointness establish the stronger partition relationship required by the stated contract.
41.All 93 accepted records pass their row rules. Seven required business records remain quarantined, and the consumer report claims complete coverage of all 100. What does the row-rule pass not establish?
Show answer and explanation
- The existence of the seven quarantined records
- That the accepted records passed those particular checks
- The claimed completeness of the consumer population
- That the accepted dataset contains 93 rows
Answer: The claimed completeness of the consumer population
Validity of accepted records and completeness of the required population are separate. Quarantine can contain bad data without supplying it to consumers; it does not automatically satisfy a complete-report contract.
42.A test exception was approved for specific historical record IDs. The implementation instead ignores every row with a negative amount forever. What scope change has occurred?
Show answer and explanation
- A proof that future negative rows are always valid
- A bounded exception became an open-ended suppression rule
- Automatic recovery of the original exception IDs
- Only a harmless abbreviation of the same approved set
Answer: A bounded exception became an open-ended suppression rule
The broader predicate can hide new, unreviewed violations. Exceptions need the intended population, rationale, and lifecycle; a passing test after broad suppression does not prove the same contract remains enforced.
43.A validation job targets a newly created empty development schema instead of the intended populated release. Zero failing rows are returned. What environment evidence is needed before accepting its result?
Show answer and explanation
- A successful connection treated as proof of the intended target
- Actual target, release, and expected population
- SQL text considered without its target and data context
- Only green query-runner status
Answer: Actual target, release, and expected population
A correct query against the wrong dataset does not validate the intended release. Target configuration and dataset context must be checked along with rule results, including safeguards against vacuous empty-target passes.
44.A dashboard displays a passing test result from release R1 next to freshly published data R2. No test for R2 ran. What assertion is unsupported?
Show answer and explanation
- That the displayed pass verifies R2
- That a test result for R1 exists
- That R2 has a distinct release identifier
- The possibility of retaining old verification receipts
Answer: That the displayed pass verifies R2
Verification evidence has a scope and version. A retained earlier pass is useful history but cannot certify later data changes automatically. The consumer/status view must associate checks with the data they actually examined.
45.A requirement says consumers must never see a release containing invalid required keys. The system publishes first and runs tests afterward, alerting only on failure. What part of that requirement remains unmet?
Show answer and explanation
- Validation before exposure or equivalent enforced publication integrity
- Only the number of alert recipients
- A rule that a failed post-publication test removes earlier observations
- A guarantee that fast alerts prevent all invalid reads
Answer: Validation before exposure or equivalent enforced publication integrity
Detection after exposure does not prevent consumers from reading invalid data in the intervening period. A gate on an isolated candidate, suitable enforced constraints, or another consistent publication mechanism must match the never-expose claim.
46.A parent model and child model each pass checks against their own candidate versions. They are published separately, and readers can see new children with old parents. What still needs validation or control?
Show answer and explanation
- The combined version state exposed to readers
- Only separate SQL compilation
- Physical column order assumed to preserve cross-model integrity
- Separate passes assumed to certify every mixed-version state
Answer: The combined version state exposed to readers
Cross-model contracts apply to the versions read together. Separate candidate checks do not establish integrity of an untested mixed state. Publication and verification need a consistent consumer-visible version context.
47.A rule requires every refund row to reference an original transaction. A test fixture contains hundreds of sales but no refunds. Its refund-specific assertion passes. What additional coverage is needed?
Show answer and explanation
- Applicable refund cases, including invalid-reference cases
- No further cases because the assertion returned true
- A guarantee inferred from the total fixture size
- Only more sales with the same nonrefund type
Answer: Applicable refund cases, including invalid-reference cases
A conditional rule can pass without its relevant branch being exercised. Fixtures should demonstrate both applicable valid behavior and cases that the check must reject, rather than rely on a nonempty unrelated population.
48.A checker only needs to decide whether any violation exists. It runs a correctly scoped failing-row query with LIMIT 1. Which conclusion can that result support?
Show answer and explanation
- A guarantee that the first returned violation is the only one
- Existence or absence of a violation, not the exact violation count
- The exact number of all invalid rows
- The distribution of every violation by tenant
Answer: Existence or absence of a violation, not the exact violation count
Limiting an otherwise complete violation search can be appropriate for an existence gate. A returned row proves at least one, while an empty result proves none under that query's scope. Profiling exact counts needs more information.
49.A test selects the first 100 source rows, then searches that subset for violations, while claiming full-table validation. What is the scope error?
Show answer and explanation
- The subset must contain every rare failure by definition
- A passing subset proves every unsampled row valid
- LIMIT automatically searches all rows before selecting its input
- Rows outside the subset were never checked
Answer: Rows outside the subset were never checked
A subset-first query validates only that subset. The full-table claim needs a complete search or an explicit sampling inference with its limitations. Query ordering matters to the evidence scope.
50.A model assigns a fresh unique
row_numberto every output row. Its business key should be (tenant_id,event_id), but duplicates of that pair remain. A test checks only uniqueness ofrow_number. What does it miss?Show answer and explanation
- Only unique generated numbers
- The existence of a numeric row identifier
- Generated identifiers assumed to prove unique business events
- Duplicates at the contracted business key
Answer: Duplicates at the contracted business key
A generated physical identifier can be unique even when business events are duplicated. The key named by the contract must be tested at the output boundary; checking an unrelated surrogate property is insufficient.
51.The allowed status set is Pending, Active, and Closed. A sequence rule permits Pending→Active→Closed but forbids Closed→Active. A record follows Pending, Active, Closed, Active. Which check is needed beyond accepted values?
Show answer and explanation
- Only accepted-value membership
- Only the count of distinct labels in the history
- Transitions in the entity's authoritative sequence
- Any allowed label assumed valid after any other allowed label
Answer: Transitions in the entity's authoritative sequence
Every row has an allowed label, but the final transition violates the stated sequence rule. Domain membership and transition validity are different invariants, and ordering must follow the appropriate source/business sequence.
52.A source contract promises consecutive sequence numbers through its published high watermark. A batch contains 1,2,4 and claims complete coverage through 4. What does a
max(sequence)=4 check fail to establish?Show answer and explanation
- The observed maximum is four
- The batch contains some sequence numbers
- That the integer four can be represented
- The missing sequence 3 was received
Answer: The missing sequence 3 was received
A high observed value does not prove all required earlier positions exist. The completeness claim needs the applicable contiguous coverage or an equivalent source guarantee, not merely a maximum.
53.A freshness check accepts
MAX(event_time)≥95 when now=100. One erroneous future event hasevent_time=999, while the last actual warehouse arrival was at time 20. What does the event-time pass fail to prove?Show answer and explanation
- Recent ingestion of the intended source data
- The arithmetic comparison performed by the predicate
- That the stored maximum event_time exceeds 95
- That a future timestamp exists in the checked column
Answer: Recent ingestion of the intended source data
A future outlier can satisfy the maximum-event-time predicate without recent arrivals. Freshness evidence must use the intended time perspective and address invalid/skewed timestamps rather than equate any large event timestamp with a healthy current load.
54.A table contains tenants A and B. A loaded one minute ago; B has not loaded for two days. The freshness test uses only the maximum arrival timestamp over the entire table. What required check can it miss?
Show answer and explanation
- The fact that the table contains multiple tenants
- The existence of A's recent arrival
- The table-wide maximum that was computed
- Freshness for each required tenant
Answer: Freshness for each required tenant
A recent partition can mask a stale one in a global maximum. If the contract applies per tenant, validation must cover that required partition population and its appropriate freshness markers.
55.A complete historical table contains five-year-old events and a newly accepted batch. A test labels it stale whenever
MIN(event_time)is old. What does that statistic primarily describe?Show answer and explanation
- Every record assumed loaded when the earliest event occurred
- The scheduled next batch inferred from the earliest event
- The earliest retained event, rather than load progress
- The newest arrival time
Answer: The earliest retained event, rather than load progress
A full historical table is expected to retain old events. Its minimum event time does not measure recent ingestion progress. The freshness statistic must match the load/currency requirement rather than the age of retained history.
56.A batch contains a newly loaded row, so its latest arrival timestamp is current. The source manifest requires 500 distinct records, but only 40 arrived. What does the freshness pass leave open?
Show answer and explanation
- The timestamp used for that recent row
- The manifest's required completeness
- The presence of at least one recent arrival
- The fact that some records exist in the batch
Answer: The manifest's required completeness
Freshness and completeness are separate properties. A partial load can have a current timestamp. Coverage of the expected identities or other trusted manifest requirements must be established independently.
57.A supplied business calendar legitimately expects zero records for a closed day. A generic gate rejects every daily batch with fewer than one row. What should its contract model distinguish?
Show answer and explanation
- Expected inactivity versus missing required delivery
- Every empty day assumed to prove source failure
- Equal event volume required on every calendar date
- Only whether zero is numeric
Answer: Expected inactivity versus missing required delivery
Completeness is relative to the expected population and delivery contract. A valid closed day is different from an absent batch that should contain activity. A calendar/manifest rule can make the distinction explicit.
58.A freshness contract requires actual age≤5 time units. The reported timestamp suggests age 4, but its clock can be ahead or behind the trusted reference by 2. What can that observation alone guarantee?
Show answer and explanation
- Age is between 2 and 6, so the ≤5 claim is unresolved
- The record certainly violates the requirement
- Actual age is exactly 4
- Actual age is at most 2
Answer: Age is between 2 and 6, so the ≤5 claim is unresolved
The clock uncertainty expands possible age to 4±2, or [2,6]. That interval crosses the acceptance limit. The pass/fail policy needs an appropriate clock basis or explicit handling of such uncertainty.
59.Using one common clock, a delivery is due at 09:00 and arrives at 09:03. At 09:04 its age is one minute. A gate checks only age≤5 minutes and claims every delivery deadline was met. What distinction is missing?
Show answer and explanation
- Current age versus meeting the scheduled delivery deadline
- The fact that the data can be queried after arrival
- A guarantee that a low current age erases prior lateness
- Only the difference between minutes and seconds
Answer: Current age versus meeting the scheduled delivery deadline
The data can be recent now while having arrived after its deadline. Timeliness requirements need the relevant scheduled availability time and delivery evidence, not just a moving age threshold.
60.There are 100 record latencies: 95 equal 1 minute and 5 equal 20 minutes. Nearest-rank P95 is the sorted 95th value. A rule passes P95≤5. Does that prove every latency≤5?
Show answer and explanation
- Yes; P95 is always the maximum
- Yes; a passing percentile bounds all observations
- No; five records still exceed five minutes
- No; the 95th value is necessarily 20
Answer: No; five records still exceed five minutes
The 95th sorted value is one, so the percentile gate passes while five values are twenty. A percentile service target and an all-record bound are different requirements.
61.A table has 100 tenants with 100 rows each. One tenant has all 100 values missing; the others have none missing. A global missing rate≤1% gate passes. What per-tenant claim is unsupported?
Show answer and explanation
- Every tenant's missing rate is at most 1%
- The global calculation has 10,000 rows in its denominator
- There are 100 missing values in total
- The global missing rate is exactly 1%
Answer: Every tenant's missing rate is at most 1%
The affected tenant has a 100% missing rate even though the global rate is 100/10000=1%. If quality is required per tenant, the global average does not establish that stronger condition.
62.A distribution monitor updates its baseline immediately from each new batch before deciding whether that batch changed unexpectedly. A persistent erroneous shift is learned as the new normal. What review concern follows?
Show answer and explanation
- The reference can absorb the defect it is meant to detect
- Every adaptive baseline guarantees independent validation
- A passing comparison proves no upstream change occurred
- Only fixed baselines can ever be useful under any circumstances
Answer: The reference can absorb the defect it is meant to detect
Adaptation can be legitimate, but the update policy must preserve the intended detection behavior. Learning from a potentially defective batch before evaluating it can suppress the signal. Baseline versioning and validation scope need explicit rules.
63.A dataset has 100 eligible rows, of which 10 have NULL x. A missing-rate query divides the missing count by
COUNT(x), which excludes NULLs. What rate does it report instead of the intended 10%?Show answer and explanation
- 90%, because COUNT(x) counts missing rows
- 10/90, about 11.1%
- 10/100, exactly 10%
- 0%, because NULLs never exist in SQL counts
Answer: 10/90, about 11.1%
COUNT(x) is ninety here. The eligible-population denominator should be one hundred for the stated missing-rate definition. Numerator and denominator must follow the same declared population contract.
64.A data-quality report calculates its error rate only among rows that passed all validation rules. It reports zero and claims the received batch had no invalid records. What population did it omit?
Show answer and explanation
- Only the accepted records
- Rejected rows from the received population
- Every valid source row by definition
- Only schema column names rather than record outcomes
Answer: Rejected rows from the received population
Selecting accepted rows before measuring batch errors excludes the cases that could demonstrate failure. A zero rate on that selected population cannot establish zero invalidity across everything received.
65.Twenty independent tests each have a 5% false-alarm probability when all monitored properties are correct. Under that supplied model, what is the probability of at least one false alarm?
Show answer and explanation
- Exactly 100%
- 1−0.95²⁰, about 64.2%
- Exactly 5%
- 0.05²⁰, effectively zero
Answer: 1−0.95²⁰, about 64.2%
No false alarms occur with probability 0.95²⁰. Taking the complement gives about 0.642. Per-test thresholds and an overall alarm policy have different statistical implications under the stated independence assumptions.
66.A quality score averages ten equally weighted checks. Nine pass, but the sole required identity-integrity check fails. The score is 90%. What must a release gate consider beyond that average?
Show answer and explanation
- Only the rounded average
- A score above 50% treated as proof of every identity rule
- Whether each mandatory invariant must pass
- Interchangeable severity assumed for all checks regardless of contract
Answer: Whether each mandatory invariant must pass
An average can conceal failure of a requirement that cannot be traded against unrelated passes. The gate's combination rule must reflect mandatory constraints and applicable severity/policy, not just a convenient aggregate score.
67.A drift test compares a new batch's mean with a reference mean recomputed from that very same batch. What erroneous change can this comparison never reveal by mean difference alone?
Show answer and explanation
- A guarantee that current and prior distributions are identical
- The computed mean of the current batch
- The fact that a numeric mean can be calculated
- A shift away from the intended prior reference
Answer: A shift away from the intended prior reference
Subtracting the batch mean from itself gives zero regardless of movement from earlier data. The chosen reference is part of the test's meaning; it must represent the intended comparison context.
68.Datasets A=[0,0,2,2] and B=[0,1,1,2] are compared using only their arithmetic means. What does an equal-mean result fail to establish?
Show answer and explanation
- Equality of their value distributions
- That both means are one
- That both sets contain four observations
- That the mean comparison itself passed
Answer: Equality of their value distributions
Both means equal one, but the value frequencies and variances differ. A mean-only check addresses one property. It cannot certify every distributional feature relevant to the data contract.
69.Transformation unit fixtures pass, but no test reads the actual materialized model or its configured output schema. A deployment writes to the wrong destination. What coverage is missing?
Show answer and explanation
- Unit tests assumed to verify every destination configuration
- Only fixture outputs again
- The ability to compute logic in isolation
- The real materialization and consumer boundary
Answer: The real materialization and consumer boundary
Unit tests can validate logic under controlled inputs without proving where or how the output was materialized. The actual target/version and consumer contract need appropriate integration evidence.
70.A producer adds a nullable optional field. One existing consumer rejects every unknown field. Is the addition automatically backward compatible for that consumer?
Show answer and explanation
- No; its declared reader behavior can reject the new message
- Yes; every nullable addition is compatible with every reader
- No; every additive field always breaks every possible reader
- Yes; field optionality forces all consumers to ignore it
Answer: No; its declared reader behavior can reject the new message
Compatibility is a relationship between producer and consumer contracts. An optional field can still violate a strict reader's allowed shape. The claim needs the actual reader behavior rather than a universal additive-change assumption.
71.A table gains a new required field with no default. Old writers omit that field. What compatibility issue should the migration tests cover?
Show answer and explanation
- Only whether old rows can be sorted by their primary key
- A guarantee that schema additions cannot affect writes
- The assumption that missing fields always gain a business-valid value
- Old writes may no longer satisfy the new requirement
Answer: Old writes may no longer satisfy the new requirement
New mandatory input can break writers that follow the previous contract. A migration needs an explicit compatibility/backfill/default strategy appropriate to the field's meaning and the supported writer population.
72.A consumer sorts a numeric code column numerically. A producer changes its physical type to text and calls this harmless widening. Values include 2 and 10. What behavior can change under lexical sorting?
Show answer and explanation
- Text '10' can sort before '2'
- The numeric ordering is guaranteed by the strings' appearance
- Every text type automatically preserves arithmetic order
- Both values must become NULL on every consumer
Answer: Text '10' can sort before '2'
A type change can alter operations, not just storage capacity. Lexical and numeric order differ for these representations. Consumer behavior must be evaluated rather than assuming that a nominally wider representation preserves semantics.
73.A CSV consumer reads columns by position. A producer inserts a new column between two existing columns while keeping their names. What compatibility risk remains?
Show answer and explanation
- Unchanged names guarantee correct positional decoding
- Only the total line count can change
- Existing positional fields can be misinterpreted
- A CSV reader must always discover schema by column name
Answer: Existing positional fields can be misinterpreted
A positional reader's contract includes field order. Inserting a field can shift later values into the wrong meanings even when every original name still exists. Compatibility tests must reflect the real decoding interface.
74.A producer raises a string-length limit from 20 to 40. A retained consumer still accepts at most 20 characters. What does producer-only validation fail to prove?
Show answer and explanation
- That both versions use string-valued data
- Acceptance by the retained consumer
- That the producer's own new length rule passes
- That the producer can store an allowed 30-character value
Answer: Acceptance by the retained consumer
Expanding one side's accepted domain can create outputs outside another side's supported domain. Compatibility needs the actual supported consumer contracts, not only a pass under the producer's new rule.
75.A contract file declares a field non-NULL, but the configured tool treats that declaration as documentation only. No enforcing constraint or data check runs. What is unsupported?
Show answer and explanation
- Metadata-only configuration treated as runtime validation
- The ability to read a contract file
- Actual enforcement of the requirement
- Only declaration text
Answer: Actual enforcement of the requirement
A stated requirement is not evidence that the runtime enforces or verifies it. The tool's actual mode and applicable checks/constraints must be established before treating a declaration as a validated property.
76.A source sample contains only NULLs in a column whose documented contract is decimal. An inferred schema labels it null-only. What evidence should drive the model's expected type?
Show answer and explanation
- A guarantee that future values can never be decimal
- Only the absence of non-NULL values in this sample
- The sample's current emptiness as proof of the permanent business domain
- The explicit contract, with appropriate source validation
Answer: The explicit contract, with appropriate source validation
A sample can lack values that reveal the declared domain. Schema inference is observational evidence, not a replacement for the governing type contract. The explicit expectation must still be checked against valid and invalid supplied cases.
77.A migration intentionally supports old and new consumer interfaces during a transition. Only tests of the new interface run. What support claim remains unverified?
Show answer and explanation
- The still-supported old interface
- The existence of a transition plan
- A transition document treated as proof of both runtime behaviors
- Only the new interface again
Answer: The still-supported old interface
If both interfaces remain supported, both have acceptance requirements. Passing new-interface tests alone cannot establish the old interface still works with the changed models and deployment.
78.Source S feeds model A, and A feeds consumer mart M. A contract change in S can propagate through A. An impact test includes direct dependent A but excludes transitive consumer M. What is missing from its scope?
Show answer and explanation
- The assumption that dependencies end after one graph edge
- A guarantee that one successful intermediate test covers every consumer
- Applicable transitive consumer contracts
- Only S's physical storage size
Answer: Applicable transitive consumer contracts
A direct dependent can pass its own requirements while a later consumer's assumptions break. Impact analysis needs the relevant dependency closure and consumer boundaries under the change, not only the first edge.
79.A test fixture contains an event that expires at a fixed date, but the transformation reads the real wall clock. The same unchanged fixture passes today and fails later. What must the test make explicit?
Show answer and explanation
- Only a new random ordering of fixture rows
- A guarantee that unchanged input files imply unchanged time-dependent results
- The assumption that clocks can never affect transformation logic
- The evaluation-time dependency and controlled time context
Answer: The evaluation-time dependency and controlled time context
Time is an input when rules depend on the present. A reproducible fixture needs a controlled clock or explicit as-of parameter consistent with the contract, while separate tests can exercise the intended time transitions.
80.A randomized data test fails on one generated batch but saves neither its seed nor generated records. A rerun generates a different passing batch. What evidence is missing for diagnosis?
Show answer and explanation
- A guarantee that every random generator repeats automatically
- Proof that the first failure could never have been real
- Only the number of decimal places in the success message
- The failing case needed for reproducible investigation
Answer: The failing case needed for reproducible investigation
A later random sample does not reproduce or explain the original failure. Retaining an appropriate seed/state and case context, or the generated fixture itself, supports investigation and regression testing.
81.Two validation runs create and modify the same scratch table concurrently. One run observes rows inserted by the other and fails its expected count. What test-design issue needs correction?
Show answer and explanation
- Only the order of assertion names in a report
- A proof that the production transformation must be wrong
- The assumption that separate process IDs automatically isolate tables
- Shared mutable fixture state across runs
Answer: Shared mutable fixture state across runs
Test runs need an appropriate isolation boundary for mutable fixtures. Unique run namespaces, suitable transactions, or another explicit strategy can prevent one run's setup and cleanup from changing another's observed dataset.
82.A negative test expects a required-key constraint to reject a row. Its harness passes on any exception, including connection failure before insertion. What should it verify instead?
Show answer and explanation
- Only that no row count was printed after the exception
- The intended rejection and its relevant failure cause
- A guarantee that a disconnected database enforced the key rule
- Only that some exception occurred somewhere
Answer: The intended rejection and its relevant failure cause
An infrastructure error is not evidence that the constraint rejected the invalid data. The negative test must establish that it reached the relevant operation and failed for the expected contract reason.
83.A regression fixture masks parent IDs and child references independently, accidentally breaking relationships that were valid in the original failure case. Why can that weaken the reproduction?
Show answer and explanation
- Independent key mappings assumed to preserve relationships
- Identifiers assumed irrelevant to all relational test behavior
- The failure-relevant relational structure changed
- Only synthetic text values
Answer: The failure-relevant relational structure changed
A representative fixture must preserve the relationships and conditions relevant to the defect. Values can often be synthetic or remapped, but correlated keys and other structural dependencies must remain coherent for the case being tested.
84.An order-line model permits several lines per order. Non-NULL currency must agree across every line of one order. A test requires
UNIQUE(order_id). What contract should it check instead?Show answer and explanation
- Exactly one line may exist for each order
- order_id determines currency, but order_id itself may repeat
- Each line merely needs some currency, regardless of sibling lines
- Every order in the dataset must use the same currency
Answer: order_id determines currency, but order_id itself may repeat
The rule is a functional dependency from order to currency, not uniqueness of the order key at line grain. With non-NULL currencies, grouping by order and checking for more than one distinct currency can expose the specified conflict without rejecting legitimate repeated order IDs.
85.A test runner stops after its first failure. The report labels every test that did not execute as Passed. What evidence is misrepresented?
Show answer and explanation
- The list of checks defined in the suite
- Only the first actual failure
- The fact that execution stopped
- Unexecuted checks are falsely labeled successful
Answer: Unexecuted checks are falsely labeled successful
A test that did not run has not supplied a pass result. Reporting should preserve applicable failed, passed, skipped, and unexecuted states so the release gate can evaluate its actual required coverage.
86.A data-quality query times out before returning any result. The orchestrator substitutes zero violations and marks the check green. What distinction is lost?
Show answer and explanation
- No result versus a completed zero-violation result
- The proof that the query examined every relevant row
- Only an optional display color
- A guarantee that timeouts occur only on valid data
Answer: No result versus a completed zero-violation result
Failure to obtain evidence is not evidence of zero defects. An incomplete/failed check must retain its execution status and the appropriate gate behavior rather than fabricate a successful data result.
87.A rule fails on candidate C1. Before a retry, the underlying table is overwritten with C2, and the retry passes. What does the second result establish about C1?
Show answer and explanation
- That C1 was always valid because a later query passed
- That every future candidate will also pass
- Nothing sufficient to overturn C1's failure
- That the first query necessarily had a syntax error
Answer: Nothing sufficient to overturn C1's failure
The two executions examined different candidates. The new result may validate C2 under that check, but it does not explain or invalidate evidence about C1. Candidate identity and changes need to remain explicit.
88.A release requires checks K1,K2,K3. A runner executes K1 twice and K2 once, reports three passes, and never runs K3. What coverage evidence is needed beyond total pass count?
Show answer and explanation
- Only a larger count font in the report
- A rule that duplicate executions satisfy missing requirements
- A guarantee that three passes always cover three named checks
- The required check identities and execution results
Answer: The required check identities and execution results
A count does not establish set coverage. The gate must match executed applicable checks to the required manifest and their outcomes, rather than let repeats stand in for a missing requirement.
89.A retained quality receipt records only Passed and a wall-clock time. It lacks dataset version, model version, rule version, and tested population. What cannot be established from it alone?
Show answer and explanation
- The exact data and rule context verified
- The possibility of some validation at the recorded time
- Only a passing label
- The timestamp printed in the receipt
Answer: The exact data and rule context verified
A useful verification receipt needs enough context to bind its result to the intended candidate and rule scope. A timestamp and label alone cannot distinguish different releases or validation configurations.
90.A constraint configuration enforces a rule for new writes but explicitly leaves legacy rows unvalidated. New test inserts behave correctly. What remains unproved?
Show answer and explanation
- The fact that some legacy rows exist
- The observed behavior of those new inserts
- The declared new-write enforcement mode
- Compliance of the retained legacy population
Answer: Compliance of the retained legacy population
Correct behavior for new writes does not retroactively validate existing data. The retained population needs the appropriate validation before claiming the invariant holds for the full table.
91.A matcher calls two numeric values equivalent when their distance is at most 1. Values are 0, 0.75, and 1.5. What problem arises if this relation is used directly as an equivalence-class key?
Show answer and explanation
- It requires every value to be an integer
- It is not symmetric
- It fails to relate every value to itself
- It is not transitive
Answer: It is not transitive
Zero is close to 0.75, and 0.75 is close to 1.5, but zero is not close to 1.5. A tolerance relation need not define an equivalence relation; grouping or matching needs an explicit consistent policy.
92.A source contract uses comma as the decimal separator, so '1,25' means one and one quarter. A parser removes commas and stores 125 as a valid number. Which contract property failed?
Show answer and explanation
- Only the physical ability to store a number
- Numeric interpretation under the specified locale/format
- The existence of a nonempty input string
- A rule that all commas always mean thousands separators
Answer: Numeric interpretation under the specified locale/format
Successful numeric conversion is not sufficient. The parser must implement the declared representation semantics. Removing the decimal separator changes the value even though the resulting number passes a coarse type check.
93.A monitoring rule flags a large but legitimate business-driven volume increase. The hard contract contains no violated count bound, and the source reconciles completely. What is the appropriate interpretation of the flag?
Show answer and explanation
- Proof of corrupt source rows
- Permission to remove records until the prior volume returns
- Evidence that every statistical alert is meaningless
- An anomaly requiring context, not proof of invalidity
Answer: An anomaly requiring context, not proof of invalidity
Monitoring can identify unusual behavior without defining it as forbidden. Investigation should distinguish legitimate business change from defects. Hard requirements and descriptive anomaly models serve different purposes.
94.A monitor detects a mean change of 0.0001 with strong statistical evidence. The stated acceptance contract permits changes up to 0.01, and no other requirement is violated. What does statistical detectability alone not prove?
Show answer and explanation
- The arithmetic comparison 0.0001<0.01
- That the estimated change is nonzero under the test model
- A breach of the stated magnitude limit
- That the monitor supplied a result
Answer: A breach of the stated magnitude limit
A small effect can be detectable without exceeding an allowed magnitude. Statistical evidence, effect size, and the applicable business/technical acceptance criteria must be interpreted together.
95.A contract says
encode(x)=100x anddecode(y)=y/100. An implementation mistakenly uses 10x and y/10. It passes decode(encode(x))=x for all tested x. What remains wrong?Show answer and explanation
- A guarantee that inverse consistency establishes the required scale
- The claim that two inverse functions can ever be tested together
- The individual unit conversion despite the valid round trip
- The identity round-trip calculation itself
Answer: The individual unit conversion despite the valid round trip
The two wrong scale factors cancel in the round trip. That property does not establish the intended mapping for either direction. An independent known-scale case can distinguish the correct contract from this mutually consistent error.
96.A release canonicalizer sorts every array before hashing. The contract says route-step order is meaningful. Routes ['pickup','dropoff'] and ['dropoff','pickup'] now receive the same canonical content. What did normalization erase?
Show answer and explanation
- The ability to represent strings inside an array
- A guarantee that the routes describe the same ordered process
- A semantic order distinction required by the contract
- Only irrelevant object-field ordering
Answer: A semantic order distinction required by the contract
Canonicalization must preserve the equivalence rules of the data. Sorting a semantically ordered array merges distinct values. A stable digest of the altered representation does not repair that loss.
97.A cost transform follows the supplied rule c(q)=10+2q for q≥0. A test asserts c(2q)=2c(q) for every input. Why can that test reject a correct implementation?
Show answer and explanation
- The fixed base term makes the claimed scaling property false
- Every correct affine function must satisfy pure linear scaling
- The contract leaves c(q) undefined for all positive q
- Doubling input necessarily removes the fixed base term
Answer: The fixed base term makes the claimed scaling property false
For q=1, c(2)=14 while 2c(1)=24. The proposed property assumes a zero-intercept linear rule, which the given contract does not have. Test properties themselves need validation against the specification.
98.A sum is implemented with a signed 32-bit wrapping accumulator. Three valid inputs are each 1,000,000,000. The contract requires the exact mathematical sum. What should an edge-case test reveal?
Show answer and explanation
- Every valid 32-bit input guarantees a valid 32-bit sum
- The correct total is 1,000,000,000 because rows are equal
- Overflow can violate the required 3,000,000,000 result
- A schema check on each input proves accumulator capacity
Answer: Overflow can violate the required 3,000,000,000 result
Each input fits, but their sum exceeds the signed 32-bit maximum. Intermediate/output width and overflow behavior are part of the transformation contract. Small fixtures may not exercise this failure mode.
99.A nonnegative-amount sum model accepts a new distinct event with amount zero. A test insists the total must strictly increase whenever an event is added. What correction is needed?
Show answer and explanation
- The amount total need only be nondecreasing under this premise
- The original sum must decrease whenever a zero arrives
- Every zero event must be deleted from the business population
- A new identity necessarily carries a positive amount
Answer: The amount total need only be nondecreasing under this premise
Adding a valid zero-valued event changes event count but not amount sum. Strict increase is stronger than the stated nonnegative additive contract. The property must account for allowed zero contributions.
100.Candidate revision C7 passes validation. The same candidate name is overwritten with revision C8 before publication, and the system publishes C8 using C7's receipt. What must publication bind to?
Show answer and explanation
- Only the mutable candidate name
- Only the elapsed time since a check on some earlier payload
- The exact validated revision and its context
- Every later revision inheriting previous validation passes
Answer: The exact validated revision and its context
A verification result belongs to the candidate actually examined. Publication must select that immutable revision or revalidate the changed one under the required context. A mutable name cannot supply that binding by itself.
101.A reconciliation full-joins source and target by key, then selects rows WHERE source.amount<>target.amount. A source-only row has amount 7 and a NULL-extended target side. What violation can this predicate miss?
Show answer and explanation
- Every matched equal amount, because equality is forbidden
- The unmatched source key, because its comparison is UNKNOWN
- A guaranteed arithmetic difference of seven selected as TRUE
- The impossibility of source-only rows in a full join
Answer: The unmatched source key, because its comparison is UNKNOWN
The missing target amount makes the ordinary inequality comparison UNKNOWN, which WHERE does not select. Reconciliation needs explicit unmatched-key/presence handling as well as appropriate value comparisons.