A2 Units Flashcards

You may prefer our related Brainscape-certified flashcards:
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
Q

How is a normalised floating point number represented in binary?

A

A normalised floating point number contains a mantissa and exponent, with only a sequence of 01 preceding the binary point

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

What are the five steps to convert from binary to decimal floating point numbers?

A

×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

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

What is a subnet mask?

A

A 32-bit number used to split an IP address into its host ID and network ID using an AND bitwise operator

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

What is the definition of big data?

A

High volume, high velocity data with a large range

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

What is latency?

A

The time taken for a bit to be sent between two devices

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

What is unstructured data?

A

Data that cannot be stored in a traditional database

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

What is first normal form?

A

All data is in atomic form and there are no many-to-many relationships

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

What is second normal form?

A

The data is in 1NF and there are no partial key dependencies

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

What is third normal form?

A

The data is in 2NF and there are no non-key dependencies

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

Why is reverse Polish notation used?

A

To make mathematical expressions easier for a computer to process

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

What type of tree traversal does reverse Polish notation use?

A

Post-order traversal

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

Name two ways in which vectors can be expressed

A

As a list or as a mapping of a function onto a list of values

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

What is a convex combination of vectors?

A

If a vector is convex then au +Bv = 1 where a, B > 0

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

What are convex combinations used for?

A

To determine whether a vector lies on a plane or not

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

What is SSH used for?

A

For transferring data in a secure, encrypted manner

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

What are the 6 main SSH commands?

A

×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
Q

What are the 3 main FTP commands?

A

PWD - Print the working directory
CDUP - Change to the parent directory
PASV - Enter passive mode

42
Q

What does POP3 do?

A

Retrieves email from a server, deleting it from the server when it is on the client device

43
Q

What does IMAP do?

A

Keeps mail on the sever and on the client in sync

44
Q

What does SMTP do?

A

Transfers mail from one device to a server

45
Q

What is a tree?

A

A graph with no cycles

46
Q

What is in-order traversal?

A

Left node, root, right node

47
Q

What is pre-order traversal?

A

Root, left node, right node

48
Q

What is post-order traversal?

A

Left node, right node, root

49
Q

How do gateways differ from routers?

A

Gateways allow for networks of different types to be connected, routers only connect networks of the same type

50
Q

What is the domain name system?

A

DNS is used to translate URLs into IP addresses

51
Q

What do Internet registrars do?

A

Allocate IP addresses to URLs

52
Q

What is a URL?

A

A university resource locator is a user-friendly way of identifying web resources

53
Q

What is a D-type flip-flop?

A

A positive rising-edge memory unit

54
Q

Why is a clock input needed for a D-type flip-flop to operate?

A

The flip-flop stores the input signal when a rising-edge clock signal is provided

55
Q

What is the definition of a set?

A

An unordered collection of elements in which each element only occurs once

56
Q

What is a finite set?

A

A set with a countable number of elements

57
Q

What is the cardinality of a set?

A

The number of elements a set contains

58
Q

What is the Cartesian product of two sets?

A

Every element of a set is paired with every element of a second set to for a larger set

59
Q

What is a subset?

A

A set where every item of that set is a a member of another set

60
Q

What is a proper subset?

A

A set that is not equal to another set, but is a subset

61
Q

What is the difference of two sets?

A

A/B is every value in A that is not in B

62
Q

What is the definition of a tractable problem?

A

A problem that can be solved with a polynomial time complexity or better

63
Q

What is a heuristic solution?

A

A solution to a problem that was found by simplifying a problem in order to estimate the solution

64
Q

Give a real-world example of heuristic solutions to intractable problems?

A

Virus scanners use heuristic methods to analyse code and determine if it is likely to be a virus or not

65
Q

What is a stack?

A

A last in, first out data structure

66
Q

How can arrays be used as a static stack?

A

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
Q

List the five main stack functions and what they do

A

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
Q

What limits the size of a dynamic stack?

A

The number of memory locations available

69
Q

How can overflow be detected in a stack?

A

An item cannot be added to the stack

70
Q

How can underflow be detected?

A

The pointer has a value of - 1

71
Q

What is a call stack used for?

A

To keep track of active subroutines and the parameters used by each

72
Q

What is the return address?

A

The address in memory of the instruction that control will return to after a subroutine ends

73
Q

What is stack overflow?

A

Stack overflow occurs when a subroutine is called too any times, and the call stack overflows. This causes the program to crash

74
Q

What is a stack frame?

A

Stack frames make up a call stack. They contain information about active subroutines and parameters specific to each

75
Q

What is a hashing algorithm?

A

An algorithm used to generate a location in memory for data

76
Q

Name the most common hashing algorithm.

A

The value is divided by the number of available memory locations, with the remainder used as the index

77
Q

What are synonyms?

A

Two instances of a hash code with the same value

78
Q

What is a collision involving hash tables?

A

When a collision occurs

79
Q

How can an item be searched for in a hash table?

A

×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
Q

What is a folding hashing algorithm?

A

A value is split into equal components, which are a summed to get a hash code

81
Q

What is an entity?

A

An object that it is possible to store data about

82
Q

What is an attribute in a database?

A

Points of data that can be stored relating to an option

83
Q

What are entity identifiers?

A

They allow for entities to be uniquely identified. They are similar to primary keys of databases

84
Q

What is the purpose of a DBMS?

A

Allows for a client-server database to be instantiated

85
Q

List the advantages of using a client-server database

A
  • Allows for better access management
  • One centralised database, constantly up to date
  • Expensive service can be provided to many users at once
86
Q

List the disadvantages of using a client-server database

A

-If there are no extra measures in place, two users can update a record at the same time

87
Q

When does a deadlock occur?

A

When two users update a record at the same time but neither can be implemented

88
Q

How does serialisation prevent deadlocks?

A

If a transaction is already in process, another cannot start until it has ended

89
Q

How does timestamping prevent deadlocks?

A

Each transaction is given a read timestamp and a write timestamp. The transactions are carried out in the order specified by the timestamps

90
Q

How does commitment ordering prevent deadlocks?

A

Transactions are given priorities based on their dependencies on each other, as well as their timestamps

91
Q

Name the most common type of client-server system

A

HTTP servers. They receive requests of services from the client, and send webpage data in return

92
Q

What is an API?

A

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
Q

What is the WebSocket protocol?

A

A protocol that allows for full-duplex communication between a client and server that is much faster than traditional communication

94
Q

Why is the WebSockets protocol faster than other methods?

A

WebSockets reduces packet sizes significantly, meaning transmission is faster

95
Q

What is REST system design?

A

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
Q

What is a RESTful API?

A

An application programming interface that makes use of the REST system design

97
Q

Describe how HTTP request methods work

A
  • 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
Q

List the advantages of JSON over XML

A
  • Easier for humans to read
  • Code is more compact
  • Code is easier to create
  • Code is easier for computers to parse