MCQs / Computer Science / NSCT: Integrated Scenarios

NSCT: Integrated Scenarios MCQs — Computer Science (page 5)

120 multiple-choice questions on NSCT: Integrated Scenarios from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

101. Scenario – Exam Registration Website Gets Hacked A provincial testing body's registration site has a login form. Logs show the input admin' -- in the username field, after which an attacker logged in as admin. Later, a comment box on the site started showing a pop-up and redirecting visitors to a fake page. The site uses HTTP, not HTTPS. Question: The most effective fix for the login problem is:

  1. Parameterised queries (prepared statements)
  2. Hiding the login page URL
  3. Longer usernames
  4. A CAPTCHA only

Answer: A) Parameterised queries (prepared statements)

Explanation: Input is then treated as data, never as SQL code. Scenario S05 · Areas: Security, Web, Databases

Discuss this question

102. Scenario – Online Admission Form A college's admission form collects name, CNIC, email, marks and a photo. Some applicants entered "abc" as their email and marks of 1200 out of 1100. Photos are uploaded to the web server's public folder with their original file names. One file was named "shell.php". Question: The CNIC column should be declared:

  1. UNIQUE, so the same person cannot apply twice
  2. As a foreign key to photos
  3. As a FLOAT
  4. Nullable for everyone

Answer: A) UNIQUE, so the same person cannot apply twice

Explanation: A unique constraint prevents duplicate applications. Scenario S19 · Areas: Web, Databases, Security

Discuss this question

103. Scenario – Chat App Message Delivery A team builds a live chat app. At first the browser asks the server every 2 seconds "Any new messages?", which creates heavy load. Messages must arrive in order and without loss. Voice calls are planned later, where small losses are acceptable but delay is not. Question: If 1,000 users each poll every 2 seconds, how many requests per minute reach the server?

  1. 30,000
  2. 60,000
  3. 500
  4. 2,000

Answer: A) 30,000

Explanation: Each user makes 30 requests per minute × 1,000 = 30,000. Scenario S28 · Areas: Networks, Web, Programming

Discuss this question

104. Scenario – Startup's GitHub Leak A junior developer pushed code to a public GitHub repository. The code contained the cloud database password and an AWS access key in a config file. Within an hour, unknown servers were started on the company's cloud account, costing thousands of dollars. Question: Which Git file helps prevent committing local config files?

  1. LICENSE
  2. .gitkeep
  3. README.md
  4. .gitignore

Answer: D) .gitignore

Explanation: It lists files Git should not track. Scenario S17 · Areas: Security, Software Engineering, Cloud

Discuss this question

105. Scenario – Login Page Under Attack A job portal's logs show 50,000 failed login attempts in an hour from many IP addresses, using common passwords like "123456" and "pakistan123" against many usernames. Some accounts were compromised because their owners used the same password on a leaked forum. Question: Using leaked username–password pairs from another site is:

  1. Session fixation only
  2. Credential stuffing
  3. SQL injection
  4. Cross-site scripting

Answer: B) Credential stuffing

Explanation: It works because of password reuse. Scenario S30 · Areas: Security, Web, Problem Solving

Discuss this question

106. Scenario – AI Admission Predictor Fairness A university trains a model to predict which applicants will succeed, using 10 years of past admission data. Testing shows the model rejects more applicants from rural districts with the same marks as urban applicants. The past data had very few rural students. Question: The unfair outcome most likely comes from:

  1. Using HTTPS
  2. A slow CPU
  3. Bias in the training data
  4. Too much RAM

Answer: C) Bias in the training data

Explanation: Models learn patterns – including bias – from historical data. Scenario S29 · Areas: AI/ML, Ethics, Data Analytics

Discuss this question

107. Scenario – Software House Project Delay A software house estimates a project at 12 weeks. Tasks: A (design, 2 weeks), B (backend, 5 weeks, after A), C (frontend, 4 weeks, after A), D (integration and testing, 3 weeks, after both B and C). Halfway through, the client asks for daily changes by phone, and testing finds many bugs in old features after each change. Question: Uncontrolled growth of features during a project is called:

  1. Code coverage
  2. Technical review
  3. Refactoring
  4. Scope creep

Answer: D) Scope creep

Explanation: Change control and a clear backlog manage it. Scenario S21 · Areas: Software Engineering, Problem Solving

Discuss this question

108. Scenario – Recommendation Engine for an Online Bookshop An online bookshop wants to show "Customers who bought this also bought…" on each book page. It has 5 years of purchase history. The data team also wants to group customers into segments for marketing, but they have no predefined segment labels. Question: Grouping customers into segments without labels is an example of:

  1. Supervised classification
  2. Unsupervised learning (clustering)
  3. Linear regression only
  4. Reinforcement learning

Answer: B) Unsupervised learning (clustering)

Explanation: K-means and similar algorithms find groups. Scenario S23 · Areas: AI/ML, Databases, Web

Discuss this question

109. Scenario – Bank Fraud Detection Pipeline A bank collects card transactions (amount, time, merchant, city) to train a fraud model. The model scored 99.5% on training data but only 70% on new data. Amount ranges from Rs 10 to Rs 5,000,000 while other features are between 0 and 1. Customer card numbers are included in the training files shared with an outside vendor. Question: Sharing card numbers with the vendor is risky. The best approach is to:

  1. Post them on GitHub
  2. Mask, tokenise or remove card numbers before sharing
  3. Email them in a zip file
  4. Store them in plain text

Answer: B) Mask, tokenise or remove card numbers before sharing

Explanation: Share only what is needed (data minimisation). Scenario S14 · Areas: AI/ML, Databases, Security, Problem Solving

Discuss this question

110. Scenario – Food Delivery App Planning Three graduates want to launch a food delivery app in Multan within 3 months. They are not sure which features customers want; restaurant owners keep suggesting new ideas. They plan a customer app, a rider app and a restaurant dashboard, and expect to change things often. Question: Which development approach suits them best?

  1. No process at all
  2. The V-model with formal sign-off for each phase
  3. Agile (e.g. Scrum) with short sprints and frequent feedback
  4. Pure Waterfall with all requirements fixed on day one

Answer: C) Agile (e.g. Scrum) with short sprints and frequent feedback

Explanation: Changing, unclear requirements fit iterative development. Scenario S06 · Areas: Software Engineering, Web, Cloud

Discuss this question

111. Scenario – Data Centre Power and Storage A company's file server stores 20 TB of design files on one hard disk. Last month the disk failed and two days of work were lost. The company wants to survive one disk failure without downtime and to recover from accidental deletion. Question: Does RAID replace backups?

  1. Yes – RAID is a full backup
  2. Only RAID 0 is a backup
  3. Yes, if the disks are new
  4. No – RAID protects against disk failure, not deletion or ransomware

Answer: D) No – RAID protects against disk failure, not deletion or ransomware

Explanation: Deleted files are deleted on all RAID disks too. Scenario S27 · Areas: Operating Systems, Cloud, Security

Discuss this question

112. Scenario – Data Centre Power and Storage A company's file server stores 20 TB of design files on one hard disk. Last month the disk failed and two days of work were lost. The company wants to survive one disk failure without downtime and to recover from accidental deletion. Question: "We can lose at most 1 hour of data" sets the:

  1. Bandwidth
  2. Recovery Time Objective (RTO)
  3. Recovery Point Objective (RPO)
  4. Mean time between failures

Answer: C) Recovery Point Objective (RPO)

Explanation: RPO is about data loss; RTO is about downtime. Scenario S27 · Areas: Operating Systems, Cloud, Security

Discuss this question

113. Scenario – Mobile Wallet Money Transfer PaySaathi, a fintech startup, lets users send money from their wallet to another user. The transfer subtracts money from the sender's balance and adds it to the receiver's. During testing, a power failure happened after the subtraction but before the addition – the money disappeared. The app also stores the user's 4-digit PIN in the database. Question: After a COMMIT, the transfer must survive a crash. This property is:

  1. Redundancy
  2. Atomicity
  3. Durability
  4. Consistency only

Answer: C) Durability

Explanation: Committed changes are written to non-volatile storage/logs. Scenario S03 · Areas: Databases, Security, Software Engineering, Programming

Discuss this question

114. Scenario – University Result Portal A public university publishes semester results on a portal. On result day 60,000 students log in within one hour. Last time, the database CPU hit 100% because every page load re-ran a heavy query joining students, courses and marks. Results never change after they are published. Students in remote areas have slow mobile internet. Question: Since published results never change, the most effective way to cut database load is to:

  1. Run the join query twice for accuracy
  2. Disable the database index
  3. Cache the computed result pages or query results
  4. Add more joins

Answer: C) Cache the computed result pages or query results

Explanation: Read-heavy, rarely-changing data is ideal for caching. Scenario S02 · Areas: Web, Networks, Databases, Software Engineering

Discuss this question

115. Scenario – Recommendation Engine for an Online Bookshop An online bookshop wants to show "Customers who bought this also bought…" on each book page. It has 5 years of purchase history. The data team also wants to group customers into segments for marketing, but they have no predefined segment labels. Question: Recommending books based on what similar customers bought is:

  1. Collaborative filtering
  2. Encryption
  3. Normalisation
  4. Bubble sort

Answer: A) Collaborative filtering

Explanation: It uses patterns in many users' behaviour. Scenario S23 · Areas: AI/ML, Databases, Web

Discuss this question

116. Scenario – News Website Goes Viral A news website's story goes viral. Visitors jump from 2,000 to 200,000 per hour. The site is built with server-side rendered pages that hit the database for every request, even though each article changes rarely. Many visitors are overseas. Question: What single change would reduce database load the most?

  1. Cache rendered article pages (e.g. in Redis or a reverse proxy)
  2. Use longer article titles
  3. Switch off compression
  4. Add more database columns

Answer: A) Cache rendered article pages (e.g. in Redis or a reverse proxy)

Explanation: Cached pages are served without querying the database. Scenario S25 · Areas: Web, Cloud, Networks

Discuss this question

117. Scenario – Server Crashes Under Heavy Jobs A video processing service runs on a Linux server with 8 GB RAM. When many users upload at once, the server becomes extremely slow: the disk light is always on and CPU usage drops while every process waits. A developer also notices two worker threads sometimes write to the same progress counter and the numbers come out wrong. Question: The server constantly swapping pages while doing little useful work is:

  1. Booting
  2. Deadlock
  3. Thrashing
  4. Caching

Answer: C) Thrashing

Explanation: Too little memory for the active processes. Scenario S10 · Areas: Operating Systems, Programming, Cloud

Discuss this question

118. Scenario – Hospital Records System A hospital in Peshawar stores patients, doctors and appointments in one spreadsheet-like table: (PatientID, PatientName, Phone, DoctorID, DoctorName, DoctorSpecialty, AppointmentDate). When a doctor changes specialty, staff must update hundreds of rows, and some rows are missed. Patient data is sensitive and the hospital wants to move to a proper system. Question: The repeated doctor details and missed updates are an example of:

  1. An update anomaly caused by poor normalisation
  2. Overfitting
  3. A network collision
  4. A deadlock

Answer: A) An update anomaly caused by poor normalisation

Explanation: Redundant data leads to inconsistent updates. Scenario S04 · Areas: Databases, Security, Software Engineering

Discuss this question

119. Scenario – Campus Wi-Fi Problems A university hostel's Wi-Fi is slow in the evening. The IT team finds that one laptop is sending thousands of packets per second to many IP addresses, and some students are using a hotspot named "Hostel-WiFi-Free" that was set up by an unknown person. The access points still use WEP. Question: The access points should be upgraded from WEP to:

  1. WEP2
  2. MAC filtering only
  3. Open authentication
  4. WPA3 (or at least WPA2)

Answer: D) WPA3 (or at least WPA2)

Explanation: WEP is easily cracked. Scenario S22 · Areas: Networks, Security, Operating Systems

Discuss this question

120. Scenario – Hospital Records System A hospital in Peshawar stores patients, doctors and appointments in one spreadsheet-like table: (PatientID, PatientName, Phone, DoctorID, DoctorName, DoctorSpecialty, AppointmentDate). When a doctor changes specialty, staff must update hundreds of rows, and some rows are missed. Patient data is sensitive and the hospital wants to move to a proper system. Question: In the Appointments table, PatientID and DoctorID should be:

  1. Primary keys of Appointments only
  2. Foreign keys
  3. Encrypted passwords
  4. Indexes on doctor names

Answer: B) Foreign keys

Explanation: They reference the Patients and Doctors tables. Scenario S04 · Areas: Databases, Security, Software Engineering

Discuss this question

Previous Page 5 of 5

Practise NSCT: Integrated Scenarios MCQs

More Computer Science chapters