wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Hackharbor 3.0 Day 3:C

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What is the output of pop() when the stack is empty?

a)

-1

b)

Segmentation Fault

c)

"Stack Underflow"

d)

Garbage Value

2.

If your crush was a queue, what would you be?

a)

Rear

b)

Front

c)

Stuck waiting

d)

Dequeued

3.

Why reset front and rear to -1 after dequeue in a queue?

a)

To confuse beginners

b)

Free up memory

c)

Because queue is now empty

d)

Because that’s what seniors do

4.

Which operation follows LIFO?

a)

enqueue

b)

dequeue

c)

push

d)

traverse

5.

In circular queue, how to access the next position of rear?

a)

rear + 1

b)

(rear + 1) / MAX

c)

(rear + 1) % MAX

d)

rear++

6.

When is the queue empty?

a)

front > rear

b)

rear == -1

c)

front == rear

d)

front == rear + 1

7.

In a queue, which pointer moves forward when dequeue is called?

a)

rear

b)

top

c)

front

d)

NULL

8.

What happens when you mix stack with drama?

a)

StackOverflow movie

b)

It gets pop-ular

c)

Overacted push

d)

Too much LIFO

9.

What happens when you dequeue() from an empty queue?

a)

Segmentation fault

b)

Returns -1

c)

"Queue Underflow"

d)

Deletes nothing silently

10.

Which statement about circular queue is FALSE?

a)

Circular queue solves the problem of unused space after dequeues

b)

Circular queue uses modulo arithmetic for indexing

c)

Circular queue cannot be implemented using arrays

d)

Circular queue allows wrap-around of rear pointer

11.

Why is (rear + 1) % MAX == front used in circular queue overflow check?

a)

Looks cool

b)

Ensures wrap-around

c)

Just tradition

d)

Saves lines of code

12.

If a stack and a queue went on a date, who would talk last?

a)

The stack, because it’s LIFO!

b)

The queue, because it’s FIFO!

c)

They’d both talk simultaneously.

d)

Neither, they’re both silent.

13.

What is the primary reason for using circular queues over normal queues?

a)

They're circular

b)

More memory efficient

c)

More confusing for juniors

d)

FIFO no longer applies

14.

What’s a circular queue’s biggest insecurity?

a)

No beginning or end

b)

Not looking linear

c)

Constant modulo stress

d)

People not getting the point

15.

If a stack broke up with its data, why?

a)

It got popped too many times

b)

It was too static

c)

No overflow of feelings

d)

Push came to shove

16.

In queue implementation, what happens when rear reaches MAX-1 and you try to enqueue?

a)

Queue Overflow

b)

Queue Underflow

c)

Stack Overflow

d)

Circular Queue Overflow

17.

If life were a stack, what’s the most relatable thing?

a)

Everything keeps piling up

b)

Pop quiz every week

c)

Underflow of motivation

d)

Overflow of chai