Skip to question links

Generate legal, useful stimulus

SystemVerilog Constraints Interview Questions

01
What this tests

Constraint interviews evaluate whether you can describe a legal stimulus space without accidentally biasing, overconstraining, or slowing the solver. Familiar syntax is only the starting point.

02
How to practice

Use this collection to progress from basic ranges and weighted distributions to relational arrays, temporal restrictions, address windows, and solver-sensitive problems. Before writing code, define the valid set and check edge cases such as empty ranges, overflow, modulo bias, or conflicting soft constraints.

Topic breakdown

What to be ready to explain

01

Ranges and distributions

Build legal ranges, weighted choices, alignment, and dependent-field relationships without hidden bias.

  • inside
  • dist
  • Alignment
  • solve before
02

Arrays and relationships

Express uniqueness, ordering, exact counts, and cross-element rules while keeping solver work bounded.

  • foreach
  • unique
  • Array sizing
  • Relational constraints
03

State and validation

Decide when stateful randomization or post_randomize is justified and prove the generated population is useful.

  • rand_mode
  • post_randomize
  • Solver performance
  • Coverage

Curated practice links

Questions to work through

Permanent bank numbers and direct links make it easy to continue in the live question bank.

  1. Q141Bias burst lengths by range

    Explain the key Randomization and dist decisions, assumptions, and checks.

    Constraints · Easy
  2. Q527Constrain exactly K set bits

    Explain the key Randomization and $countones decisions, assumptions, and checks.

    Constraints · Easy
  3. Q647Constrain unique increasing addresses

    Explain the key Randomization and foreach decisions, assumptions, and checks.

    Constraints · Easy
  4. Q007Constrain a size-aligned address

    Explain the key Randomization and Alignment decisions, assumptions, and checks.

    Constraints · Easy
  5. Q868Forbid consecutive POP commands

    Explain the key Randomization and Sequence constraint decisions, assumptions, and checks.

    Constraints · Easy
  6. Q879Enforce uniqueness within each group

    Explain the key Randomization and Conditional uniqueness decisions, assumptions, and checks.

    Constraints · Medium
  7. Q862Randomize weighted onehot-or-zero requests

    Explain the key Randomization and Onehot decisions, assumptions, and checks.

    Constraints · Medium
  8. Q430Constrain a Gray-adjacent sequence

    Explain the key Randomization and Gray code decisions, assumptions, and checks.

    Constraints · Medium
  9. Q695Constrain a bounded zig-zag address walk

    Explain the key Randomization and Adjacent values decisions, assumptions, and checks.

    Constraints · Medium
  10. Q531Constrain a DMA transfer to one 4KB page

    Explain the key DMA and Alignment decisions, assumptions, and checks.

    Constraints · Medium
  11. Q856Generate a temporal hazard-safe instruction stream

    Explain the key Temporal hazards and Distribution decisions, assumptions, and checks.

    Constraints · Hard
  12. Q448Basic constraints

    Explain the key Constrained randomization decisions, assumptions, and checks.

    Constraints · Medium
  13. Q568Soft constraints

    Explain the key Constrained randomization decisions, assumptions, and checks.

    Constraints · Medium
  14. Q1022Distribution constraints

    Explain the key Constrained randomization decisions, assumptions, and checks.

    Constraints · Medium
  15. Q224Solve before

    Explain the key Advanced randomization decisions, assumptions, and checks.

    Constraints · Hard
  16. Q214Random dynamic arrays

    Explain the key Advanced randomization decisions, assumptions, and checks.

    Constraints · Hard
  17. Q916Rand_mode

    Explain the key Advanced randomization decisions, assumptions, and checks.

    Constraints · Hard
  18. Q029Generate a unique array with constraints

    Explain the key Unique and post_randomize decisions, assumptions, and checks.

    Constraints · Easy
  19. Q030Allow exceptions in a unique-array constraint

    Explain the key Unique and Exceptions decisions, assumptions, and checks.

    Constraints · Medium
  20. Q031Constrain transaction IDs to be unique

    Explain the key Struct and Field uniqueness decisions, assumptions, and checks.

    Constraints · Medium
  21. Q762Solve N-Queens with column constraints

    Explain the key Constraint randomization and Unique constraint decisions, assumptions, and checks.

    Constraints · Medium
  22. Q763Solve N-Queens with a board matrix

    Explain the key Constraint randomization and Matrix decisions, assumptions, and checks.

    Constraints · Hard
  23. Q667Constrained Non-Overlapping DMA Bursts

    Explain the key SystemVerilog constraints and DMA decisions, assumptions, and checks.

    Constraints · Hard
  24. Q391Constrain ten unique multiples of three

    Explain the key Constraints and Unique decisions, assumptions, and checks.

    Constrained Random · Easy
  25. Q255Constrain exactly five changed bit positions

    Explain the key Constraints and Hamming distance decisions, assumptions, and checks.

    Constrained Random · Easy
  26. Q648Constrain a nonzero 32-bit power of two

    Explain the key Constraints and Power of two decisions, assumptions, and checks.

    Constrained Random · Easy
  27. Q466Do not repeat the previous five values

    Explain the key Stateful randomization and post_randomize decisions, assumptions, and checks.

    Constraints · Medium
  28. Q487Constrain exactly one duplicated nonadjacent pair

    Explain the key Relational constraints and Exact duplicates decisions, assumptions, and checks.

    Constraints · Hard
  29. Q1040Constrain exactly three nonoverlapping 110 patterns

    Explain the key Pattern constraints and Exact count decisions, assumptions, and checks.

    Constraints · Hard
  30. Q535Constrain five non-overlapping address windows

    Explain the key Constraints and Memory map decisions, assumptions, and checks.

    SystemVerilog Constraints · Medium

Continue preparing