Font size
WorksheetsBCS Software Languages
Total questions: 59
Worksheet time: 36mins
What is linear in time complexity?
A flat horizontal line on a graph showing time to complete a function and the size of the input
A straight, steadily rising line on a graph showing time to complete a function and the size of the input
A curved, upward rising line on a graph showing time to complete a function and the size of the input
What is constant time in time complexity?
A flat horizontal line on a graph showing time to complete a function and the size of the input
A curved, upward rising line on a graph showing time to complete a function and the size of the input
A straight, steadily rising line on a graph showing time to complete a function and the size of the input
What is quadratic time in time complexity?
A straight, steadily rising line on a graph showing time to complete a function and the size of the input
A curved, upward rising line on a graph showing time to complete a function and the size of the input
A flat horizontal line on a graph showing time to complete a function and the size of the input
How to count the number of operations a function/method uses?
Count the number of (a) used.
What is time complexity?
A way of showing how the time it takes to run a class increases as the size of the input increases
A way of showing how different computers take different amounts of time to complete the same function
A way of showing how the time it takes to complete a function increases as the size of the input increases
Why is counting seconds not optimal for measuring performance, and what is better to count instead?
Different machines can take different lengths of time.
All machines take the same length of time to complete the same function, so there is no point using this
Counting the number of draw calls is optimal
Counting the number of operations is optimal
What is the expression for linear time complexity?
O(n²)
O(n)
O(1)
What is the expression for quadratic time complexity?
O(n)
O(n²)
O(1)
What is the expression for constant time complexity?
O(1)
O(n)
O(n²)
What are some of the steps to calculate the time complexity expression type to run a function from an equation?
Count the operators (+,-,=,/,*)
Find the fastest growing term (some terms will be constants and some will be changing parameters)
Take out the coefficient (a constant being multiplied by a changing value)
Take out the operators (+,-,=,/,*)
What is Abstraction in programming?
Hiding data and complexity. Experienced programmers often make classes for junior programmers to use so that the juniors don’t need to attempt to use the complex code within the class and also can’t mess with it
Deriving methods and properties from another class. Often results in a hierarchy.
A class can override methods and properties that it inherits
Filtering out unneeded characteristics to concentrate on the needed characteristics.
The process of taking a large problem and breaking it down into smaller problems to help understanding the main problem. Not good for event driven languages
What is Encapsulation in programming?
Hiding data and complexity. Experienced programmers often make classes for junior programmers to use so that the juniors don’t need to attempt to use the complex code within the class and also can’t mess with it
Deriving methods and properties from another class. Often results in a hierarchy.
A class can override methods and properties that it inherits
Filtering out unneeded characteristics to concentrate on the needed characteristics.
The process of taking a large problem and breaking it down into smaller problems to help understanding the main problem. Not good for event driven languages
What is Inheritance in programming?
Hiding data and complexity. Experienced programmers often make classes for junior programmers to use so that the juniors don’t need to attempt to use the complex code within the class and also can’t mess with it
Deriving methods and properties from another class. Often results in a hierarchy.
A class can override methods and properties that it inherits
Filtering out unneeded characteristics to concentrate on the needed characteristics.
The process of taking a large problem and breaking it down into smaller problems to help understanding the main problem. Not good for event driven languages
What is Polymorphism in programming?
Hiding data and complexity. Experienced programmers often make classes for junior programmers to use so that the juniors don’t need to attempt to use the complex code within the class and also can’t mess with it
Deriving methods and properties from another class. Often results in a hierarchy.
A class can override methods and properties that it inherits
Filtering out unneeded characteristics to concentrate on the needed characteristics.
The process of taking a large problem and breaking it down into smaller problems to help understanding the main problem. Not good for event driven languages
What is Decomposition in programming?
Hiding data and complexity. Experienced programmers often make classes for junior programmers to use so that the juniors don’t need to attempt to use the complex code within the class and also can’t mess with it
Deriving methods and properties from another class. Often results in a hierarchy.
A class can override methods and properties that it inherits
Filtering out unneeded characteristics to concentrate on the needed characteristics.
The process of taking a large problem and breaking it down into smaller problems to help understanding the main problem. Not good for event driven languages
What is a bridge pattern?
A structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently of each other
A design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Two or more things happening at the same time. Aims to identify methods that a computer program uses to handle multi-threaded tasks.
A design pattern that lets an object alter its behaviour when its internal state changes. It appears as if the object changed its class.
A structural design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
What is a concurrency pattern?
A structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently of each other
A design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Two or more things happening at the same time. Aims to identify methods that a computer program uses to handle multi-threaded tasks.
A design pattern that lets an object alter its behaviour when its internal state changes. It appears as if the object changed its class.
A structural design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
What is a strategy pattern?
A structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently of each other
A design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Two or more things happening at the same time. Aims to identify methods that a computer program uses to handle multi-threaded tasks.
A design pattern that lets an object alter its behaviour when its internal state changes. It appears as if the object changed its class.
A structural design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
What is a state pattern?
A structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently of each other
A design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Two or more things happening at the same time. Aims to identify methods that a computer program uses to handle multi-threaded tasks.
A design pattern that lets an object alter its behaviour when its internal state changes. It appears as if the object changed its class.
A structural design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
What is a singleton pattern?
A structural design pattern that lets you split a large class or a set of closely related classes into two separate hierarchies—abstraction and implementation—which can be developed independently of each other
A design pattern that lets you define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Two or more things happening at the same time. Aims to identify methods that a computer program uses to handle multi-threaded tasks.
A design pattern that lets an object alter its behaviour when its internal state changes. It appears as if the object changed its class.
A structural design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
Which are basic elements of a programming language?
Assignment
Conditionals/looping
Library
Data structures
Procedure Call
What is a stack data structure?
A linear data strcuture
A Non Linear data structure
All insertions and deletions are only permitted at one end of the list
The order can either be last in first out (LIFO) or first in last out (FILO)
All insertions and deletions are permitted at both ends of the list
What is authentication?
Checking to see if the user is who they claim to be
Checking to see what level of access a user is allowed.
Allows the user to enter their identity
Checks that the password is strong enough.
What is Authorisation?
Checking to see if the user is who they claim to be
Checking to see what level of access a user is allowed.
Allows the user to enter their identity
Checks that the password is strong enough.
A sequential file has records sorted in date sequence. Which of the following is the CORRECT term that describes a simple algorithm to quickly access a required record in this sequential file?
Split search.
Bubble chop
Bubble search.
Binary search.
To identify that two or more processes are similar requires which form of computational thinking?
Decomposition.
Abstraction
Pattern recognition.
Algorithm
Cars, planes and boats all use steering wheels, but they have different steering systems. Car steering wheels need an axle steering system. Boat steering wheels need a rudder steering system. Plane steering wheels need a wing flap steering system. Consider the following diagram that relates steering wheels to steering systems, using the vehicle steering wheel as a high-level abstraction:
What concept is illustrated by this example?
Polymorphism
Encapsulation
A bridge pattern
A concurrency pattern
Which of the following are basic elements of a programming language?
a) Assignment. b) Library. c) Loop. d) Procedure call.
a and c only
a, c and d only
b, c and d only
b and c only
Which of the following is a CORRECT term to specifically describe an item of data passed from a calling program / function to a called program / function?
Parameter
Variable
Structure
Constant
Given a stack data structure, what will be the state of the stack after performing the following operations?
1. Push(Apple) 2. Push(Banana) 3. Pop() 4. Push(Orange) 5. Pop()
Banana only
Apple, Orange only
Apple only.
Apple, Banana and Orange.
Which of the following describes an example of abstraction?
Filtering out unneeded characteristics to concentrate on the needed characteristics.
Capturing only the most relevant details within the context of the problem
Publishing a technical abstract of the requirements.
Extracting documentation from the code.
Select the answer that CORRECTLY describes the statement and the reason.
Statement: Maintenance requirements need to be considered at an early stage in the software development lifecycle (SDLC).
Reason: It is possible that the software will need to be corrected as a result of testing during the testing stage of the SDLC.
The statement and reason are both true, and the reason is an explanation for the statement.
The statement and reason are both true, but the reason is not an explanation for the statement.
The statement is true and the reason is false.
The statement is false and the reason is true
Which of the following is NOT a Non-Functional Requirement (NFR)?
The order confirmation email must be delivered within 10 seconds of the email being sent.
A user must be able to remove an item from their basket
The system needs to be used every weekday between the hours of 8 am and 8 pm.
All web user interactions with the system must use https secure protocol from login to logout.
Authentication performs what task?
Allows the user to enter their identity
Checks to see what level of access a user is allowed.
Checks to see if the user is who they claim to be.
Checks that the password is strong enough.
Select the answer that CORRECTLY describes the statement and the reason.
Statement: Re-using test patterns increases the chance of identifying common failures during testing.
Reason: Lack of variation in test data limits the effectiveness of discovering new bugs in code.
The statement and the reason are both true and the reason is an explanation for the statement.
The statement and the reason are both true, but the reason is not an explanation for the statement.
The statement is true but the reason is false.
The statement is false but the reason is true.
Physical software design includes which of the following?
a) Data design. b) Test design. c) Configuration design. d) Process design.
a, c and d only
b and d only.
a and d only.
a, b and c only
A software designer has been given the following requirements for a hotel system. Which of the requirements will be used in non-functional design?
a) The software should enable guests to check into the hotel.
b) The software needs to be online between the hours of 6 am and midnight.
c) Response time for a hotel booking transaction should not exceed 1 second.
d) The system must be able to process 5000 http requests per minute.
e) The cost of the development project must not exceed $500,000.
a, c and e only.
b, c and d only.
c, d and e only.
a and b only.
What is the connection between software design and software testing?
There is no connection between software design and testing
If software design is done properly then no bugs will continue to exist in a program after development and software testing is complete
Software testing is the process by which a software development company is able to identify issues that need to be addressed in their software design.
The output of software design is a set of functional and non-functional requirements that software testing can check have been met.
Which of the following are characteristics of an algorithm?
a) Precision. b) Finiteness. c) Selection. d) Speed.
a, b and c only.
a, c and d only.
b, c and d only.
a, b and d only.
A hotel room has options of available, out of service and occupied.
Which Pattern would be applicable?
Strategy
State
Singleton
Architectural
The following code has been developed by a code developer.
var tot2 = tot1 + tot3 + tot4;
if ( tot5 < tot2 ) {
print “the amount exceeds threshold”;
}
What would be the MAIN benefit for using more descriptive variable names?
The code would compile quicker
The variables should be declared in ascending numeric sequence.
The code would be easier to maintain.
The code would be more efficient to run.
Which of the following describes a demilitarised zone?
It protects a contained sub-network from the threats of a larger, untrusted network, such as the Internet
It protects a network and its devices by packet filtering.
A protects sub-networks that contain confidential data on storage devices from unauthorised access attempts.
It restricts access to a network by selectively allowing or blocking traffic according to a set of rules.
A software application used by the general public to purchase a variety of goods has a search function to help the buyer find the goods they want.
A user has entered a search request, which has been submitted into the search field via a database query. The query has returned the required information, but has also returned confidential information about the cost and pricing of the goods, which should not be available to the end-user.
What nature of security incident has occurred?
Distributed denial of service.
SQL injection vulnerability.
Firewall failure
Cross-site scripting attack.
Which of the following describe VALID ways to represent an algorithm?
a) Flow chart. b) Pseudocode. c) UML activity diagram. d) Use case diagram.
a, c and d only.
a and c only.
b and d only.
a, b and c only.
Q.What is recursion?
A. A _ that (a)
What are two essential parts of a recursive function?
Input and Output Parameters
Different Input
Base Case
Increments
How do recursive functions work?
Invoke the same function with a different input until you reach your base case
Invoke a separate function with an identical input to the first and vice versa until you reach your base case
Invoke the same function with an identical input until you reach your base case
Invoke a separate function with a different input to the first and vice versa until you reach your base case
What is base case?
The condition when the recursion starts
The input parameter's value before being altered
The input parameter's value after being altered
The condition when the recursion ends
What is Naive String Search?
An algorithm that loops through the entire array or pattern and checks if each is equal to the desired result
An algorithm that splits the array after each check. 1st check if desired result is in first half of array or pattern, if not delete the half and check the other half. Repeat until 1 element left
An algorithm that checks to see if a string is contained within another string by checking characters individually
An algorithm that checks to see if a string is contained within another by checking the prefix and suffixes of the smaller string
What is Linear search?
An algorithm that loops through the entire array or pattern and checks if each is equal to the desired result
An algorithm that splits the array after each check. 1st check if desired result is in first half of array or pattern, if not delete the half and check the other half. Repeat until 1 element left
An algorithm that checks to see if a string is contained within another string by checking characters individually
An algorithm that checks to see if a string is contained within another by checking the prefix and suffixes of the smaller string
What is Binary search?
An algorithm that loops through the entire array or pattern and checks if each is equal to the desired result
An algorithm that splits the array after each check. 1st check if desired result is in first half of array or pattern, if not delete the half and check the other half. Repeat until 1 element left
An algorithm that checks to see if a string is contained within another string by checking characters individually
An algorithm that checks to see if a string is contained within another by checking the prefix and suffixes of the smaller string
What is KMP String search?
An algorithm that loops through the entire array or pattern and checks if each is equal to the desired result
An algorithm that splits the array after each check. 1st check if desired result is in first half of array or pattern, if not delete the half and check the other half. Repeat until 1 element left
An algorithm that checks to see if a string is contained within another string by checking characters individually
An algorithm that checks to see if a string is contained within another by checking the prefix and suffixes of the smaller string
What is bubble sort?
A sorting algorithm that compares two numbers and swaps based on which is the higher value. The higher values will bubble to the top/end of the array/pattern
A sorting algorithm that compares two numbers and swaps based on which is the lower value. The lower values will go to the bottom/start of the array/pattern
A sorting algorithm that compares values starting with the second value in the list. If it is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. This repeat with the next value until the array/pattern is complete
What is selection sort?
A sorting algorithm that compares two numbers and swaps based on which is the higher value. The higher values will bubble to the top/end of the array/pattern
A sorting algorithm that compares two numbers and swaps based on which is the lower value. The lower values will go to the bottom/start of the array/pattern
A sorting algorithm that compares values starting with the second value in the list. If it is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. This repeat with the next value until the array/pattern is complete
What is insertion sort?
A sorting algorithm that compares two numbers and swaps based on which is the higher value. The higher values will bubble to the top/end of the array/pattern
A sorting algorithm that compares two numbers and swaps based on which is the lower value. The lower values will go to the bottom/start of the array/pattern
A sorting algorithm that compares values starting with the second value in the list. If it is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. This repeat with the next value until the array/pattern is complete
When are graph data structures useful?
When web scraping nested HTML
When working with map/location data
When you need an ordered list with fast inserts/removals at the beginning and end
When needing to write a scheduler
When are linked list data structures useful?
When web scraping nested HTML
When working with map/location data
When you need an ordered list with fast inserts/removals at the beginning and end
When needing to write a scheduler
When are tree data structures useful?
When web scraping nested HTML
When working with map/location data
When you need an ordered list with fast inserts/removals at the beginning and end
When needing to write a scheduler
When are binary heap data structures useful?
When web scraping nested HTML
When working with map/location data
When you need an ordered list with fast inserts/removals at the beginning and end
When needing to write a scheduler
