Logical Reasoning Fundamentals Question Bank
Showing 65 questions of 65 with verified answers
(Scenario-Based) An algorithm's runtime is described by the sequence 10, 20, 30, 40... ms for input sizes 1, 2, 3, 4. This represents an Arithmetic Progression (AP). What will the runtime be for an input size of 100?
(Code-Math) To check if an integer n is an even number, which logical expression is the most efficient?
(Calculation) You need to choose a 2-person "Security Committee" from a team of 5 developers. Order does not matter. How many different committees can be formed?
(Conceptual) In Big-O analysis, which of the following mathematical functions grows the FASTEST as n becomes large?
(Scenario-Based) A load balancer uses a "Weighted Round Robin" algorithm. Server A has weight 3, and Server B has weight 1. If 12 requests arrive, mathematically how many should go to Server A?
(Calculation) What is the result of binary addition: 1011 + 0011?
(Conceptual) Which mathematical property is used when we say (A AND
(Scenario-Based) A 3D game engine uses Matrix Multiplication to rotate objects. If you multiply a 1x3 matrix by a 3x3 matrix, what are the dimensions of the resulting matrix?
(Code-Math) A random number generator returns an integer between 1 and 100. What is the probability that the number generated is a Prime Number?
(Calculation) If a system's uptime is "Three Nines" (99.9%), what is the maximum allowed downtime per year (approx 365 days)?
(Conceptual) In Boolean Algebra, the expression A + 1 (where + is the OR operator and 1 is TRUE) always evaluates to:
(Code-Math) To map a 2D array of size Rows x Cols into a 1D array, the index for an element at (row, col) is usually calculated as:
(Calculation) What is the "Mode" of the following set of server response times (in ms): {10, 20, 20, 30, 40, 50, 20}?
(Scenario-Based) A password requires 1 lowercase letter (26 options) and 1 digit (10 options). If the password MUST be exactly 2 characters long (Letter first, then Digit), how many unique passwords can be created?
(Conceptual) Which mathematical concept explains why a hash collision is much more likely than people intuitively think, even in large data sets?
(Conceptual) Which algorithmic paradigm is characterized by making the "best immediate choice" at each step without looking back or considering future consequences? • • • •
(Scenario-Based) You are given an array that is "nearly sorted" (each element is at most 2 positions away from its correct spot). Which sorting algorithm would be the most efficient to finalize the sort?
(Code Output / Logic) Trace a Binary Search on the sorted array [2, 5, 8, 12, 16, 23, 38, 56, 72, 91] to find the target 23. What is the value of the mid element in the first iteration?
(Calculation) What is the maximum number of comparisons required to find an element in a sorted list of 1,000 items using Binary Search?
(Comparison) What is the main analytical difference between Divide and Conquer and Dynamic Programming?
(Debugging) A developer writes a recursive function to calculate the Factorial of n. It works for n=5, but for n=-1, the program crashes with a "Stack Overflow" error. What is missing?
(Scenario-Based) You need to find the shortest path between two cities in a navigation app. The road weights (distances) are all positive. Which algorithm is the most efficient choice?
(Code Output / Logic) Trace this pseudocode: function solve(n): if n <= 1: return n return n + solve(n - 2) print(solve(5))
(Conceptual) In Big-O notation, an algorithm that processes a 2D matrix of size N x N using two nested loops usually has what time complexity?
(Calculation) If an O(N^2) algorithm takes 1 second to process 1,000 items, how long will it approximately take to process 10,000 items?
(Comparison) What is the main advantage of using a "Hash Table" for searching compared to a "Sorted Array with Binary Search"?
(Scenario-Based) A company needs to compress a text file by assigning shorter binary codes to characters that appear frequently and longer codes to characters that appear rarely. Which algorithmic approach is used for this (Huffman Coding)?
(Code Output / Logic) Trace the state of the array [5, 1, 4, 2] after **one full pass** of the Bubble Sort algorithm (ascending order).
(Debugging) Why is the following pseudocode for Binary Search flawed? while (low <= high): mid = (low + high) / 2 if target == arr[mid]: return mid if target < arr[mid]: high = mid else: low = mid
(Conceptual) Which algorithmic technique is used to solve the "N-Queens" problem, where you place queens on a board and "undo" a move if it leads to a conflict?
(Scenario-Based) A massive database has 100 million unsorted records. You need to find the record for "John Doe" exactly once. What is the most efficient strategy?
(Calculation) What is the Time Complexity of Merge Sort in the **worst case**?
(Code Output / Logic) In a Selection Sort of [29, 10, 14, 37, 13], what is the *first** swap that occurs?
(Comparison) When comparing Iteration (loops) to Recursion, which of the following is usually true regarding performance?
(Conceptual) A "Deterministic" algorithm is one that:
(Scenario-Based) You are designing a system to find the "Top 10 Most Visited Websites" from a log of 1 trillion entries. You have limited RAM. Which algorithmic concept is most helpful?
(Code Output / Logic) Trace the two-pointer algorithm to reverse the string "ABCD". What is the state of the string after the **first** swap?
(Calculation) An algorithm has a Big-O of O(2^N). If it takes 1ms to solve for N=10, how long will it take for N=20?
(Debugging) What is the "Space Complexity" error in the following recursive code for Fibonacci? fib(n): return fib(n-1) + fib(n-2)
(Conceptual) What does "Amortized Analysis" mean in algorithmic thinking?
(Conceptual) In the context of system architecture, what does the term "Trade-off" primarily refer to?
(Scenario-Based) A software team has spent $50,000 developing a feature that is now technically obsolete because of a new OS update. The lead developer says, "We must finish it anyway so the $50,000 isn't wasted." This is an example of which logical fallacy?
(Scenario-Based) You are choosing a database for a global financial app. According to the CAP Theorem, if you prioritize "Consistency" (every user sees the same data at the same time) and "Partition Tolerance," what must you sacrifice during a network failure? •
(Comparison) What is the key difference between Qualitative and Quantitative data in decision-making?
(Calculation) You have two options for an API: - Option A: Costs $100/month and takes 2 hours of dev time to integrate. - Option B: Costs $0 but takes 40 hours of dev time to build. If a developer's time is worth $50/hour, which is the more cost-effective decision for the first month?
(Scenario-Based) A bug is reported: "The app crashes when a user with the name 'NULL' tries to log in." Using the Eisenhower Matrix, this bug is classified as Urgent and Important. What is the correct decision?
(Conceptual) "Confirmation Bias" in a software testing environment most likely leads to:
(Scenario-Based) You notice that whenever the Marketing team sends a mass email, the website slows down. You conclude: "The email system is causing the website slowdown." This is a Correlation. Which step is required to prove Causation?
(Debugging / Logic) A developer suggests: "We should rewrite our entire backend in the newest language (Rust) because it is faster and trending on GitHub." What is the main critical thinking flaw here?
(Scenario-Based) A project manager asks for an estimate. You know the task will take 10 days, but you say 15 days "just in case." This decision is an application of:
(Conceptual) What does the "Pareto Principle" (80/20 rule) suggest about debugging?
(Scenario-Based) You have a limited budget. You can either: 1. Add a new feature users have been asking for. 2. Fix technical debt that makes the app slightly slow. Data shows that 50% of users leave the app if it takes > 3 seconds to load. Which is the more critical decision?
(Comparison) When making a decision, what is the difference between a "Constraint" and a "Requirement"?
(Calculation) A server has a 95% probability of staying up during a month. If you add a second identical redundant server (Failover), what is the probability that BOTH will fail at the same time?
(Conceptual) "Analysis Paralysis" in decision-making refers to:
(Scenario-Based) A junior dev says, "This function is slow because it uses a FOR loop." A critical thinker's first response should be:
(Debugging / Logic) Which of the following is an example of "Divergent Thinking" in problem solving?
(Conceptual) What does "Occam's Razor" suggest for decision-making in software design?
(Conceptual) Which type of error is generally considered the most difficult to detect and fix, as the program continues to run without crashing?
(Code Error / Debugging) A developer writes the following loop to find the average of an array arr of size N: sum = 0 for i from 1 to N: • • • sum = sum + arr[i] avg = sum / N Assuming 0-based indexing, what common error is present here?
(Scenario-Based) A user reports that the app crashes only when they upload a file larger than 10MB. The developer tries with a 1MB file and says, "It works on my machine." What is the first step the developer should take for effective debugging?
(Code Output / Logic) Trace the following pseudocode involving Exception Handling: try: x = 10 / 0 print("A") catch: print("B") finally: print("C")
(Conceptual) What is a "Regression Bug"?
Given the Boolean statement: (P AND Q) OR (P AND NOT Q), which of the following is logically equivalent?
If statement 'All database queries with indexes are fast' is FALSE, which of the following must logically be TRUE?