100-question MCQs test for Computer Science suitable for PPSC exams. I’ll create a comprehensive set covering all important topics: Programming, Data Structures, Algorithms, Databases, Networking, OS, Software Engineering, Web, AI, etc.

Here’s the first complete set of 100 MCQs with four options each and correct answers at the end:








PPSC Computer Science MCQs Test (100 Questions)

1–20: Programming & Basics

  1. Which of the following is not a programming language?
    a) Python
    b) Java
    c) HTML
    d) C++

  2. Which of these is a compiled language?
    a) Python
    b) Java
    c) C++
    d) JavaScript

  3. What does IDE stand for?
    a) Integrated Development Environment
    b) Internal Development Engine
    c) Integrated Design Environment
    d) Internal Data Engine

  4. Which symbol is used for comments in Python?
    a) //
    b) #
    c) /* */
    d) $$

  5. Which data type is used to store decimal values in Java?
    a) int
    b) double
    c) char
    d) boolean

  6. What is the output of print(2**3) in Python?
    a) 5
    b) 6
    c) 8
    d) 9

  7. Which of the following is a looping statement in C?
    a) if
    b) while
    c) switch
    d) break

  8. Which is not a valid variable name in C?
    a) _num
    b) 2num
    c) num2
    d) num_2

  9. In Java, which keyword is used to inherit a class?
    a) implements
    b) extends
    c) inherit
    d) super

  10. Which of the following is mutable in Python?
    a) tuple
    b) string
    c) list
    d) frozenset

  11. Which operator is used for equality check in C?
    a) =
    b) ==
    c) !=
    d) ===

  12. Which of these is not a primitive data type in Java?
    a) int
    b) float
    c) String
    d) char

  13. Which function is used to read input in Python?
    a) input()
    b) scanf()
    c) cin
    d) read()

  14. Which of these languages is used for web development?
    a) HTML
    b) Java
    c) Python
    d) C

  15. Which of the following is an interpreted language?
    a) C++
    b) Java
    c) Python
    d) C

  16. Which loop executes at least once in C?
    a) for
    b) while
    c) do-while
    d) if

  17. Which of the following is used for exception handling in Java?
    a) try-catch
    b) if-else
    c) do-while
    d) switch

  18. What does len() function do in Python?
    a) Counts elements in a string or list
    b) Returns type
    c) Converts string to integer
    d) Prints output

  19. Which of these is not an access modifier in Java?
    a) public
    b) private
    c) protected
    d) friendly

  20. Which of the following is used to create a new object in Java?
    a) new
    b) create
    c) object
    d) instance


21–40: Data Structures & Algorithms

  1. Which data structure uses FIFO?
    a) Stack
    b) Queue
    c) Tree
    d) Graph

  2. Which data structure uses LIFO?
    a) Stack
    b) Queue
    c) Array
    d) Linked List

  3. Which of these is a linear data structure?
    a) Tree
    b) Graph
    c) Queue
    d) None

  4. Which algorithm is used for searching in a sorted array?
    a) Linear Search
    b) Binary Search
    c) Bubble Sort
    d) DFS

  5. What is the worst-case complexity of Bubble Sort?
    a) O(n)
    b) O(log n)
    c) O(n^2)
    d) O(n log n)

  6. Which of these is a non-linear data structure?
    a) Array
    b) Linked List
    c) Graph
    d) Queue

  7. Which traversal is used in Depth-First Search?
    a) BFS
    b) DFS
    c) Level-order
    d) Preorder

  8. Which of the following is not a type of linked list?
    a) Singly
    b) Doubly
    c) Circular
    d) Binary

  9. Which algorithm is used to find the shortest path in a graph?
    a) DFS
    b) BFS
    c) Dijkstra
    d) QuickSort

  10. In a stack, the pop() function does what?
    a) Inserts element
    b) Deletes element from top
    c) Deletes element from bottom
    d) Traverses elements

  11. What is the time complexity of accessing an element in an array?
    a) O(n)
    b) O(log n)
    c) O(1)
    d) O(n^2)

  12. Which is used for priority-based scheduling?
    a) Queue
    b) Stack
    c) Priority Queue
    d) Linked List

  13. In binary search, what is the condition for a successful search?
    a) Linear traversal
    b) Array must be sorted
    c) Use stack
    d) Use queue

  14. Which of these sorts in place?
    a) Merge Sort
    b) Quick Sort
    c) Heap Sort
    d) None

  15. Which data structure is used in BFS traversal?
    a) Stack
    b) Queue
    c) Array
    d) Tree

  16. What is the height of a balanced binary tree with n nodes?
    a) O(1)
    b) O(n)
    c) O(log n)
    d) O(n log n)

  17. Which of the following is a stable sorting algorithm?
    a) Quick Sort
    b) Heap Sort
    c) Merge Sort
    d) Selection Sort

  18. Which algorithm is divide and conquer?
    a) Bubble Sort
    b) Merge Sort
    c) Linear Search
    d) DFS

  19. Which structure is ideal for implementing recursion?
    a) Queue
    b) Stack
    c) Array
    d) Linked List

  20. What is the complexity of inserting an element at the beginning of a linked list?
    a) O(1)
    b) O(n)
    c) O(log n)
    d) O(n log n)


41–60: Database & SQL

  1. Which command is used to remove all records from a table in SQL?
    a) DELETE
    b) TRUNCATE
    c) DROP
    d) REMOVE

  2. Which SQL statement is used to retrieve data?
    a) SELECT
    b) GET
    c) RETRIEVE
    d) SHOW

  3. What does PK stand for in databases?
    a) Primary Key
    b) Public Key
    c) Private Key
    d) Primary Kind

  4. Which SQL clause is used to filter rows?
    a) WHERE
    b) HAVING
    c) GROUP BY
    d) ORDER BY

  5. Which of these is not a SQL constraint?
    a) NOT NULL
    b) UNIQUE
    c) DEFAULT
    d) INDEX

  6. Which join returns all records from both tables?
    a) INNER JOIN
    b) LEFT JOIN
    c) RIGHT JOIN
    d) FULL OUTER JOIN

  7. Which command removes a table from the database?
    a) DELETE
    b) DROP
    c) TRUNCATE
    d) REMOVE

  8. What does ACID stand for in databases?
    a) Atomicity, Consistency, Isolation, Durability
    b) Atomic, Concurrent, Internal, Durable
    c) Access, Control, Integrity, Data
    d) None

  9. Which command is used to modify records in a table?
    a) UPDATE
    b) ALTER
    c) MODIFY
    d) CHANGE

  10. Which type of database stores data in key-value pairs?
    a) Relational
    b) NoSQL
    c) SQL
    d) Hierarchical

  11. Which is used to uniquely identify a row in a table?
    a) Foreign Key
    b) Primary Key
    c) Index
    d) Constraint

  12. Which SQL statement is used to remove a column?
    a) DROP COLUMN
    b) REMOVE COLUMN
    c) DELETE COLUMN
    d) ALTER COLUMN

  13. What is the default join in SQL?
    a) INNER JOIN
    b) LEFT JOIN
    c) RIGHT JOIN
    d) FULL JOIN

  14. Which command creates a new table in SQL?
    a) NEW TABLE
    b) CREATE TABLE
    c) INSERT TABLE
    d) MAKE TABLE

  15. Which is used for faster access to records?
    a) Index
    b) Table
    c) View
    d) Trigger

  16. Which SQL function calculates average?
    a) SUM()
    b) AVG()
    c) MEAN()
    d) COUNT()

  17. Which type of key creates a relationship between tables?
    a) Primary Key
    b) Foreign Key
    c) Unique Key
    d) Composite Key

  18. Which clause is used to sort results in SQL?
    a) ORDER BY
    b) GROUP BY
    c) WHERE
    d) HAVING

  19. Which of these SQL commands cannot be rolled back?
    a) DELETE
    b) UPDATE
    c) TRUNCATE
    d) INSERT

  20. What is the default transaction isolation level in SQL Server?
    a) READ UNCOMMITTED
    b) READ COMMITTED
    c) REPEATABLE READ
    d) SERIALIZABLE


61–80: Operating System & Networking

  1. Which OS is open-source?
    a) Windows
    b) Linux
    c) macOS
    d) Solaris

  2. What is a deadlock?
    a) Two processes waiting indefinitely
    b) Process termination
    c) High CPU usage
    d) Memory overflow

  3. Which scheduling algorithm is preemptive?
    a) FCFS
    b) SJF
    c) Round Robin
    d) None

  4. Which is a network topology?
    a) Star
    b) Circle
    c) Rectangle
    d) Triangle

  5. What does DNS stand for?
    a) Domain Name System
    b) Data Name System
    c) Domain Network Service
    d) Data Network Service

  6. Which layer of OSI is responsible for routing?
    a) Transport
    b) Network
    c) Data Link
    d) Session

  7. Which protocol is used to send emails?
    a) FTP
    b) SMTP
    c) HTTP
    d) SNMP

  8. Which memory is fastest?
    a) RAM
    b) Cache
    c) Hard Disk
    d) ROM

  9. Which is a non-volatile memory?
    a) RAM
    b) Cache
    c) ROM
    d) Registers

  10. Which of these is a connectionless protocol?
    a) TCP
    b) UDP
    c) FTP
    d) HTTP

  11. Which command is used to check network connections?
    a) ipconfig
    b) ping
    c) traceroute
    d) netstat

  12. Which is used to prevent unauthorized access?
    a) Firewall
    b) Switch
    c) Router
    d) Hub

  13. Which OS manages hardware resources?
    a) Application
    b) Compiler
    c) Operating System
    d) Interpreter

  14. Which of these is a network device?
    a) Hub
    b) CPU
    c) RAM
    d) Monitor

  15. Which protocol resolves IP to MAC address?
    a) ARP
    b) DNS
    c) DHCP
    d) FTP

  16. What is a subnet mask used for?
    a) Routing
    b) IP division
    c) MAC filtering
    d) Encryption

  17. Which type of OS allows multiple users simultaneously?
    a) Single-user
    b) Multi-user
    c) Batch
    d) Real-time

  18. Which OS type is used in embedded systems?
    a) Real-time OS
    b) Batch OS
    c) Multi-user OS
    d) Distributed OS

  19. Which protocol is used for secure web communication?
    a) HTTP
    b) HTTPS
    c) FTP
    d) SMTP

  20. What is the function of DNS?
    a) Converts domain to IP
    b) Encrypts traffic
    c) Manages files
    d) Routes packets


81–100: Software Engineering, AI & Misc

  1. SDLC stands for:
    a) Software Development Life Cycle
    b) System Development Level Code
    c) Software Design Learning Code
    d) System Design Life Cycle

  2. Which model follows iterative development?
    a) Waterfall
    b) Spiral
    c) V-model
    d) Big Bang

  3. Which testing is done by end users?
    a) Unit Testing
    b) Integration Testing
    c) Acceptance Testing
    d) System Testing

  4. Which AI technique is inspired by human brain?
    a) Neural Networks
    b) Genetic Algorithm
    c) Rule-based AI
    d) Decision Tree

  5. Which is not a software quality attribute?
    a) Reliability
    b) Maintainability
    c) Efficiency
    d) Volatility

  6. Which is used for object-oriented analysis?
    a) DFD
    b) UML
    c) ERD
    d) Flowchart

  7. What does HTTP stand for?
    a) Hyper Text Transfer Protocol
    b) Hyper Text Transmission Protocol
    c) Hyper Terminal Transfer Protocol
    d) Hyper Transfer Text Protocol

  8. Which AI method uses trial and error?
    a) Reinforcement Learning
    b) Supervised Learning
    c) Unsupervised Learning
    d) Deep Learning

  9. Which of these is a markup language?
    a) Python
    b) HTML
    c) Java
    d) C++

  10. Which language is used for AI development?
    a) Python
    b) C
    c) C++
    d) All

  11. What does ERP stand for?
    a) Enterprise Resource Planning
    b) Enterprise Report Program
    c) Electronic Resource Planning
    d) Enterprise Resource Program

  12. Which is a functional testing type?
    a) Unit Testing
    b) Regression Testing
    c) Smoke Testing
    d) All

  13. What is a use case in software engineering?
    a) Functional scenario
    b) Error handling
    c) System design
    d) Data flow

  14. Which algorithm is used in AI search problems?
    a) BFS
    b) DFS
    c) A*
    d) Bubble Sort

  15. Which is used for version control?
    a) Git
    b) SVN
    c) Both
    d) None

  16. What is the main goal of software maintenance?
    a) Fix bugs
    b) Improve performance
    c) Add features
    d) All

  17. Which Python library is used for machine learning?
    a) NumPy
    b) Pandas
    c) Scikit-learn
    d) Matplotlib

  18. What is the function of a compiler?
    a) Execute code line by line
    b) Convert code to machine language
    c) Debug code
    d) Store code

  19. Which of these is a scripting language?
    a) Python
    b) C++
    c) Java
    d) Pascal

  20. Which of the following is used for web APIs?
    a) REST
    b) SOAP
    c) Both
    d) FTP


Answer Key

  1. c | 2. c | 3. a | 4. b | 5. b | 6. c | 7. b | 8. b | 9. b | 10. c
  2. b | 12. c | 13. a | 14. a | 15. c | 16. c | 17. a | 18. a | 19. d | 20. a
  3. b | 22. a | 23. c | 24. b | 25. c | 26. c | 27. b | 28. d | 29. c | 30. b
  4. c | 32. c | 33. b | 34. b | 35. b | 36. c | 37. c | 38. b | 39. b | 40. a
  5. b | 42. a | 43. a | 44. a | 45. d | 46. d | 47. b | 48. a | 49. a | 50. b
  6. b | 52. a | 53. a | 54. b | 55. a | 56. b | 57. b | 58. a | 59. c | 60. b
  7. b | 62. a | 63. c | 64. a | 65. a | 66. b | 67. b | 68. b | 69. c | 70. b
  8. d | 72. a | 73. c | 74

Visit Home Page