MCQs / Computer Science / NSCT: Integrated Scenarios

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

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.

26. 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 best design is to:

  1. Store everything in one text file
  2. Add more columns to the same table
  3. Remove the DoctorID column
  4. Split into Patients, Doctors and Appointments tables linked by foreign keys

Answer: D) Split into Patients, Doctors and Appointments tables linked by foreign keys

Explanation: Normalisation (to 3NF) stores each fact once. Scenario S04 · Areas: Databases, Security, Software Engineering

Discuss this question

27. 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: Explaining which features influenced each decision relates to:

  1. Explainable AI (model transparency)
  2. Normalisation in databases
  3. Network latency
  4. Data compression

Answer: A) Explainable AI (model transparency)

Explanation: Stakeholders need to understand automated decisions. Scenario S29 · Areas: AI/ML, Ethics, Data Analytics

Discuss this question

28. Scenario – Traffic Signal Controller A city installs smart traffic signals. Each controller must change lights within 50 milliseconds of a sensor signal; a delay could cause accidents. The software has four tasks: read sensors (every 10 ms), update lights, log data and send reports to the control room. Question: If the sensor task runs every 10 ms, how many times does it run in one minute?

  1. 600
  2. 60,000
  3. 6,000
  4. 1,000

Answer: C) 6,000

Explanation: 60,000 ms ÷ 10 ms = 6,000. Scenario S18 · Areas: Operating Systems, Software Engineering, Problem Solving

Discuss this question

29. 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: A responsible first step is to:

  1. Hide the results from everyone
  2. Delete the rural applicants
  3. Deploy it immediately
  4. Audit the model's results across groups and rebalance or fix the data

Answer: D) Audit the model's results across groups and rebalance or fix the data

Explanation: Fairness testing identifies and reduces bias. Scenario S29 · Areas: AI/ML, Ethics, Data Analytics

Discuss this question

30. 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: For chat messages that must arrive in order and without loss, the transport protocol is:

  1. ICMP
  2. TCP
  3. ARP
  4. UDP

Answer: B) TCP

Explanation: TCP is reliable and ordered. Scenario S28 · Areas: Networks, Web, Programming

Discuss this question

31. Scenario – Ransomware at a Small Business An accounting firm in Faisalabad found all its files renamed with ".locked" and a ransom note demanding Bitcoin. An employee had opened an email attachment called "Invoice.pdf.exe" the day before. Backups were stored on a USB drive that was always plugged into the same server, and it was encrypted too. Question: "Invoice.pdf.exe" disguised as a document is a typical:

  1. Worm via SQL injection
  2. DNS cache
  3. Trojan delivered by phishing
  4. Hardware failure

Answer: C) Trojan delivered by phishing

Explanation: It looks harmless but runs malware. Scenario S08 · Areas: Security, Operating Systems, Cloud

Discuss this question

32. Scenario – Branch Offices Network Design A company has a head office in Islamabad and branches in Karachi and Quetta. It has been given the private network 192.168.10.0/24 and must divide it into 4 equal subnets – one per site plus one for servers. Branch staff need to access the head office's accounting system securely over the internet. Question: To connect branches to the head office securely over the internet, they should use:

  1. Open Telnet access
  2. Public Wi-Fi hotspots
  3. A site-to-site VPN
  4. FTP without passwords

Answer: C) A site-to-site VPN

Explanation: A VPN creates an encrypted tunnel. Scenario S07 · Areas: Networks, Security, Problem Solving

Discuss this question

33. 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: Which additional control slows such automated attacks?

  1. Showing which part of the login was wrong
  2. Disabling HTTPS
  3. Rate limiting / temporary lockouts and CAPTCHA after failures
  4. Allowing unlimited attempts

Answer: C) Rate limiting / temporary lockouts and CAPTCHA after failures

Explanation: Limiting attempts makes guessing impractical. Scenario S30 · Areas: Security, Web, Problem Solving

Discuss this question

34. 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: To avoid slowing book pages, recommendations should be:

  1. Recomputed from all 5 years of data on every page view
  2. Sent by email only
  3. Typed manually by staff
  4. Precomputed periodically and cached

Answer: D) Precomputed periodically and cached

Explanation: Batch computation plus caching keeps pages fast. Scenario S23 · Areas: AI/ML, Databases, Web

Discuss this question

35. 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: The portal should show each student only their own result. This is mainly a question of:

  1. Normalisation
  2. Authorisation (access control)
  3. Compilation
  4. Routing protocols

Answer: B) Authorisation (access control)

Explanation: After login, the server must check the student owns the requested record. Scenario S02 · Areas: Web, Networks, Databases, Software Engineering

Discuss this question

36. 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: A rogue hotspot imitating the official network is called an:

  1. Buffer overflow
  2. SQL injection
  3. Logic bomb
  4. Evil twin attack

Answer: D) Evil twin attack

Explanation: It lets attackers capture traffic (MITM). Scenario S22 · Areas: Networks, Security, Operating Systems

Discuss this question

37. Scenario – Traffic Signal Controller A city installs smart traffic signals. Each controller must change lights within 50 milliseconds of a sensor signal; a delay could cause accidents. The software has four tasks: read sensors (every 10 ms), update lights, log data and send reports to the control room. Question: Which development model suits this safety-critical system with fixed requirements best?

  1. V-model with verification and validation at each stage
  2. Ad-hoc coding without tests
  3. Releasing weekly untested builds
  4. Only prototyping

Answer: A) V-model with verification and validation at each stage

Explanation: Each phase has a matching test phase. Scenario S18 · Areas: Operating Systems, Software Engineering, Problem Solving

Discuss this question

38. Scenario – Hospital Queue Token System A hospital's token system serves patients in arrival order, but emergency patients must be seen before others. Average consultation is 6 minutes, and there are 3 doctors. At 9:00 AM, 45 regular patients are waiting. Question: If regular patients may wait forever because emergencies keep arriving, the problem is:

  1. Thrashing
  2. Starvation
  3. Overfitting
  4. Deadlock

Answer: B) Starvation

Explanation: Aging (raising priority over time) can fix it. Scenario S24 · Areas: DSA, Operating Systems, Problem Solving

Discuss this question

39. 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: How should the counter update be protected?

  1. Make the counter a string
  2. Add print statements
  3. Use a mutex/lock (or an atomic operation) around it
  4. Run the threads on different days

Answer: C) Use a mutex/lock (or an atomic operation) around it

Explanation: Mutual exclusion makes the update safe. Scenario S10 · Areas: Operating Systems, Programming, Cloud

Discuss this question

40. 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: Which control would stop most of these logins even if the password is correct?

  1. Multi-factor authentication (MFA)
  2. Turning off logging
  3. Hiding the logo
  4. A longer page title

Answer: A) Multi-factor authentication (MFA)

Explanation: A second factor blocks stolen-password logins. Scenario S30 · Areas: Security, Web, Problem Solving

Discuss this question

41. 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: Re-running old tests after each change to catch new bugs in old features is:

  1. Regression testing
  2. Acceptance testing
  3. Smoke testing only
  4. Alpha testing

Answer: A) Regression testing

Explanation: It checks changes did not break existing functionality. Scenario S21 · Areas: Software Engineering, Problem Solving

Discuss this question

42. 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: Checking that email looks valid and marks are not above total should be done:

  1. Only by a human after a week
  2. On both client and server, with the server check being essential
  3. Not at all
  4. Only in the browser

Answer: B) On both client and server, with the server check being essential

Explanation: Client-side checks help users; server-side checks enforce rules. Scenario S19 · Areas: Web, Databases, Security

Discuss this question

43. Scenario – Hospital Queue Token System A hospital's token system serves patients in arrival order, but emergency patients must be seen before others. Average consultation is 6 minutes, and there are 3 doctors. At 9:00 AM, 45 regular patients are waiting. Question: With 3 doctors and 6 minutes per patient, how long will 45 waiting patients take to be seen (no emergencies)?

  1. 90 minutes
  2. 135 minutes
  3. 270 minutes
  4. 45 minutes

Answer: A) 90 minutes

Explanation: 45 ÷ 3 = 15 rounds × 6 min = 90 min. Scenario S24 · Areas: DSA, Operating Systems, Problem Solving

Discuss this question

44. Scenario – Online Clothing Store on Sale Day KaprraHub, a Lahore-based online clothing store, runs a single web server and a MySQL database on one virtual machine. During last year's 11.11 sale, traffic rose 15 times, pages took 20 seconds to load and the site crashed for three hours. Customers also complained that product search is slow. The team has a small budget and wants to avoid this year's crash. Question: What is the BEST way to handle the sale-day traffic spike?

  1. Turn off HTTPS during the sale
  2. Ask customers to shop at night
  3. Buy one very large physical server permanently
  4. Put the web tier behind a load balancer with auto-scaling instances

Answer: D) Put the web tier behind a load balancer with auto-scaling instances

Explanation: Elastic horizontal scaling adds servers only when needed, matching a small budget. Scenario S01 · Areas: Web, Cloud, Databases, Security

Discuss this question

45. 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: A tool the IT team can use to capture and inspect the suspicious packets is:

  1. Wireshark
  2. Git
  3. Photoshop
  4. MS Word

Answer: A) Wireshark

Explanation: Wireshark analyses network traffic. Scenario S22 · Areas: Networks, Security, Operating Systems

Discuss this question

46. Scenario – Library Management System Design Students are building a library system in Java. A Book has title, ISBN and author; EBook and PrintedBook both extend Book and override getLoanDays(). The librarian wants to search a book by ISBN instantly among 200,000 books and to see books ordered by title. Question: Keeping a Book's fields private and accessing them through getters and setters is:

  1. Inheritance
  2. Encapsulation
  3. Polymorphism
  4. Abstraction of hardware

Answer: B) Encapsulation

Explanation: Data hiding protects the object's state. Scenario S16 · Areas: Programming, DSA, Databases, Software Engineering

Discuss this question

47. Scenario – Online Quiz App With JavaScript A teacher builds an online quiz in plain JavaScript. The correct answers are stored in a JavaScript array in the page, and the score is calculated in the browser and sent to the server as score=8. Some students got full marks without studying. Question: The correct fix is to:

  1. Use a different font
  2. Minify the JavaScript
  3. Disable right-click
  4. Keep answers on the server and calculate the score server-side

Answer: D) Keep answers on the server and calculate the score server-side

Explanation: Never trust the client for security decisions. Scenario S13 · Areas: Web, Programming, Security

Discuss this question

48. 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 wrong counter values from two threads are caused by a:

  1. Syntax error
  2. Firewall rule
  3. Race condition
  4. Page fault

Answer: C) Race condition

Explanation: Unsynchronised access to shared data. Scenario S10 · Areas: Operating Systems, Programming, Cloud

Discuss this question

49. 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: Where should secrets like keys and passwords be kept?

  1. In the README file
  2. In code comments
  3. In environment variables or a secrets manager, not in source code
  4. In the HTML page

Answer: C) In environment variables or a secrets manager, not in source code

Explanation: Secrets should never be committed to version control. Scenario S17 · Areas: Security, Software Engineering, Cloud

Discuss this question

50. Scenario – Cloud Migration for a Textile Mill A textile mill runs its ERP on an old server in the factory. Power cuts often shut it down. Management wants to move to the cloud but is worried about cost, control and internet outages. They want to keep running the same ERP software but stop managing hardware. Question: To keep working during internet outages at the factory, they should:

  1. Turn off the firewall
  2. Store passwords on paper
  3. Use two internet links from different ISPs (redundancy)
  4. Use only one cheaper link

Answer: C) Use two internet links from different ISPs (redundancy)

Explanation: Redundant links remove a single point of failure. Scenario S15 · Areas: Cloud, Networks, Software Engineering

Discuss this question

Previous Page 2 of 5 Next

Practise NSCT: Integrated Scenarios MCQs

More Computer Science chapters