Worksheetsaaq Computing Unit 1
Total questions: 103
Worksheet time: 52mins
In the context of number systems, what is another name for the decimal system?
The binary system.
The denary system.
The hexadecimal system.
The octal system.
The decimal system goes up in multiples of 10; the binary system goes up in multiples of _____
8
2
16
4
In the decimal number 12, what place value does the '1' represent?
The tenths column.
The ones column.
The tens column.
The hundreds column.
In binary, what are the only two digits that can be stored in each column?
2 or 3.
0 or 2.
0 or 1.
1 or 2.
How are the column values in a binary number sequence generated?
By repeatedly dividing by 2, moving from left to right.
By repeatedly multiplying by 2, moving from right to left.
By subtracting 1 from each previous value, moving from left to right.
By adding 1 to each previous value, moving from right to left.
What is the term for the smallest number in a binary sequence, located on the far right?
The parity bit.
The least significant bit (LSB).
The checksum bit.
The most significant bit (MSB).
What is the term for the largest number in a binary sequence, located on the far left?
The parity bit.
The least significant bit (LSB).
The most significant bit (MSB).
The checksum bit.
Method 1 for converting a decimal number to binary involves:
Subtracting 1 from the decimal number until it reaches zero.
Repeatedly dividing the decimal number by 2 and recording the remainders.
Multiplying the decimal number by 2 until it exceeds 100.
Adding the digits of the decimal number until a single digit is obtained.
Why is it important to include leading zeros in binary numbers?
To confuse the reader.
To ensure the binary number uses the required number of bits for a given system.
To make the binary number look longer.
To increase the value of the binary number.
Method 2 for converting a decimal (denary) number to binary involves:
Subtracting 2 from the number until it reaches zero.
Dividing the number by 2 repeatedly and recording the remainders.
Multiplying the number by 2 repeatedly and recording the results.
Adding 2 to the number until it reaches a binary value.
In binary addition, what is the result of 1 + 1?
2, with a carry of 0.
0, with a carry of 1 to the next column.
1, with no carry.
0, with no carry.
When subtracting binary numbers, if you need to subtract 1 from 0, what must you do?
You need to change the digit to 1.
You need to borrow a bit from the digit on the left.
You need to ignore the subtraction and write 0.
You need to add a bit to the digit on the right.
In the Sign and Magnitude system, what does the most significant bit (MSB) represent?
The magnitude of the number.
The sign of the number (0 for positive, 1 for negative).
The least significant bit.
The parity of the number.
What is a significant drawback of the Sign and Magnitude representation?
It is only used for floating-point numbers.
It has two different representations for zero (a positive and a negative zero), which complicates arithmetic.
It cannot represent negative numbers at all.
It requires more memory than other representations.
How is a negative number represented using the One's Complement method?
By setting all bits to 1 regardless of the number.
By taking the positive binary number and flipping all the bits (0s become 1s and 1s become 0s).
By reversing the order of the bits in the positive binary number.
By adding 1 to the positive binary number.
How is a negative number represented using the Two's Complement method?
Reverse the binary digits of the positive number.
Find the one's complement of the positive number, then add 1 using binary arithmetic.
Add a leading zero to the positive number.
Invert all bits of the positive number and subtract 1.
Which system for representing negative binary numbers is most commonly used in modern computers?
Sign-magnitude.
Two's complement.
Excess-N notation.
One's complement.
What is the second pillar of Computational Thinking?
Algorithm Design: Creating step-by-step solutions to problems.
Pattern Recognition: Looking for similarities or common characteristics within and across problems.
Decomposition: Breaking down complex problems into smaller, manageable parts.
Abstraction: Ignoring unnecessary details to focus on the essential aspects.
What is the third pillar of Computational Thinking?
Pattern Recognition: Identifying similarities or patterns to make problem solving easier.
Algorithmic Thinking: Creating a step-by-step solution to solve a problem.
Abstraction: Filtering out unnecessary details to focus on the important information needed to solve a problem.
Decomposition: Breaking down a complex problem into smaller, manageable parts.
What is the fourth pillar of Computational Thinking?
Pattern Recognition: Looking for similarities among and within problems.
Algorithmic Design: Creating a clear, step-by-step set of instructions to solve the refined problem.
Decomposition: Breaking down a complex problem into smaller, manageable parts.
Abstraction: Focusing on the important information only, and ignoring irrelevant detail.
An algorithm must be precise, effective, and _____
Random (it can change unpredictably).
Finite (it must have a definite end point).
Ambiguous (it can be unclear).
Infinite (it can run forever).
What are two common tools used to express algorithms?
Compilers and Debuggers.
Flowcharts and Pseudocode.
Spreadsheets and Presentations.
Databases and Networks.
Why is 'Readability' considered a principle of good code?
It allows the code to be written in any programming language.
It ensures that you and others can understand what the code does, even weeks or months later.
It makes the code run faster than other code.
It guarantees the code will never have bugs.
What is the standard naming convention for variables and functions in Python?
PascalCase (FirstLetterOfEachWordCapitalized).
snake_case (all_lowercase_with_underscores).
kebab-case (all-lowercase-with-hyphens).
CamelCase (EachWordStartsWithCapital).
What is the standard naming convention for constants in Python?
PascalCase (EachWordCapitalized).
UPPER_SNAKE_CASE (ALL_UPPERCASE_WITH_UNDERSCORES).
camelCase (firstLowercaseThenUppercase).
lowercase_with_underscores.
In Python, what is the standard number of spaces for each level of indentation?
2 spaces.
4 spaces.
8 spaces.
1 space.
What is the primary purpose of a good code comment?
To repeat what the code is already doing.
To explain the 'why' behind a piece of code, not the 'what'.
To make the code longer and more complex.
To hide errors in the code.
What is a docstring in Python?
A built-in Python module for documentation.
A special, multi-line comment placed at the beginning of a function to explain what it does, its arguments, and what it returns.
A variable that stores the name of a function.
A keyword used to define a function.
What is the definition of modularisation?
The process of writing code without using any functions or procedures.
The process of breaking down a large program into smaller, manageable, and reusable functions, each performing one specific job.
The process of combining multiple programs into a single large program.
The process of optimizing code for faster execution without changing its structure.
What is the purpose of input validation in programming?
To allow any input regardless of format or content.
To check that user input is sensible, reasonable, and usable before the program attempts to process it, preventing crashes.
To speed up the execution of the program by skipping checks.
To automatically correct all user mistakes without notifying the user.
A _____ check is used to determine if the user has entered any data at all.
Format
Presence
Consistency
Range
A _____ check is used to verify if the input data is of the correct type, such as an integer instead of a string.
Format
Type
Existence
Range
A _____ check ensures that a number falls within an acceptable boundary, like an age being greater than 0.
Type
Range
Format
Null
A _____ check is used to see if data follows a specific pattern, such as an email address containing an '@' symbol.
Length
Format
Range
Presence
What is a 'validation loop'?
A loop that validates the output of a program after execution.
A loop (often a `while` loop) that repeatedly asks the user for input until the data they provide is valid.
A loop that runs only once to check for errors in the code.
A loop that is used to optimize the performance of a program.
What is the difference between a single-dimensional and a two-dimensional data structure?
A two-dimensional structure cannot store numbers, only text.
A single-dimensional structure is like a single row (a list), while a two-dimensional structure is like a table with multiple rows and columns (a list of lists).
A single-dimensional structure is used only for mathematical operations.
A single-dimensional structure is always larger than a two-dimensional structure.
In Python, what list method adds a single item to the very end of the list?
.extend()
.append()
.pop()
.insert()
In Python, what list method inserts an item at a specific position (index) within the list?
extend() method.
.insert() method.
remove() method.
append() method.
What is the main benefit of using third-party code, such as a library or API?
It eliminates the need for any testing or debugging in your project.
It saves significant development time, cost, and provides access to expert-level, secure, and efficient code.
It ensures your project will never have any security vulnerabilities.
It always guarantees that your application will run faster than custom code.
What does API stand for?
Automated Process Integration.
Application Programming Interface.
Applied Protocol Interface.
Advanced Programming Instruction.
Using the 'waiter analogy', what does the waiter represent in an API interaction?
The server that processes the request and sends data back.
The API itself, which takes a structured request from the app to the server and brings back a response.
The user who makes a request to the application.
The database that stores all the information.
What is the most common and dangerous risk when using third-party code that requires an API key?
The API key will expire immediately after use.
Accidentally leaking the API key publicly, allowing malicious actors to use it and generate large bills.
API keys can only be used once and then become invalid.
Third-party code will always run slower than first-party code.
What is the correct, immediate action to take if you accidentally expose an API key?
Ignore the exposure and continue using the key as normal.
Go to the service's dashboard (e.g., Google Cloud) and immediately delete or revoke that specific key.
Change your account password and hope the key is no longer accessible.
Share the exposed key with your team to see if anyone else has used it.
What is 'Dependency Hell' in software development?
A scenario where a software project has too many contributors, making collaboration difficult.
A compatibility nightmare where two different libraries required by your project depend on conflicting versions of the same core library, causing the project to break.
A problem where the user interface of an application fails to load due to missing images.
A situation where developers forget to update their code documentation, leading to confusion.
What is a 'hallucinated dependency' in the context of AI-generated code?
When an AI uses outdated libraries in its code.
When an AI generates code with syntax errors due to missing libraries.
When an AI makes up a library name that sounds plausible but doesn't actually exist.
When an AI omits a necessary library from the code.
In computer science, what is indexing?
The process of encrypting data for security purposes.
The process of assigning a unique number (an index) to each element in an ordered data structure like a list or string.
The technique of connecting multiple computers in a network.
The method of compressing files to save storage space.
In Python and many other languages, what index number is assigned to the first element of a sequence?
2 (second element indexing).
0 (zero-based indexing).
1 (one-based indexing).
-1 (negative indexing).
Concept: Mutability
Refers to the order in which data is stored in a structure.
Refers to whether a data structure can be changed (mutated) after it has been created.
Refers to the speed at which a data structure can be accessed.
Refers to the amount of memory a data structure uses.
Are Python lists mutable or immutable?
Mutable, but you cannot remove elements once added.
Mutable, meaning you can add, remove, or change elements within them after creation.
Immutable, but you can add elements after creation.
Immutable, meaning you cannot change elements after creation.
Are Python strings mutable or immutable?
Mutable, meaning you can change individual characters within a string directly.
Immutable, meaning you cannot change a character within a string; you must create an entirely new string with the desired changes.
Immutable, but you can change characters using the 'replace' method without creating a new string.
Mutable, meaning you can append characters to a string without creating a new one.
What is a primary benefit of using pseudocode to express an algorithm?
It is language-neutral, readable, and easy to write, making it excellent for planning and communication.
It guarantees the fastest execution time for any algorithm.
It automatically translates into machine code without errors.
It is only useful for writing code in a specific programming language.
What is a primary drawback of using pseudocode?
It has no standard syntax and is non-executable, so it cannot be tested directly.
It requires a compiler to run.
It is only used for web development.
It is always written in English.
What is a key benefit of using flowcharts to represent algorithms?
They provide an extremely clear, visual representation of logic and data flow, making it easy to spot structural errors.
They eliminate the need for any written documentation.
They guarantee the fastest execution of algorithms.
They automatically convert algorithms into programming code.
In a flowchart, what shape represents the start and end points of the process?
An oval or rounded rectangle (Terminator).
A diamond (Decision).
A rectangle (Process).
A parallelogram (Input/Output).
In a flowchart, what shape represents an action or instruction, like a calculation?
A rectangle (Process).
A diamond (Decision).
An oval (Start/End).
A parallelogram (Input/Output).
In a flowchart, what shape represents getting data from a user or displaying information?
A parallelogram (Input / Output).
A rectangle (Process).
A diamond (Decision).
An oval (Start/End).
In a flowchart, what shape represents a question with a 'Yes/No' or 'True/False' answer?
A diamond (Decision).
A rectangle (Process).
An oval (Start/End).
A parallelogram (Input/Output).
What does the 'P' in the WCAG accessibility acronym POUR stand for?
Perceivable: Can users perceive the content, for example by providing alt text for images.
Practical: Is the content easy to use in daily tasks?
Portable: Can the content be accessed on multiple devices?
Personalized: Is the content tailored to individual users?
What does the 'O' in the WCAG accessibility acronym POUR stand for?
Operable: Can users operate the interface, for example using only a keyboard.
Observable: Can users see all elements on the page.
Optional: Is the feature optional for users?
Organized: Is the content organized logically?
What does the 'U' in the WCAG accessibility acronym POUR stand for?
Understandable: Is the content and navigation clear, simple, and predictable.
Universal: Is the content available to everyone regardless of device.
Usable: Is the content easy to use for all users.
Unified: Is the content presented in a consistent manner.
What does the 'R' in the WCAG accessibility acronym POUR stand for?
Robust: Is the content compatible with a wide range of devices and assistive technologies.
Readable: Is the content easy to read for all users.
Responsive: Does the content adapt to different screen sizes?
Relevant: Is the content meaningful for users?
What is 'Historical Bias' in the context of training an AI model?
When an AI is trained on past data that reflects historical societal biases, causing the AI to perpetuate those same biases.
When an AI model is trained only on future predictions, ignoring past data.
When an AI model is trained to avoid any kind of bias, including historical ones.
When an AI model is trained exclusively on unbiased, synthetic data.
What is 'Sampling Bias' in the context of datasets?
When the data collected is not representative of the broader population, leading to skewed or inaccurate results for under-represented groups.
When the data is collected from all possible sources, ensuring complete representation.
When the data is randomly shuffled before analysis to avoid patterns.
When the data is analyzed using only statistical methods without any manual intervention.
In Python programming, what is the purpose of an f-string?
It provides an easy way to embed variables and expressions directly inside a string literal for clear output.
It is used to format floating point numbers only.
It is a function to convert strings to integers.
It is a method to concatenate two strings without any variables.
The 'input()' function in Python always returns data of what type?
A string, even if the user types in numbers.
An integer, if the user types numbers.
A float, if the user types decimal numbers.
A boolean value.
What is the term for converting a value from one data type to another, such as a string to an integer?
Casting
Looping
Indexing
Parsing
What is the purpose of a 'try-except' block in Python?
To handle potential errors gracefully by 'trying' a piece of risky code and executing a 'plan B' in the 'except' block if an error occurs, preventing the program from crashing.
To optimize the performance of Python code by skipping unnecessary computations.
To automatically convert all data types to strings within the block.
To create loops that run until an error occurs.
What is a trace table used for? ________
To manually track the value of every variable in an algorithm as it executes, line by line, to understand its logic and find errors.
To store large amounts of data for future use.
To encrypt data for secure transmission.
To generate random numbers for simulations.
What is the difference between a syntax error and a logical error?
A syntax error is a 'grammar' mistake that prevents the code from running, while a logical error is a flaw in the algorithm's design that causes it to run but produce the wrong result.
A syntax error is a mistake in the logic of the code, while a logical error is a spelling mistake in the code.
A syntax error causes the program to run incorrectly, while a logical error prevents the program from running at all.
A syntax error is a runtime error, while a logical error is a compile-time error.
What is the 'Digital Divide'?
The gap between demographics and regions that have access to modern information and communications technology and those with restricted or no access.
A type of computer virus that spreads through digital networks.
A method of encrypting data for secure communication.
A law regulating the use of social media platforms.
A programming strategy where algorithms are designed to cache data and function without a network connection is known as _____ logic.
Offline-First
Online-Only
Cloud-Dependent
Network-First
What is the 'Works on My Machine' fallacy?
A common error where a developer tests software only in their own ideal, high-spec environment, leading to software that fails for a significant portion of the target audience with different hardware or software.
A situation where software works perfectly on all machines regardless of configuration.
A fallacy where developers intentionally make software incompatible with other systems.
An error caused by using outdated programming languages.
The Python function `math.trunc(3.99)` would output what value?
3, as it truncates (chops off) the decimal part without rounding.
4, as it rounds up the value.
2, as it rounds down to the nearest even integer.
3.99, as it returns the original value.
What Python string method is used to break a string up into a list of smaller strings based on a specific character?
.split()
.join()
.replace()
.find()
How does a linear search algorithm work?
It checks each item in a list one by one, in order, from the beginning until the item is found or the end of the list is reached.
It divides the list into halves and searches each half recursively.
It sorts the list before searching for the item.
It jumps to random positions in the list to find the item.
What is a major advantage of the linear search algorithm?
It is simple to implement and works on unsorted lists.
It requires the list to be sorted before searching.
It is the fastest search algorithm for large datasets.
It uses binary search to find elements quickly.
What is the 'golden rule' or mandatory precondition for performing a binary search?
The list MUST be sorted.
The list must contain only positive numbers.
The list must have an even number of elements.
The list must not contain duplicate values.
How does a binary search algorithm work?
It repeatedly divides the search interval in half, comparing the target to the middle item and discarding half where the item cannot be.
It searches each item sequentially from start to end until the target is found.
It sorts the array before searching for the target item.
It compares the target to every item in the list at once.
What is a major advantage of the binary search algorithm over a linear search?
It is extremely fast and efficient, especially on large lists.
It can be used on unsorted lists.
It always finds the smallest element first.
It requires no comparison operations.
What is the 'golden rule' for file handling in Python that ensures a file is automatically closed?
Using the `with open(...)` statement.
Using the `open(...).close()` statement.
Using the `file.close()` method only.
Using the `try...except` block.
What is the main security drawback of using plain text files for data storage?
The data is not encrypted, making it plain text that is easy to read and tamper with.
Plain text files automatically compress data, reducing security.
Plain text files require special hardware to access.
Plain text files are only accessible on Linux systems.
In project management, the 'Iron Triangle' refers to the trade-offs between which three constraints?
Fast (Time/Schedule), Good (Quality/Scope), and Cheap (Cost/Budget).
Scope, Communication, and Leadership.
Risk, Stakeholder Engagement, and Procurement.
Resources, Team Morale, and Innovation.
What is 'Feature Creep' or 'Scope Creep' in a software project?
When stakeholders continually add small, unplanned features after the project has started, often leading to exceeded deadlines and budgets.
When a project is completed ahead of schedule due to efficient planning.
When all features are removed from a project to simplify it.
When the software project is abandoned before any features are implemented.
What is the core difference between the Waterfall and Agile development methodologies?
Waterfall plans everything at the start and has one final release, while Agile is iterative, building and releasing small parts in cycles (sprints).
Waterfall uses sprints to deliver features, while Agile releases everything at the end.
Agile requires no planning, while Waterfall is highly flexible and changes frequently.
Waterfall and Agile both follow the same process and release schedule.
What is the Minimum Viable Product (MVP)?
The simplest, most basic version of a product that is still functional and usable, allowing for early user feedback.
A fully developed product with all features included before launch.
A marketing strategy used to promote new products.
A prototype that is never released to users.
What is the purpose of a 'User Story' in Agile development?
To frame a feature requirement from the perspective of an end-user, focusing on their needs and goals rather than technical specifications.
To document the technical architecture of the system in detail.
To assign specific tasks to individual developers for each sprint.
To outline the project budget and resource allocation.
What is the key difference between a compiled language (like C++) and an interpreted language (like Python)?
A compiler translates the entire code into a hardware-specific executable file before running, whereas an interpreter translates it line-by-line during runtime.
Compiled languages require more memory than interpreted languages.
Interpreted languages cannot be used for web development, while compiled languages can.
Compiled languages do not support object-oriented programming, but interpreted languages do.
What is the main portability advantage of an interpreted language?
The code can be written once and run anywhere that has the necessary interpreter installed, regardless of the underlying hardware.
It requires no interpreter to run on different systems.
It always runs faster than compiled languages on any hardware.
It can only run on the hardware it was originally written for.
What is 'Bytecode' in languages like Java and C#?
An intermediate code that is not yet machine code, which is then translated by a Virtual Machine (like the JVM) on the user's computer.
A type of hardware used to execute Java and C# programs.
The source code written by the programmer before compilation.
A database format used for storing program data.
What is a 'legacy system' in IT?
An old method, technology, or application program that is still in use, often because it performs a critical function and is risky or costly to replace.
A newly developed software system designed to replace outdated technology.
A system that is only used for educational purposes and not in real-world applications.
A type of hardware that is compatible with all modern software.
Concept: Backward Compatibility
The ability of a new system or software version to read and process data created by an older version.
The ability of a system to prevent unauthorized access.
The process of updating software to the latest version.
The capability of a system to operate only with new hardware.
In Semantic Versioning (e.g., v2.4.1), what does a change in the first number (the 'Major' version) signify?
A breaking change that is not backward compatible.
A minor bug fix.
A documentation update.
A backward compatible feature addition.
What is the modern solution to the 'it works on my machine' problem, which involves shipping the entire environment with the code?
Using containers, such as Docker.
Using version control systems like Git.
Writing detailed documentation.
Using virtual machines for every developer.
What is recursion in programming?
A technique where a function calls itself from within its own code to solve a problem by breaking it down into smaller, identical versions of itself.
A method where a program runs infinitely without stopping.
A process where a function only calls other functions but never itself.
A way to store data in a database using repeated entries.
What are the two essential parts of any recursive function?
The Base Case (the condition to stop) and the Recursive Step (where the function calls itself with a modified input).
The Loop Condition and the Return Statement.
The Initialization and the Termination.
The Input and the Output.
What type of error occurs if a recursive function lacks a base case?
A stack overflow error, as the function would call itself infinitely.
A syntax error, as recursion is not allowed without a base case.
A compilation error, as the function cannot be executed.
A logic error, as the function will always return zero.
In testing, what is 'Normal' data?
Data that is valid and falls well within the expected range of inputs.
Data that is always at the boundary of acceptable values.
Data that is intentionally incorrect to test error handling.
Data that is not used in any test cases.
In testing, what is 'Boundary' data?
Data that is at the extreme edges of the valid input range (e.g., the minimum and maximum allowed values).
Data that is always in the middle of the valid input range.
Data that is outside the valid input range and always causes errors.
Data that is randomly selected from any part of the input range.
In testing, what is 'Invalid' data?
Data that is of the correct type but falls outside the accepted range (e.g., entering 6 tickets when the maximum is 5).
Data that is always accepted by the system regardless of value.
Data that is used only for performance testing.
Data that is of the wrong type but within the accepted range.
In testing, what is 'Erroneous' data?
Data that is of the wrong data type altogether (e.g., entering text where a number is expected).
Data that is within the expected range but not used often.
Data that is correct and expected by the system.
Data that is missing required fields.
Which of the following is an example of a format check in input validation?
Verifying that a field is not left blank.
Checking if a phone number contains only digits and has the correct number of characters.
Ensuring a user's age is between 1 and 120.
Making sure a password is unique in the database.
Which Python data type is mutable?
Tuple
Integer
String
List
Which property must an algorithm have to guarantee it will eventually stop?
Recursion
Finiteness
Ambiguity
Randomness
