Hardware interview practice
Queue methods
What is printed?
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[$]);
endChoose one
Answer choices
- A. 1 2 4
- B. 1 1 4
- C. 3 1 4
- D. 1 2 3
