Original practice scenario: A hypothetical membership retailer wants an offline fallback at checkout. Membership may expire or be revoked while a store is disconnected. Define a bounded decision policy.
Read model answer +
Define what evidence an offline terminal may trust and for how long. Offline availability creates an explicit freshness tradeoff; it cannot guarantee awareness of an unseen revocation.
Work through it
Issue a signed, minimal membership assertion containing identity, validity interval and generation, verifying its integrity locally without storing unnecessary profile information.
Specify a maximum offline age and actions allowed under stale evidence, routing higher-risk or unsupported cases to a clear alternative process.
Record offline decisions for later reconciliation, refresh revocation information on reconnect and test clock drift, copied credentials and duplicate terminal records.
Tradeoffs to discuss
A generous offline window reduces checkout disruption but accepts a larger stale-authority window; strict online dependence may halt otherwise legitimate purchases.
Common pitfalls
Do not call a cached assertion a current live membership lookup.
Separate authentication of the presenter from validation of the signed membership state.
Original practice scenario: A hypothetical warehouse-retail report compares product sales before and after a pack changes from twelve units to ten. The SKU identifier is reused. Design the comparison.
Read model answer +
Keep package sales and underlying units separate, with an effective-dated product specification. Equal SKU counts do not imply equal quantities when the contents of each package change.
Work through it
Store sale lines at transaction-line grain and join the product specification valid at the sale time, detecting gaps or overlapping specification intervals.
Calculate package count, underlying-unit count and monetary totals separately, preserving returns and any non-equivalent units of measure.
Compare periods using explicit price and promotion context, reconciling totals back to source lines and identifying stock sold under an older packaging version.
Tradeoffs to discuss
Standardized-unit comparisons improve continuity but can obscure customer-facing packaging differences; both views may be useful.
Common pitfalls
Joining every specification version to one sale multiplies its contribution.
Do not infer the package version solely from today's catalog when older stock may still be sold.