Skip to main content

10 MCQ questions related to Stack

MCQ questions related to Stack for UGC NET, SET, GATE AND ASSISTANT PROFESSOR etc..

  1. GATE CS 2019
    Which of the following is the correct postfix form of the expression (A + B) * (C - D)?
    A) AB+CD-*
    B) AB+CD-
    C) AB+CD-

    D) ABCD-+*
    Answer: A) AB+CD-*

  2. UGC NET 2020
    Which of the following operations can result in stack underflow?
    A) Push
    B) Pop
    C) Peek
    D) IsEmpty
    Answer: B) Pop

  3. ISRO Scientist 2018
    What is the maximum number of parentheses that can be correctly matched using a stack?
    A) n
    B) 2n
    C) n/2
    D) Infinite
    Answer: A) n

  4. NIELIT Scientist B 2017
    Which of the following expressions correctly represents the reverse of a string using a stack?
    A) Push all characters and pop them one by one
    B) Pop all characters and push them again
    C) Enqueue and dequeue
    D) Sort the characters
    Answer: A) Push all characters and pop them one by one

  5. GATE CS 2020
    Which of the following data structures is used by the compiler for syntax parsing?
    A) Stack
    B) Queue
    C) Hash Table
    D) Linked List
    Answer: A) Stack

  6. UGC NET 2019
    Which operation in a stack has a time complexity of O(1)?
    A) Insertion
    B) Deletion
    C) Access
    D) Both A and B
    Answer: D) Both A and B

  7. GATE CS 2018
    Which of the following is NOT a valid postfix expression?
    A) AB+CD-*
    B) ABC+*
    C) AB+CD-
    D) ABC
    +
    Answer: B) ABC+*

  8. NIELIT Scientist B 2020
    What will be the output of the following postfix expression 5 6 2 + * 3 -?
    A) 25
    B) 40
    C) 30
    D) 17
    Answer: B) 40

  9. GATE CS 2017
    Which of the following is true about stack overflow?
    A) Occurs when the stack is full
    B) Occurs when the stack is empty
    C) Occurs due to improper memory allocation
    D) Occurs when accessing an element that is not present
    Answer: A) Occurs when the stack is full

  10. UGC NET 2021
    Which of the following operations is NOT possible in a stack?
    A) Push
    B) Pop
    C) Peek
    D) Random Access
    Answer: D) Random Access


Comments

Popular posts from this blog

Top 5 Safe Chat Apps for Kids with Parental Controls

Now a days kids are growing up with technology at their fingertips. While communication apps help children stay connected with family and friends, safety remains a top concern for parents. Unregulated platforms can expose children to inappropriate content, online predators, and cyberbullying. That’s why choosing a kid-friendly chat app with parental controls is essential. To help parents find the best options, we’ve compiled a list of the top five safest chat apps for kids that offer safe and controlled environment. 1. Messenger Kids (By Meta) Best for: Safe video calls and text messaging with parental supervision Features: Parents approve all contacts No ads or in-app purchases Fun filters, stickers, and games Monitored messaging and activity reports Why It’s Safe: Messenger Kids is designed for children under 13 and requires parental approval for every contact. Parents can monitor chats and control screen time through the Parent Dashboard. Download Messenger Kids 2...

10 Distance Vector and Link-State Routing MCQ

  10 multiple-choice questions  on  Distance Vector and Link-State Routing with explanations, useful for  UGC NET, SET, GATE, ISRO, and other competitive exams . Question 1: Basic Concept of Distance Vector Routing Q1: In a distance vector routing protocol, how do routers share routing information? A) By flooding the entire network with routing updates B) By periodically exchanging routing tables with their immediate neighbors C) By using a link-state database to determine the shortest path D) By dynamically updating paths based on link failure reports Answer: B) By periodically exchanging routing tables with their immediate neighbors Explanation: In Distance Vector Routing, routers share their routing tables with neighbors at regular intervals, leading to a simple but slow convergence mechanism. Question 2: Example of Distance Vector Routing Protocol Q2: Which of the following is an example of a Distance Vector routing protocol? A) OSPF ...

10 Routing Protocol MCQ

10 multiple-choice questions on Routing protocol s  with explanations, useful for UGC NET, SET, GATE, ISRO, and other competitive exams . Question 1: Purpose of Routing Protocols Q1: What is the primary purpose of a routing protocol? A) To assign IP addresses to devices B) To determine the best path for data packets to reach their destination C) To encrypt data during transmission D) To physically connect different networks Answer: B) To determine the best path for data packets to reach their destination Explanation: Routing protocols help routers determine the most efficient path for data transmission across a network, ensuring fast and reliable communication. Question 2: Classification of Routing Protocols Q2: Routing protocols can be broadly classified into which two main categories? A) TCP and UDP B) Distance Vector and Link-State C) IPv4 and IPv6 D) Static and Dynamic Answer: B) Distance Vector and Link-State Explanation: Routing prot...