Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Dynamic-array resizing

Hardware interview practice

Dynamic-array resizing

EasyData StructuresSystemVerilog

What does the display print?

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

int da[];
initial begin
  da = new[3];
  da = '{1, 2, 3};
  da = new[5](da);
  $display("%0d %0d %0d", da.size(), da[2], da[4]);
end
Choose one

Answer choices

  1. A. 5 3 0
  2. B. 5 0 0
  3. C. 3 3 0
  4. D. 5 3 x
Continue practicing

Related questions

Data StructuresQueue methods→Data StructuresAssociative-array traversal→
asic.fyi · Learn silicon end to end.info@asic.fyi