Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/Dynamic arrays and queues

Q071·Free·SystemVerilog

Dynamic arrays and queues

Difficulty
Easy
Topic
Data Structures
Language
SV
Interview prompt

Question

What is printed?

Provided context

Code to inspect

int da[] = new[3];
int q[$] = '{10, 20};
initial $display("%0d %0d", da.size(), q.size());
Choose one

Answer choices

  1. A. 0 2
  2. B. Compilation error because queues have no size method
  3. C. 3 20
  4. D. 3 2
Exact question handoffPractice Q071

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

Containers and Aggregates

Review queues, dynamic and associative arrays, structures, unions, and storage ownership.

  • Data Structures
  • SystemVerilog
  • Array forms
Containers and Aggregates →
Continue practicing

Related questions

Q229 · Data StructuresAssociative arraysEasyP→Q049 · Data StructuresDynamic-array resizingEasy→Q219 · Data StructuresQueue methodsEasyP→Q936 · SystemVerilog Data StructuresChoose containers from testbench access patternsEasyP→Q016 · Data StructuresPacked and unpacked arraysEasy→
ASIC.FYI · Learn silicon end to end.info@asic.fyi