Independent Preparation Bank for Pakistani Computing Graduates • 100% Free • No Signup
NSCTPrep.
Home/Subjects/Problem Solving & Analytical Skills/Problem Understanding & Analysis
Problem Solving & Analytical SkillsTopic #2 of 564 MCQs Available

Problem Understanding & Analysis

Comprehensive question bank, step-by-step rationales, and dedicated timed quiz for Problem Understanding & Analysis.

Launch Quiz Mode ↗

Problem Understanding & Analysis Question Bank

Showing 64 questions of 64 with verified answers

9Multiple Choice

(Conceptual) What happens when a break statement is encountered inside a loop?

10Multiple Choice

(Code Output) Look at this code containing a continue statement: for i from 1 to 4: if (i == 2): continue print(i) What is printed?

11Multiple Choice

(Debugging) Why will the following code result in an infinite loop? count = 10 while (count > 0): print(count) count = count + 1

12Multiple Choice

(Scenario-Based) An ATM machine asks a user for their PIN. If they get it wrong, it asks again, up to a maximum of 3 attempts. Which structure best models this?

13Multiple Choice

(Calculation) Trace the following algorithm that swaps two variables without a temporary variable: A = 5 B = 10 A = A + B B = A - B A = A - B What are the final values of A and B?

14Multiple Choice

(Conceptual) In programming, what is a "Base Case"?

15Multiple Choice

(Code Output) Trace this recursive algorithm: Function blastoff(n): if (n == 0): print("Ignition") else: print(n) blastoff(n - 1) blastoff(2)

16Multiple Choice

(Debugging) Look at this SWITCH statement: color = "Red" switch (color): case "Red": print("Stop") case "Green": print("Go") In languages like C, Java, or JS, what is printed?

17Multiple Choice

(Calculation) How many times will the following loop execute? for (i = 0; i < 10; i = i + 2)

18Multiple Choice

(Scenario-Based) A school grading system assigns 'A' for ≥ 90, 'B' for ≥ 80, and 'C' for ≥ 70. What is the most efficient control flow structure to determine a single student's grade?

19Multiple Choice

(Code Output) What does this algorithm do to an array `arr` of size `N`? for i from 0 to N-1: if (arr[i] < 0): arr[i] = 0

20Multiple Choice

(Conceptual) Which of the following best describes "Control Flow"?

21Multiple Choice

(Debugging) What is the danger of writing an IF statement like this in C/C++/Java? if (userRole = "Admin") { ... }

22Multiple Choice

(Code Output) flag = False while (NOT flag): print("Running") flag = True print("Done") How many times will "Running" be printed?

23Multiple Choice

(Scenario-Based) You need to create a menu that displays options to the user, waits for their input, and repeats UNTIL the user chooses "Exit". Which loop is the most natural fit?

24Multiple Choice

(Conceptual) What is the main purpose of "Pseudocode" in algorithmic design?

25Multiple Choice

(Code Output) x = 10 if (x > 5): if (x == 10): print("A") print("B") else: print("C") What will this output?

1Multiple Choice

(Conceptual) What is the primary purpose of "Data Abstraction" in software engineering?

2Multiple Choice

(Code Output / Logic) Consider the following pseudocode utilizing floating-point numbers: float x = 0.1 float y = 0.2 float z = 0.3 if ((x + y) == z): print("Equal") else: print("Not Equal") In most modern programming languages (Java, Python, C++), what is printed?

3Multiple Choice

(Scenario-Based) You are building a global messaging app. Users will send text in English, Arabic, Japanese, and use emojis. Which data representation standard MUST you choose for text encoding?

4Multiple Choice

(Calculation) How is the decimal number -5 represented in an 8-bit binary system using Two's Complement?

5Multiple Choice

(Debugging / Error Analysis) A game uses a standard 32-bit signed integer to track a player's money. A hacker discovers a glitch that gives them 3 billion coins. Suddenly, their coin balance reads as a massive negative number (e.g., -1,294,967,296). What phenomenon caused this?

6Multiple Choice

(Comparison) What is the difference between an Abstract Data Type (ADT) and a Data Structure?

7Multiple Choice

(Scenario-Based) An IoT temperature sensor sends data using a single byte (8 bits) without a sign bit (unsigned). What is the maximum temperature value it can represent?

8Multiple Choice

(Code Output / Bitwise) In many languages, performing a bitwise Left Shift (<<) by 1 position on an integer has the mathematical effect of:

9Multiple Choice

(Calculation) In web design, colors are often represented in Hexadecimal format (e.g., #FF0000). What does the FF represent in decimal, and what color does this code represent?

10Multiple Choice

(Scenario-Based) A developer is creating an email client. Email protocols (like SMTP) were originally designed to only handle 7-bit ASCII text. However, users need to attach images and PDFs (binary data). Which abstraction technique solves this representation problem?

11Multiple Choice

(Conceptual) What does the term "Endianness" (Big-Endian vs Little-Endian) refer to in computer science?

12Multiple Choice

(Debugging / Casting) Trace the following pseudocode: int a = 5 int b = 2 float result = a / b print(result) What is the likely output in languages like Java or C++?

13Multiple Choice

(Scenario-Based) You need to represent the read, write, and execute permissions of a file. You use a single integer where the bits represent permissions (e.g., Binary 111 means Read, Write, Execute). This technique is known as:

14Multiple Choice

(Conceptual) In Object-Oriented Programming, grouping related primitive data types and behaviors into a single Class (like grouping string name, int age into a Student class) is an example of:

15Multiple Choice

(Calculation) Convert the binary number 1011 to decimal.

16Multiple Choice

(Code Output) Look at this type conversion scenario: char letter = 'A' int value = (int) letter print(value) Assuming ASCII encoding, what is printed?

17Multiple Choice

(Debugging) A developer wants to store the number of human beings on Earth (approx 8.1 billion) in a database. They choose a standard 32-bit unsigned integer data type. What will happen?

18Multiple Choice

(Conceptual) Lossless compression (like a ZIP file) works by:

1Multiple Choice

(Conceptual) In the context of computational thinking, what is the primary relationship between Pattern Recognition and Generalization?

2Multiple Choice

(Scenario-Based) A developer notices that the code for "Validate User Phone Number," "Validate User Zip Code," and "Validate User ID" all involve checking if a string consists only of digits of a specific length. The developer decides to write one function isValidNumeric(input, length). This is an example of:

3Multiple Choice

(Code Output / Regex) A system uses a Regular Expression (Regex) to recognize a specific pattern in user-submitted filenames. The pattern is: ^[a-zA-Z]+[0-9]{2}$. Which of the following strings will be recognized (matched) by this pattern?

4Multiple Choice

(Comparison) A programmer observes that every time they use a "Bubble Sort" on a nearly sorted array, it runs very quickly. They conclude: "Bubble Sort is efficient for nearly sorted data." This type of logical reasoning is:

5Multiple Choice

(Scenario-Based) An antivirus software recognizes a new virus because its binary code contains a sequence of instructions very similar to an older, known piece of malware. This detection method is primarily based on:

6Multiple Choice

(Debugging) A developer creates a "Universal Database Connector" that handles SQL, NoSQL, and CSV files all in one massive function. Later, they find that changing one SQL parameter breaks the CSV logic. This is a classic example of:

7Multiple Choice

(Conceptual) In Machine Learning, what is the purpose of "Feature Extraction"?

8Multiple Choice

(Code Output / Logic) Trace the pattern in this sequence of numbers: 1, 1, 2, 3, 5, 8, 13.... What is the generalized rule to find the next number N?

9Multiple Choice

(Scenario-Based) You are designing a system that must handle IntList, StringList, and DoubleList. Instead of writing three separate classes, you use C++ Templates or Java Generics: List. This technical implementation is an example of:

10Multiple Choice

(Conceptual) Which of the following is an example of "Pattern Recognition" applied to User Experience (UX) design?

11Multiple Choice

(Code Output) What pattern is being checked in the following pseudocode? function check(str): for i from 0 to length(str)/2: if (str[i] != str[length(str) - 1 - i]): return False return True

12Multiple Choice

(Comparison) What is the primary difference between a "Standard Pattern" and an "Anti-Pattern" in software engineering?

13Multiple Choice

(Debugging / Regex) A developer writes a regex to capture text inside parentheses: \ (.*\). However, when given the string (

14Multiple Choice

(Scenario-Based) An e-commerce engine recognizes that a user who buys "Coffee Beans" almost always buys "Coffee Filters" next. This pattern is then used to generate a recommendation. This is an application of:

15Multiple Choice

(Conceptual) When we say a problem-solving strategy is "Deductive," we mean:

16Multiple Choice

(Code Output / Logic) You are given three functions: `calculateSquare()`, `calculateCircle()`, and `calculateTriangle()`. You decide to generalize them into `calculateArea(Shape s)`. This uses which programming concept?

17Multiple Choice

(Scenario-Based) You are analyzing 1,000 log files to find "Unauthorized Login" attempts. You notice that all such attempts originate from an IP range 192.168.1.x and occur between 2 AM and 4 AM. Creating a firewall rule based on this is:

18Multiple Choice

(Conceptual) Why is "Pattern Recognition" considered a core pillar of Computational Thinking?

1Multiple Choice

(Code-Math) You are implementing a circular queue using an array of size N. If the current index is i, which expression correctly calculates the next index, ensuring it wraps around to 0 when it reaches the end?

2Multiple Choice

(Calculation) Convert the Hexadecimal number 0x2F to its Decimal equivalent.

3Multiple Choice

(Scenario-Based) A database query uses the INTERSECT operator between two sets of User IDs: Set A {1, 2, 3, 4} and Set B {3, 4, 5, 6}. What is the resulting set?

4Multiple Choice

(Conceptual) In a dataset containing the response times of a web server, you notice a few "outliers" (requests that took 60 seconds while most took 0.1 seconds). Which statistical measure will give you the most accurate "typical" user experience?

5Multiple Choice

(Calculation) A system administrator wants to create a 4-digit PIN using only the digits 0-9. If repetitions are allowed, how many unique PIN combinations are possible?

6Multiple Choice

(Code-Math) What is the result of the following integer division and modulo operation in a language like C++ or Java? int x = 7 / 2; int y = 7 % 2;

7Multiple Choice

(Scenario-Based) A network switch has a 1% probability of dropping a packet. If you send two independent packets, what is the probability that BOTH packets will be dropped?

8Multiple Choice

(Calculation) In a Geometric Progression (GP) used for memory allocation (e.g., doubling the array size), the sequence is: 4, 8, 16, 32... What is the 7th term in this sequence?

9Multiple Choice

(Conceptual) Which mathematical concept is the foundation of "Hash Tables," ensuring that data is distributed across a fixed number of buckets?

10Multiple Choice

(Calculation) Convert the binary number 11010 to Decimal.

28Multiple Choice

A server receives 250 requests per second. Each request requires 12 milliseconds of CPU processing. What is the minimum number of CPU cores required to prevent an infinite queue buildup?