Saudi Secondary School Certificate ยท Computer Science and Digital Skills

Python Programming, Data Structures, Algorithms, Networks and Cybersecurity

40 practice questions, each with the answer and an explanation.

Practise Python Programming, Data Structures, Algorithms, Networks and Cybersecurity now

Random questions from this topic, one at a time. You see the answer and the explanation straight after each one.

All 40 questions

  1. What is the time complexity of searching for an element in an unsorted array of elements using linear search?
  2. What is the output of the following Python expression: `[x**2 for x in range(5) if x % 2 == 1]`?
  3. Which data structure operates on a Last-In, First-Out (LIFO) access principle?
  4. Which SQL clause is used to filter aggregated group records after a `GROUP BY` statement has been applied?
  5. What type of network topology connects all nodes to a central forwarding device such as a network switch?
  6. In cybersecurity, what type of malicious attack overwhelms a web server with massive volumes of traffic from multiple compromised sources to render it unavailable to legitimate users?
  7. What is the binary representation of the decimal integer 25?
  8. Which fundamental object-oriented programming (OOP) concept bundles data fields and the methods that operate on that data into a single unit while restricting direct external access?
  9. What is the primary function of the Domain Name System (DNS) in computer networking?
  10. In Python, what is the output of `type((42,))`?
  11. What sorting algorithm has an average and worst-case time complexity of and is based on a divide-and-conquer paradigm?
  12. In relational database design, what constraint uniquely identifies each record in a table and cannot contain `NULL` values?
  13. Which layer of the OSI (Open Systems Interconnection) 7-layer reference model is responsible for logical IP addressing and end-to-end packet routing?
  14. What is the result of the bitwise operation `12 & 10` in binary?
  15. What security practice requires users to provide two or more distinct verification credentials (such as a password and a one-time SMS/authenticator code) to gain account access?
  16. In Python, what is the output of the string slicing expression `'GetMyMockTest'[3:7]`?
  17. What type of machine learning algorithm is used when the model is trained on labeled historical data with known target outcomes?
  18. Which protocol in the TCP/IP suite provides reliable, connection-oriented, full-duplex byte stream transmission with error detection and flow control?
  19. In Python, what built-in data type represents an unordered, mutable collection of unique elements with no duplicates?
  20. What is the primary function of an operating system's kernel?
  21. What is the result of the following Python snippet: `bool(0) or bool('False')`?
  22. Which cryptographic concept uses a public key for encryption and a distinct, mathematically paired private key for decryption?
  23. In a relational database, what does the ACID acronym stand for regarding transaction management?
  24. What will be the output of `print(3 * 'AB' + 'C')` in Python?
  25. What algorithmic technique solves complex optimization problems by breaking them into overlapping subproblems and storing the subproblem solutions (memoization)?
  26. What type of software testing evaluates individual units, functions, or methods of source code in isolation to verify they work correctly?
  27. Which status code in HTTP response protocols indicates that the requested web resource could not be found on the server?
  28. In Python, what is the value of `x` after executing: `x = [1, 2, 3]; y = x; y.append(4)`?
  29. What is the primary vulnerability exploited by Cross-Site Scripting (XSS) attacks on web applications?
  30. What data structure is typically used to implement Breadth-First Search (BFS) graph traversal?
  31. What does the `len()` function return when called on the Python dictionary `d = {'a': 1, 'b': 2, 'c': 3}`?
  32. In version control using Git, which command creates a new isolated branch and switches your working directory to it simultaneously?
  33. What is the decimal equivalent of the hexadecimal number `0x2F`?
  34. In Python, what is the output of the expression `10 // 3`?
  35. What is the tightest worst-case time complexity of Merge Sort on an array of elements?
  36. In a binary search tree (BST), which traversal order visits the keys in strictly ascending sorted order?
  37. Given IPv4 address , what is the network address and broadcast address of this subnet?
  38. In SQL, which clause filters aggregated group results produced by a `GROUP BY` statement?
  39. In object-oriented programming, what mechanism allows a subclass to provide a specific implementation of a method already defined in its superclass?
  40. Which cryptographic protocol allows two parties to establish a shared secret key over an insecure communication channel without prior transmission of the secret?

Ready for the full Saudi Secondary School Certificate test?