






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A set of multiple-choice questions (mcqs) covering key concepts in data structures, computer networks, and sql commands, designed for cbse class xii computer science students. It includes questions on stacks, network topologies, protocols, and basic sql operations, offering a comprehensive review of essential topics. The questions are categorized into three chapters: data structures using stack, computer networks (part i), and computer networks (part ii), along with simple queries, table creation & data manipulation commands, making it a valuable resource for exam preparation and concept reinforcement. Each question is followed by the correct answer, facilitating self-assessment and learning.
Typology: Exercises
1 / 10
This page cannot be seen from the preview
Don't miss anything!







1. Which of the following statements about a stack is true? A. It follows FIFO order. B. It follows LIFO order. C. It allows random access. D. It allows insertion at both ends. Answer: B 2. In Python, which built-in list operations are most suitable to implement push and pop for a stack? A. insert() and remove() B. append() and pop() C. push() and pull() D. add() and del() Answer: B 3. What is the time complexity of the push operation in a stack implemented using a list? A. O(n) B. O(1) C. O(log n) D. O(nยฒ) Answer: B 4. Which situation best describes stack overflow? A. Trying to delete from an empty stack. B. Trying to insert into a full stack. C. Accessing invalid memory. D. Using wrong data type. Answer: B 5. When a function is called recursively, which data structure stores the return addresses? A. Queue B. Stack
C. Array D. List Answer: B
6. Which of the following postfix expressions represents the infix expression (A + B) * (C โ D)? A. AB+CD-* B. A+B C-D C. ABCD+- D. AB+CD-*+ Answer: A 7. What is the main advantage of using a linked-list-based stack over an array-based stack? A. Faster random access B. Dynamic size (no overflow unless memory is full) C. Easier indexing D. Lower memory usage Answer: B 8. If the input is the string "HELLO", what will be the output after pushing each character into a stack and popping them all? A. HELLO B. OLLEH C. HLOLE D. ERROR Answer: B 9. Which of the following is not an application of stacks? A. Undo/Redo operations B. Expression evaluation C. Process scheduling in OS
D. Browser history Answer: C
10. Which of the following operations cannot be performed on an empty stack? A. Push B. Pop C. Peek D. Both B and C Answer: D 11. If top = -1, what does that indicate in a stack implementation using arrays? A. Stack Overflow B. Stack Underflow / Empty stack C. Full stack D. Invalid pointer Answer: B 12. Which of the following infix expressions corresponds to postfix expression ABC*+D-? A. A + B * C โ D B. (A + (B * C)) โ D C. (A + B) * (C โ D) D. A + ((B * C) โ D) Answer: B 13. When converting infix to postfix using a stack, which operator property determines whether to pop from the stack or not? A. Precedence and associativity B. Data type C. Operand order D. Operator size Answer: A 14. What will be the result of the following operations on an empty stack? push(10); push(20); pop(); push(30); peek(); A. 20 B. 10 C. 30 D. Error Answer: C 15. Which is the correct order of evaluation for the expression A + B * C
in postfix form? A. ABC+ B. AB+C C. A+BC* D. None Answer: A
16. What is the maximum size of a stack with top = 4 and base index = 0? A. 4 B. 5 C. 3 D. None Answer: B 17. If an underflow occurs in a stack, which of these should be done in a program? A. Terminate the operation safely B. Insert 0 by default C. Ignore the error D. Reset top to 0 Answer: A 18. Which function prototype correctly defines a push function for a Python list- based stack? A. def push(stack, item): stack.insert(0, item) B. def push(stack, item): stack.append(item) C. def push(stack, item): stack.pop(item) D. def push(stack, item): stack.add(item) Answer: B 19. Which of the following expressions will cause stack underflow? A. More pushes than pops B. More pops than pushes C. Equal number of pushes and pops D. No operations Answer: B 20. In a stack-based expression evaluation algorithm, which of these occurs last? A. Push operand B. Push operator C. Pop two operands, apply operator, push result
addresses? A. Class A B. Class B C. Class C D. Class D Answer: A
32. In a bus topology, data collisions are controlled by: A. Token passing B. CSMA/CD C. Routing D. Polling Answer: B 33. Which of the following is not a valid private IP address? A. 10.0.0. B. 192.168.1. C. 172.16.0. D. 8.8.8. Answer: D 34. In the OSI model, which layer ensures reliable process-to-process communication? A. Data Link Layer B. Transport Layer C. Session Layer D. Network Layer Answer: B 35. Which of the following cables can achieve the highest transmission speed? A. Coaxial B. Twisted Pair C. Optical Fiber D. Shielded Twisted Pair Answer: C 36. A hub operates at which OSI layer? A. Data Link Layer B. Physical Layer C. Network Layer D. Transport Layer Answer: B 37. In a LAN, if one computer fails, the entire network goes down. This happens in: A. Star topology B. Bus topology C. Ring topology D. Mesh topology Answer: C 38. A router operates at which OSI layer? A. Network Layer B. Data Link Layer C. Transport Layer D. Session Layer Answer: A 39. Which is the slowest transmission medium among the following? A. Fiber optic B. Microwave C. Coaxial cable D. Twisted pair cable Answer: D 40. The IEEE 802.3 standard defines which networking protocol? A. Wi-Fi B. Ethernet C. Bluetooth D. Token Ring Answer: B
Total: 20 Hard-Level MCQs (Q41โQ60) (Advanced Networking Concepts from Sumita Arora, Class 12 CBSE)
41. Which protocol is used to transfer web pages on the Internet? A. FTP
Answer: C
42. Which of the following protocols uses port number 25? A. POP B. SMTP C. HTTP D. FTP Answer: B 43. Which of the following is a connection-oriented protocol? A. UDP B. IP C. TCP D. ICMP Answer: C 44. Which protocol is responsible for resolving IP addresses to MAC addresses? A. DNS B. ARP C. DHCP D. ICMP Answer: B 45. Which layer of the TCP/IP model corresponds to the OSI Network Layer? A. Application B. Transport C. Internet D. Network Interface Answer: C 46. Which of the following devices can filter packets based on IP address? A. Repeater B. Switch C. Router D. Hub Answer: C 47. Which protocol is used for secure data transfer over HTTP? A. SHTTP B. HTTPS C. SSL
Answer: B
48. Which command is used to check the connectivity between two computers in a network? A. trace B. ping C. connect D. scan Answer: B 49. Which protocol is used by email clients to download messages from the mail server? A. SMTP B. POP C. FTP D. DHCP Answer: B 50. Which IP address is used for loopback testing? A. 192.168.1. B. 127.0.0. C. 255.255.255. D. 10.0.0. Answer: B 51. What is the function of DNS in networking? A. Encrypt messages B. Resolve domain names to IP addresses C. Allocate MAC addresses D. Assign subnet masks Answer: B 52. Which of these is not a valid top-level domain (TLD)? A. .com B. .org C. .net D. .html Answer: D 53. In IPv4 addressing, how many bits are used for the network and host portions in Class B? A. 8 network, 24 host B. 16 network, 16 host
Answer: B
64. What does the following SQL command do? DELETE FROM STUDENT WHERE Marks < 40; A. Deletes the STUDENT table B. Deletes students with Marks < 40 C. Deletes the Marks column D. Deletes all records Answer: B 65. Which of the following statements will rename a table named EMP to EMPLOYEE? A. CHANGE TABLE EMP TO EMPLOYEE; B. ALTER TABLE EMP RENAME TO EMPLOYEE; C. MODIFY TABLE EMP TO EMPLOYEE; D. UPDATE TABLE EMP TO EMPLOYEE; Answer: B 66. Which SQL command is used to remove all records from a table but not its structure? A. DELETE B. REMOVE C. DROP D. TRUNCATE Answer: D 67. Which constraint ensures that no two rows have the same value in a column? A. PRIMARY KEY B. UNIQUE C. NOT NULL D. FOREIGN KEY Answer: B 68. Which of the following SQL statements is invalid? A. SELECT * FROM STUDENT; B. SELECT Name, RollNo FROM STUDENT; C. SELECT FROM STUDENT WHERE Name = 'Amit';
D. SELECT DISTINCT Marks FROM STUDENT; Answer: C
69. Which of these commands will permanently delete a table? A. REMOVE TABLE B. DROP TABLE C. DELETE TABLE D. CLEAR TABLE Answer: B 70. Which clause is used to sort query results in SQL? A. SORT BY B. ORDER BY C. GROUP BY D. ARRANGE BY Answer: B 71. Which SQL command changes the structure of an existing table? A. UPDATE B. ALTER TABLE C. MODIFY TABLE D. CHANGE TABLE Answer: B 72. The UPDATE command without a WHERE clause will: A. Update only one record B. Update all records in the table C. Cause an error D. Do nothing Answer: B 73. Which SQL keyword is used to avoid duplicate records in the output? A. DISTINCT B. UNIQUE C. EXCEPT D. DIFFERENT Answer: A 74. Which aggregate function gives the highest value in a numeric column? A. SUM() B. AVG() C. MAX()
Answer: C
75. Which of the following commands will add a new column to an existing table? A. MODIFY TABLE STUDENT ADD COLUMN Grade CHAR(1); B. ALTER TABLE STUDENT ADD Grade CHAR(1); C. UPDATE TABLE STUDENT ADD Grade CHAR(1); D. INSERT TABLE STUDENT ADD Grade CHAR(1); Answer: B 76. What will be the result of the following query? SELECT * FROM STUDENT WHERE Marks BETWEEN 70 AND 90; A. Selects students having Marks < 70 or > 90 B. Selects students having Marks = 70 or 90 C. Selects students with Marks from 70 to 90 inclusive D. Causes syntax error Answer: C 77. Which SQL clause is used to filter rows from a query result? A. ORDER BY B. HAVING
Answer: C
78. The SQL command to display structure of a table is: A. SHOW TABLE B. DESC tablename; C. SELECT * FROM tablename; D. DESCRIBE DATABASE; Answer: B 79. In SQL, which operator is used to combine conditions? A. IF B. WHEN C. AND/OR D. WITH Answer: C 80. Which of these is the correct command to change a column name in SQL? A. ALTER TABLE T CHANGE old_name new_name datatype; B. ALTER COLUMN old_name TO new_name; C. UPDATE COLUMN old_name new_name; D. MODIFY COLUMN old_name new_name; Answer: A
Total: 20 Hard-Level MCQs (Q81โQ100) (Sumita Arora, Class 12 CBSE, Python version โ SQL Advanced Concepts)
81. Which SQL clause is used to group rows that have the same values in specified columns? A. GROUP BY B. ORDER BY C. WHERE D. HAVING Answer: A 82. Which function can be used along with GROUP BY to count records in each group?
Answer: B
83. The HAVING clause is used to: A. Filter individual rows B. Filter groups formed by GROUP BY C. Sort results
95. Which of the following joins can produce the largest number of rows? A. INNER JOIN B. CROSS JOIN C. NATURAL JOIN D. LEFT JOIN Answer: B 96. Which SQL clause is used to combine results of two SELECT statements? A. MERGE B. UNION C. JOIN D. APPEND Answer: B 97. Which of the following is a valid use of SELF JOIN? A. Comparing records within the same table B. Joining unrelated tables C. Deleting duplicate rows D. Creating new tables Answer: A 98. Which of these functions can be used in HAVING but not in WHERE? A. MAX() B. LIKE C. BETWEEN D. IN Answer: A 99. In SQL, what is the default type of JOIN when JOIN keyword is used without specification? A. LEFT JOIN B. INNER JOIN C. CROSS JOIN D. FULL JOIN Answer: B 100. Which of the following is not an aggregate function? A. SUM() B. COUNT() C. LENGTH() D. AVG() Answer: C