Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ830
Page ↗
Q830DVASIC interview problem

Constrain three disjoint child arrays

TechniquesRandomizationConstraintsSet membership
DifficultyMedium
TopicConstraints
LanguageSystemVerilog
Requirements3 checkpoints
01

Problem

Randomize a unique five-element parent array and three non-empty child arrays whose union equals the parent with no overlap.

Example input and output

Use this case to check your interpretation
Input
randomize three children drawn from parent=[10,11,12,13,14]
Output
One valid result: a=[10], b=[11,13], c=[12,14]
Explanation

The children are pairwise disjoint and contain only parent values; many other random partitions satisfy the same constraints.

02

Requirements (3)

  • Child sizes must sum to the parent size.
  • Every child element must come from the parent.
  • Children must be pairwise disjoint and individually unique.