Suggested answer

States let one card definition present genuinely different content depending on the data, rather than showing an identical layout with empty fields.

1. Each card has a set of conditional states plus a default state. At render time the runtime evaluates the conditions in order and renders the first one that matches; if none match, the default renders.
2. For an account summary: a Delinquent state showing an overdue balance, a payment action and a warning colour; a VIP state showing the relationship manager and a priority contact action; a Standard default state with the ordinary summary.
3. Because evaluation stops at the first match, ordering encodes precedence. A delinquent VIP customer should probably see the delinquent state, so it goes first. Getting this ordering wrong is a common and subtle bug.
4. Keep conditions readable and mutually meaningful. If you find yourself writing long compound conditions to keep states from overlapping, it is usually better to compute a single status value in the data source and switch on that.

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.