A2 Units Flashcards

(98 cards)

1
Q

What is a procedural programming language?

A

A language where the control flow is defined rather than the logic

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

What is a first-class object?

A

Any object that can be passed as an argument to a function

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

What is a high-order function?

A

A function that takes another function as an argument, or a function that returns another function

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

What does the map function do?

A

It takes a list of elements and applies a function to each item in the list

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

What dies the filter function do?

A

It returns a list of elements with specified values from another list

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

What does the reduce function do?

A

It recursively adds each successive element of a list, allowing for the entire lost to be represented as a single number

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

What is the head of a list?

A

The first element of a list

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

What does the application layer of the TCP/IP model do?

A

Determines which protocol is to be used when transmitting the data

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

What does the transport layer of the TCP/IP model do?

A

Splits data up into packets, numbers each packet, and applies a port number to each

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

What does the network layer of the TCP/IP model do?

A

Adds both source and destination IP addresses to each packet, forming sockets

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

What dies the link layer of the TCP/IP model do?

A

Adds the source and destination MAC addresses to packets

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

What is a Galois field of two elements?

A

A system used to find the dot product of two vectors in a logical way

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

What use is GF2?

A

Adding two vectors is like applying an AND bitwise operator, and multiplying vectors is like applying a XOR bitwise operator

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

Give one application of GF2

A

To find the parity of a string of bits

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

List every application layer protocol and their ports in order of increasing port number

A
FTP Data - 20
FTP Control - 21
SSH - 22
Telnet - 23
SMTP - 25
HTTP - 80/8080
POP3 - 110
IMAP - 143
HTTPS - 443
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does a question mark denote when used in a regular expression?

A

The previous character does not have to be present

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

What is the symbol to denote the OR bitwise operator in a regular expression?

A

|

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

What does the “-“ symbol represent in a regular expression?

A

A range of values

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

What is the purpose of a regular expression?

A

To determine whether a string is valid in a defined language

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

What is the syntax used when searching for an entire string in a regular expression?

A

Rounded brackets are used “()”

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

What is the syntax used when searching for individual characters?

A

Squared brackets “[]”

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

What does the “+” symbol denote in a regular expression?

A

A wildcard. There must be one or more of the preceding element present

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

What does the “*” symbol denote in a regular expression?

A

A wildcard. There can be 0+ of the preceding element

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

Give three advantages of functional programming paradigms

A

×Functions are very abstract, so are less prone to errors
×Functions are easier to test because a function will always give the same output
×It is easier to reuse functions with any level of data abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How is a normalised floating point number represented in binary?
A normalised floating point number contains a mantissa and exponent, with only a sequence of 01 preceding the binary point
26
What are the five steps to convert from binary to decimal floating point numbers?
×Find the sign of the mantissa ×Find the value of the exponent and its sign in decimal ×Move the binary point as denoted by the exponent ×Perform two's complement conversion if the number is negative
27
What is a subnet mask?
A 32-bit number used to split an IP address into its host ID and network ID using an AND bitwise operator
28
What is the definition of big data?
High volume, high velocity data with a large range
29
What is latency?
The time taken for a bit to be sent between two devices
30
What is unstructured data?
Data that cannot be stored in a traditional database
31
What is first normal form?
All data is in atomic form and there are no many-to-many relationships
32
What is second normal form?
The data is in 1NF and there are no partial key dependencies
33
What is third normal form?
The data is in 2NF and there are no non-key dependencies
34
Why is reverse Polish notation used?
To make mathematical expressions easier for a computer to process
35
What type of tree traversal does reverse Polish notation use?
Post-order traversal
36
Name two ways in which vectors can be expressed
As a list or as a mapping of a function onto a list of values
37
What is a convex combination of vectors?
If a vector is convex then au +Bv = 1 where a, B > 0
38
What are convex combinations used for?
To determine whether a vector lies on a plane or not
39
What is SSH used for?
For transferring data in a secure, encrypted manner
40
What are the 6 main SSH commands?
×cd [filename] - changes to a specified directory ×cd... - move up a file level ×pwd - print the working directory ×cp - copy an image to a specified location ×ls - list all files with a specific extension
41
What are the 3 main FTP commands?
PWD - Print the working directory CDUP - Change to the parent directory PASV - Enter passive mode
42
What does POP3 do?
Retrieves email from a server, deleting it from the server when it is on the client device
43
What does IMAP do?
Keeps mail on the sever and on the client in sync
44
What does SMTP do?
Transfers mail from one device to a server
45
What is a tree?
A graph with no cycles
46
What is in-order traversal?
Left node, root, right node
47
What is pre-order traversal?
Root, left node, right node
48
What is post-order traversal?
Left node, right node, root
49
How do gateways differ from routers?
Gateways allow for networks of different types to be connected, routers only connect networks of the same type
50
What is the domain name system?
DNS is used to translate URLs into IP addresses
51
What do Internet registrars do?
Allocate IP addresses to URLs
52
What is a URL?
A university resource locator is a user-friendly way of identifying web resources
53
What is a D-type flip-flop?
A positive rising-edge memory unit
54
Why is a clock input needed for a D-type flip-flop to operate?
The flip-flop stores the input signal when a rising-edge clock signal is provided
55
What is the definition of a set?
An unordered collection of elements in which each element only occurs once
56
What is a finite set?
A set with a countable number of elements
57
What is the cardinality of a set?
The number of elements a set contains
58
What is the Cartesian product of two sets?
Every element of a set is paired with every element of a second set to for a larger set
59
What is a subset?
A set where every item of that set is a a member of another set
60
What is a proper subset?
A set that is not equal to another set, but is a subset
61
What is the difference of two sets?
A/B is every value in A that is not in B
62
What is the definition of a tractable problem?
A problem that can be solved with a polynomial time complexity or better
63
What is a heuristic solution?
A solution to a problem that was found by simplifying a problem in order to estimate the solution
64
Give a real-world example of heuristic solutions to intractable problems?
Virus scanners use heuristic methods to analyse code and determine if it is likely to be a virus or not
65
What is a stack?
A last in, first out data structure
66
How can arrays be used as a static stack?
A pointer can be used to refer to the top of the stack, and an integer can be used to refer to the maximum size of the stack
67
List the five main stack functions and what they do
Push(item) - adds an item to the top of the stack Pop() - removes and returns the item on the top of the stack Peek() - returns but dies not remove the top item of the stack isEmpty() - checks if the stack is empty or not isFull() - checks if the stack is full or not
68
What limits the size of a dynamic stack?
The number of memory locations available
69
How can overflow be detected in a stack?
An item cannot be added to the stack
70
How can underflow be detected?
The pointer has a value of - 1
71
What is a call stack used for?
To keep track of active subroutines and the parameters used by each
72
What is the return address?
The address in memory of the instruction that control will return to after a subroutine ends
73
What is stack overflow?
Stack overflow occurs when a subroutine is called too any times, and the call stack overflows. This causes the program to crash
74
What is a stack frame?
Stack frames make up a call stack. They contain information about active subroutines and parameters specific to each
75
What is a hashing algorithm?
An algorithm used to generate a location in memory for data
76
Name the most common hashing algorithm.
The value is divided by the number of available memory locations, with the remainder used as the index
77
What are synonyms?
Two instances of a hash code with the same value
78
What is a collision involving hash tables?
When a collision occurs
79
How can an item be searched for in a hash table?
×Apply the hashing algorithm ×Examine the cell ×If it is empty, the value is not in the table ×If it is full, move to the next space until the item is found
80
What is a folding hashing algorithm?
A value is split into equal components, which are a summed to get a hash code
81
What is an entity?
An object that it is possible to store data about
82
What is an attribute in a database?
Points of data that can be stored relating to an option
83
What are entity identifiers?
They allow for entities to be uniquely identified. They are similar to primary keys of databases
84
What is the purpose of a DBMS?
Allows for a client-server database to be instantiated
85
List the advantages of using a client-server database
- Allows for better access management - One centralised database, constantly up to date - Expensive service can be provided to many users at once
86
List the disadvantages of using a client-server database
-If there are no extra measures in place, two users can update a record at the same time
87
When does a deadlock occur?
When two users update a record at the same time but neither can be implemented
88
How does serialisation prevent deadlocks?
If a transaction is already in process, another cannot start until it has ended
89
How does timestamping prevent deadlocks?
Each transaction is given a read timestamp and a write timestamp. The transactions are carried out in the order specified by the timestamps
90
How does commitment ordering prevent deadlocks?
Transactions are given priorities based on their dependencies on each other, as well as their timestamps
91
Name the most common type of client-server system
HTTP servers. They receive requests of services from the client, and send webpage data in return
92
What is an API?
An Application Programming Interface is a set of protocols that format the requests and responses between clients and servers. This allows for servers to use each other's services
93
What is the WebSocket protocol?
A protocol that allows for full-duplex communication between a client and server that is much faster than traditional communication
94
Why is the WebSockets protocol faster than other methods?
WebSockets reduces packet sizes significantly, meaning transmission is faster
95
What is REST system design?
A form of design where HTTP request methods are used to communicate with web-based databases. The client doesn't need to know how requests will be carried out, or how and where data is stored
96
What is a RESTful API?
An application programming interface that makes use of the REST system design
97
Describe how HTTP request methods work
- A browser makes a request to the server on behalf of the client asking for standard web resources - The HTML file of the web page contains JavaScript that is executed client-side - The JavaScript calls a RESTful API to connect to the database - The database responds with XML or JSON code - This code is executed client-side by the browser
98
List the advantages of JSON over XML
- Easier for humans to read - Code is more compact - Code is easier to create - Code is easier for computers to parse