Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Queue methods

Hardware interview practice

Queue methods

EasyData StructuresSystemVerilog

What is printed?

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 q[$] = '{1, 2, 3};
int v;
initial begin
  v = q.pop_front();
  q.push_back(4);
  $display("%0d %0d %0d", v, q[0], q[$]);
end
Choose one

Answer choices

  1. A. 1 2 4
  2. B. 1 1 4
  3. C. 3 1 4
  4. D. 1 2 3
Continue practicing

Related questions

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