ECAT-Computer Science-Practice-3

Practice 50 ECAT Computer Science MCQs on Software Engineering, Web & Cybersecurity, AI & Machine Learning, Databases, and Computer Architecture on MM Academy (mmtestpreparation.com).

Practice questions

  1. Which Software Development Life Cycle (SDLC) model develops software iteratively in small working increments/releases with frequent customer feedback?
    • Agile / Iterative & Incremental model
    • Pure linear Waterfall model without feedback loops
    • Unstructured code-and-fix approach
    • Hardware-only manufacturing cycle
  2. In software testing, what is "white-box testing"?
    • Testing internal code structure, branches, loops, and execution paths with knowledge of source code
    • Testing purely through the external user interface without inspecting internal code
    • Testing only after customer deployment in production
    • Powering off the monitor during test runs
  3. What is "black-box testing"?
    • Testing functionality against requirements and specifications without needing knowledge of internal source-code implementation
    • Writing code inside a black terminal window
    • Measuring CPU fan noise
    • Deleting unit tests before release
  4. Which version control operation combines changes from one branch into another branch?
    • Merge
    • Format
    • Ping
    • Defragment
  5. In web development, which markup language defines the structure and semantic elements (headings, paragraphs, lists, links, forms) of a web page?
    • HTML (HyperText Markup Language)
    • CSS (Cascading Style Sheets)
    • SQL
    • Assembly
  6. In web development, what is the primary role of CSS (Cascading Style Sheets)?
    • Controlling visual presentation, layout, spacing, typography, and responsive styling of web elements
    • Executing relational database joins on the server
    • Assigning physical MAC addresses to network cards
    • Compiling C++ source code
  7. Which HTTP request method is typically used to submit form data or create a new resource on a web server?
    • POST
    • GET (retrieves data; should be safe and idempotent)
    • HEAD (retrieves headers only)
    • OPTIONS
  8. What is a "SQL Injection" vulnerability?
    • An attack where unsanitized user input is concatenated directly into a database query string, allowing an attacker to manipulate SQL commands
    • Overheating a laptop battery
    • Using a strong password manager
    • Compressing images into WebP format
  9. What is "Cross-Site Scripting (XSS)" in web security?
    • Injecting malicious scripts (typically JavaScript) into trusted web pages viewed by other users when output is not properly escaped/sanitized
    • Replacing an Ethernet cable with fiber optics
    • Backing up a database to cloud storage
    • Increasing screen resolution
  10. What does "Two-Factor Authentication (2FA)" or Multi-Factor Authentication (MFA) require?
    • Verification using two or more independent authentication factors (such as something you know like a password plus something you have like an authenticator app/token or biometrics)
    • Typing a password twice in the same box
    • Disabling account lockouts
    • Sharing passwords across team members
  11. In artificial intelligence and search algorithms, which property makes A* search optimal when using an admissible heuristic h(n)?
    • An admissible heuristic never overestimates the true remaining cost to a goal (0 <= h(n) <= h*(n)), and evaluation function f(n) = g(n) + h(n) finds a least-cost path
    • A* ignores path cost g(n) completely
    • A* always expands nodes in reverse alphabetical order
    • A* requires infinite memory for every finite graph
  12. In machine learning, what is "overfitting"?
    • When a model memorizes training data (including noise and idiosyncrasies) too closely and performs poorly on unseen test/validation data
    • When a model is too simple to capture underlying patterns (underfitting)
    • When dataset labels are missing
    • When training accuracy equals 0%
  13. In supervised machine learning, what is the main difference between "classification" and "regression"?
    • Classification predicts discrete category/class labels (e.g., spam vs. not spam), whereas regression predicts continuous numerical values (e.g., house price or temperature)
    • Classification uses only SQL tables while regression uses only images
    • Regression outputs only 0 or 1
    • Classification has no target variable
  14. Which logic gate outputs 0 (LOW) if and only if ALL of its inputs are 1 (HIGH)?
    • NAND gate
    • OR gate
    • AND gate
    • BUFFER
  15. Convert the hexadecimal number (A5)_{16} into decimal (base 10):
    • 165
    • 155
    • 175
    • 145
  16. Convert the decimal number 42 into binary (base 2):
    • (101010)_2
    • (110100)_2
    • (100110)_2
    • (111010)_2
  17. In a relational database, which normal form (3NF) requires that the table be in 2NF and have NO transitive dependencies of non-key attributes on the primary key?
    • Third Normal Form (3NF)
    • Unnormalized form (0NF)
    • Cartesian product only
    • Read-only view
  18. Which SQL JOIN returns all rows from the left table and matching rows from the right table (filling NULLs for non-matching right columns)?
    • LEFT JOIN (LEFT OUTER JOIN)
    • CROSS JOIN only
    • DROP JOIN
    • TRUNCATE JOIN
  19. What is the maximum number of edges in a simple undirected graph with n vertices (no self-loops or parallel edges)?
    • n(n - 1) / 2
    • n(n - 1)
    • 2n
    • n^2
  20. A connected undirected tree with n vertices (where n >= 1) always has how many edges?
    • n - 1 edges
    • n edges
    • n + 1 edges
    • 2n edges
  21. Which search algorithm explores as far as possible along each branch before backtracking, typically implemented using recursion or an explicit stack?
    • Depth-First Search (DFS)
    • Breadth-First Search (BFS)
    • Binary Search
    • Round-Robin scheduling
  22. In operating systems, what is "virtual memory"?
    • A memory management technique that gives each process an illusion of a large contiguous address space by mapping virtual addresses to physical RAM and backing storage (swap/paging file)
    • Physical magnetic tape storage
    • Graphics card VRAM exclusively
    • A network firewall rule
  23. What is a "page fault" in an operating system using demand paging?
    • An interrupt/trap raised by the hardware MMU when a program accesses a virtual page that is currently not loaded in physical memory frames
    • A syntax error in Python
    • A full hard drive with zero free space
    • A successful DNS lookup
  24. Which OSI layer handles framing, physical/MAC addressing, and error detection (such as CRC) over a direct link?
    • Data Link Layer (Layer 2)
    • Session Layer (Layer 5)
    • Presentation Layer (Layer 6)
    • Application Layer (Layer 7)
  25. Which application-layer protocol is used to transfer files between a client and server over a network?
    • FTP (File Transfer Protocol) / SFTP
    • ARP
    • RARP
    • ICMP
  26. In programming, what is a "function" or "subroutine"?
    • A reusable, named block of code that performs a specific task, can accept input parameters/arguments, and may return a value
    • A permanent hard-disk sector
    • A power supply cable
    • An uninitialized integer
  27. What is "recursion" in programming?
    • A technique where a function calls itself (directly or indirectly) on a smaller subproblem until reaching a stopping condition called the base case
    • A loop that runs forever with no exit condition
    • Sorting numbers in descending order
    • Converting decimal to octal
  28. What is the time complexity of accessing an element by index arr[i] in a standard one-dimensional array of size n?
    • O(1)
    • O(log n)
    • O(n)
    • O(n log n)
  29. Which sorting algorithm has a worst-case time complexity of O(n^2) and builds the final sorted array one element at a time by inserting each new item into its proper position among previously sorted elements?
    • Insertion Sort
    • Merge Sort
    • Heap Sort
    • Quick Sort (average)
  30. Which data structure is used to implement a Priority Queue efficiently with O(log n) insertion and O(log n) extraction of the highest/lowest priority element?
    • Binary Heap (Max-Heap or Min-Heap)
    • Unsorted stack without auxiliary tracking
    • Single character variable
    • Plain text log file
  31. In an Object-Oriented language, what is a "constructor"?
    • A special method/member function invoked automatically when an object of a class is instantiated to initialize its state/attributes
    • A destructor that deletes the operating system
    • A static comment line
    • A SQL table alias
  32. What is "method overriding" in Object-Oriented Programming?
    • Providing a specific implementation in a subclass for a method that is already defined in its superclass with the same signature (supporting runtime polymorphism)
    • Writing two functions with different parameter types in the same scope (method overloading)
    • Renaming a file on disk
    • Clearing the browser cache
  33. Which Boolean expression equals 1 when inputs A and B are EQUAL (A XNOR B, equivalence)?
    • Y = A · B + A' · B'
    • Y = A' · B + A · B'
    • Y = A · B
    • Y = A + B
  34. What is the decimal equivalent of the binary fraction (0.101)_2?
    • 0.625 (1/2 + 0/4 + 1/8 = 0.5 + 0 + 0.125 = 0.625)
    • 0.500
    • 0.750
    • 0.375
  35. In CPU architecture, what is the role of the "Program Counter (PC)" (also called Instruction Pointer)?
    • Holds the memory address of the next instruction to be fetched and executed
    • Stores intermediate floating-point results only
    • Controls keyboard backlight brightness
    • Formats external USB drives
  36. Which non-volatile storage medium uses NAND flash memory cells without moving mechanical platters?
    • Solid-State Drive (SSD) / NVMe / USB flash drive
    • Traditional spinning Hard Disk Drive (HDD)
    • SRAM CPU cache
    • Magnetic core drum
  37. Which SQL command is used to insert new rows into an existing table?
    • INSERT INTO
    • SELECT
    • DELETE FROM
    • ALTER INDEX
  38. Which SQL clause sorts query output rows in ascending (ASC) or descending (DESC) order?
    • ORDER BY
    • GROUP BY
    • WHERE
    • DISTINCT
  39. In networking, what is the loopback IPv4 address used to test the local TCP/IP stack on a host?
    • 127.0.0.1 (localhost, within 127.0.0.0/8)
    • 192.168.1.1 always
    • 255.255.255.255
    • 0.0.0.0
  40. Which cryptographic hash property means even a tiny change in input produces a completely different, unpredictable hash digest (avalanche effect)?
    • Sensitivity / avalanche effect and preimage/collision resistance
    • Reversible encryption using a public key
    • Plaintext readability
    • Constant output regardless of input
  41. In software engineering, what is a "unit test"?
    • Automated or structured testing of an individual small module, function, or class in isolation to verify it behaves as intended
    • Hiring new software engineers
    • Purchasing domain names
    • Deploying code to end users without verification
  42. What is "refactoring" in software engineering?
    • Restructuring existing source code internally to improve readability, maintainability, or modularity without changing its external observable behavior
    • Rewriting the entire operating system from scratch in machine code
    • Deleting database backups
    • Increasing network latency
  43. Which data structure represents hierarchical relationships such as file systems, HTML DOM trees, and organizational charts?
    • Tree
    • Linear queue alone
    • Flat single integer
    • Unsorted string
  44. What is a "Directed Acyclic Graph (DAG)"?
    • A directed graph containing no directed cycles, commonly used for task scheduling, build dependencies, and expression evaluation
    • An undirected graph with at most one vertex
    • A graph where every edge has negative weight
    • A binary search tree with duplicate roots
  45. In a relational database, what is a "composite primary key"?
    • A primary key made up of two or more columns combined to uniquely identify each row in a table
    • A primary key that allows NULL values in every column
    • A foreign key pointing to a text file
    • An index that deletes rows automatically
  46. Which network protocol operates at the Transport Layer (Layer 4) and sends datagrams without connection setup or guaranteed delivery/retransmission, making it suited for low-latency live streaming or DNS/VoIP?
    • UDP (User Datagram Protocol)
    • TCP
    • HTTP
    • SMTP
  47. In C/C++, what happens if you access an array element outside its valid index bounds (e.g., index n or -1 for a size-n array)?
    • Undefined behavior / out-of-bounds memory access (which can cause crashes, memory corruption, or security bugs)
    • Automatic array expansion with zero risk
    • Compilation always stops with a warning that prevents execution
    • The value automatically becomes zero safely
  48. What is the decimal value of the binary number (10000)_2?
    • 16
    • 8
    • 32
    • 4
  49. Which logic operation equals 1 when input A is 0, and 0 when input A is 1?
    • NOT (Inverter)
    • AND
    • OR
    • NAND
  50. Which software development practice uses automated builds and automated tests whenever code changes are pushed/committed to detect integration issues early?
    • Continuous Integration (CI)
    • Manual paper-only planning
    • Skipping code reviews permanently
    • Hardcoding credentials in public code
MM Academy Preparing your learning space…