2c Flashcards

1
Q

Define abstraction

A

Process of removing excessive details to arrive at a representation of a problem that consists of only the key features. Often involves analysing what is relevant to a given scenario and simplifying a problem based on this information (representational abstraction)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is abstraction by generalisation

A

Process of removing excessive details to arrive at a representation of a problem that consists of only the key features. Often involves analysing what is relevant to a given scenario and simplifying a problem based on this information (representational abstraction)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define data abstraction

A

Details about how data is being stored are hidden. E.g stacks and queues

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the need of abstraction

A

Allows non experts to make use of a range of systems or models by hiding information that is too complex or irrelevant to the systems purpose
Enables more efficient software design
Reduces time spent on projects
Prevents unnecessarily large program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define thinking ahead

A

Thinking about the different components of a problem and how to handle them in the best way possible
Means designing strategies for programs is easier and intuitive to use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define preconditions

A

Requirements which must be met before a program can be executed
Specifying preconditions means subroutine can safely expect the arguments passed to certain criteria
Reduces length and complexity of code
Saves time needed to debug and maintain a longer program
Makes subroutines more reusable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are libraries

A

Contain commonly used functions for reuse, including queues, stacks, classes and subroutines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define decomposition

A

Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the advantages of reusable components

A

More reliable
Already been tested
Saves money, time and resources
Can be reused in future projects (- compatibility issues)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define thinking procedurally

A

Large complex problem is continually broken down into smaller subproblems.
Makes project easier to manage and can be divided between a group of people

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define paradigm

A

The approach used when developing a piece of software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define sequence

A

Code is executed line by line from top to bottom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define branching

A

Particular block of code is run if a specific condition is met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define iteration

A

Count controlled (block of code executed certain number of times)
Condition controlled (block of code is executed while a condition is met)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define scope

A

Section of code in which the variable can be accessed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define local variable

A

Can only be accessed within the subroutine in which they were defined
Deleted once subroutine ends
Ensure subroutines are self contained

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Define global variables

A

Accessed across the whole program
Danger of being unintentionally edited
Not deleted until program terminates, requires more memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Define modular programming

A

Technique used to split large, complex programs into smaller, self contained modules
Easier to divide tasks between a team
Each component can be dealt with individually
Improves reusability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Examples of modularity

A

Breaking down problem into sub problems
Functions and procedures
Passing by value
Giving address of parameter to subroutine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Define IDE

A

Program that provides a set of tools to make it easier for programmers to write, develop and debug code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

List features of IDE

A

Stepping
Variable watch
Breakpoint
Source code editor
Debugging tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

List stages in the software development cycle (SDLC)

A

Analysis
Design
Development
Testing
Implementation
Evaluation
Maintenance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Explain waterfall lice cycle

A

Stages are completed in sequence
Clear structure
To make change all stages must be revisited
Low user involvement
Lack flexibility
No risk analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Explain agile methodologies

A

Aim to improve flexibility
Adapt quickly to user requirements
Different sections developed in parallel
Working prototype delivered early on
Less focus on documentation
High user satisfaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Explain extreme programming

A

Example of agile model
High quality and highly usable software
Programmers work no more than 40hrs per week
Hard to produce high quality documentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Explain spiral model

A

Manages high risk projects
Four stages:
Analysing requirements
Pinpointing and mitigating risks
Development, testing and implementation
Evaluating to inform the next iteration of
Project terminated if too risky
Specialist risk accessor hired
Lack of focus on code efficiency

27
Q

Define RAD

A

Iterative methodology
User requirements gathered using focus group
Incomplete version given to user by trial
User feedback used to generate improved prototype
Final prototype matches user requirements fully
Used when user requirements are incomplete or unclear
Code may be inefficient
Fast pace
Late changes may reduce code quality

28
Q

Define algorithm

A

Set of instructions used to solve a problem

29
Q

Qualities of a good algorithm

A

Clearly defined inputs
Valid output for defined input
Able to deal with invalid inputs
Must always reach a stopping condition
Well do documented
Well commented

30
Q

Define alpha testing

A

Carried out in house by software development teams
Bugs are pinpointed and fixes

31
Q

Define beta testing

A

Carried out by end users
Feedback from users informs next stage of development

32
Q

Define white box testing

A

Carried out by software development teams
Internal structure of program is recognised
All possible routes through program are tested

33
Q

Define black box testing

A

Testers are not aware of internal structure of the software
Test plan traces through inputs and outputs

34
Q

Purpose of a trace table

A

Records when and which variables are updated

35
Q

Explain time complexity

A

Time taken to solve particular problem
Measured with bi-o notation to show effectiveness

36
Q

Notation for constant time complexity

A

0(1)
Time taken for algorithm independent from number of elements inputted

37
Q

Notation for linear time complexity

A

0(n)
Time taken is directly proportional to the number of elements inputted

38
Q

Define space complexity

A

Amount of storage an algorithm takes

39
Q

Define algorithm

A

Series of steps that complete a task

40
Q

How to reduce space complexity on an algorithm

A

Perform all of the changes on the original pieces of data

41
Q

How to reduce time complexity on an algorithm

A

Reduce the number of embedded for loops as possible

42
Q

Explain a linear search algorithm

A

Traverses through every item one at a time until it finds the item it is earthing for

43
Q

Explain binary search algorithm

A

Divides and conquers
Only applied on sorted data

44
Q

Explain bubble sort algorithm

A

Passes through the list evaluating pairs of items and ensuring the larger value is above the smaller value

45
Q

Explain what a stack is

A

First in last out data structure

46
Q

How to check size of stack

47
Q

How to check if stack is empty

48
Q

How to return top element of stack

49
Q

How to add to stack

A

push(element)

50
Q

How to remove top element from stack and return removed element

51
Q

Explain what a queue is

A

First in first out data structure
Front holds position of first element
Back stores next available space

52
Q

How to check size of queue

53
Q

How to check if queue is empty

54
Q

How to return top element of queue

55
Q

How to add to queue

A

enqueue(element)

56
Q

How to remove element at the front of the queue and return it

57
Q

How does bubble sort work?

A

Makes comparisons and swaps between pairs of adjacent elements

58
Q

How does insertion sort work?

A

Inserts elements into the correct position

59
Q

What is the pseudocode for a linear search algorithm

A

Function linearsearch (search,data[])
Position=-1
For i = 0 to data.length-1
If data [i] == search then
Position=i
Break
Endif
Endfor
Return position
End function

60
Q

What is the pseudocode for binary search algorithm

A

Function binary search (search,data[])
Position= -1
Lower=0
Upper= data.length-1
While lower < = upper
Mid=(lower+upper) DIV2
If data [mid]== search then
Position=mid
Elseif data [mid]< search
Lower=mid+1
Else
Upper=mid-1
Endif
End while
Return position
End function

61
Q

Write bubble sort algorithm

A

Procedure BubbleSort (data[])
Swapped=True
While swapped == True:
Swapped = false:
For n=0 to data.length-2:
If data [n]>data[n+1]:
Temp=data[n+1]
Data [ n+1]=data[n]
Data[n]=temp
Swapped=True
End if
Endfor
End while
End procedure

62
Q

What is the insertion sort algorithm

A

Procedure InsertionSort(data[])
For i = 1 to data.length -1
Current data = data[1]
Position=i
While (position >0 AND data[position-1]> current data)
Data[position]=data[position-1]
Position= position-1
End while
Data [position ]= current data
End for
End procedure