VLSI DV Interview Puzzles · All levels

Randomization & Constraint Puzzles: Tricky Q&A

Rapid-fire interview Q&A for Randomization & Constraint Puzzles.

Section Q&A

Rapid-fire questions an interviewer asks around Randomization & Constraint Puzzles. Answer out loud, then check yourself.

Q1. What is the fastest safe way to reason about randomization interview puzzles under pressure?

Answer: Convert constraints to legal tuple counts first, then apply dist weights and normalize. This separates legality from bias and prevents common mistakes about procedural ordering.

Trap: Trying to reason variable-by-variable without counting the joint solution space.

Q2. What is the exact interview-safe statement about solve...before?

Answer: It does not change legal solutions by itself; it changes solver decision order and therefore can change observed distributions significantly.

Trap: Saying solve-before is equivalent to procedural execution order in simulation time.

Q3. How should := and :/ be compared in one line?

Answer: := applies weight per listed item/range element, while :/ applies total weight to the set and divides it across that set's elements.

Trap: Treating both operators as identical per-value weights regardless of range size.

Q4. During obj.randomize() with {...}, what is the correct lifecycle order and failure behavior?

Answer: pre_randomize runs first, then class and inline constraints are solved together (logical AND), and post_randomize runs only if solving succeeds.

Trap: Believing inline constraints override class constraints or that post_randomize can repair failed solves.