---
# System prepended metadata

title: Satyam Mishra

---

# Satyam Mishra
- Cheated - Skip


# Question 1: Queue Service. 
- Queue - a ds which hold msgs temporarily till they are processed
- Publisher - a component that adds message to the queue
- Consumer - retrives and process messages from the queue. 

interface queue<T>{
  void enqueue(T message);
  T dequeue();
  boolean isEmpty();
  boolean isFull();
}
    
interface Publisher<T> {
   void publish(T message);    
}
    
interface Consumer<T> {
  void consume();    
}

Queue {
    int[] queue
}
    
Queue<String>queue = new MessageQueue<>(10);
    