Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ1019
Page ↗
Q1019FWASIC interview problem

Queue methods

TechniquesSystemVerilogContainer operations
DifficultyEasy
TopicData Structures
LanguageSystemVerilog
Format4 choices
01

Problem

What is printed?

Starting declarationSystemVerilog
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
02

Answer choices (4)