CS basics Flashcards

1
Q

What does big O notation do?

A

Describe performance of an algorithm, meaning the cost in relation to input

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

Big O O(1)

A

Constant time (eg printing the first item in array)

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

Big O O(n)

A

Linear time - grows 1:1 with growth of input (eg printing all items in array)

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

Big O O(n2)

A

Quadratic time (eg nested loops)

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

Big O O(log n)

A

Logaritmic time (binary search, very scaleable)

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

Big O O(2n)

A

Exponential time (avoid at all cost)

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

Arity

A

Antal argument i en funktion

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

Interpreters translate…

A

Line by line

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

Compilers translate…

A

All lines and execute the whole program

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

Vad är HMR (Hot Module Replacement) ?

A

En funktion som tillåter snabbare iterationer genom att ersätta, lägga till eller ta bort moduler i en applikation utan att behöva ladda om hela sidan eller förlora tillstånd.

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

What does ‘binary’ mean?

A

‘Of two states’ eg on/off or 1/0

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

How big is one binary number?

A

1 bit

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

How many values can be represented with 8-bit numbers?

A

0 -255 (256)

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

How big is 8 bits?

A

1 byte

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

How many values can be represented with 32 bits?

A

Just under 4.3 billion

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

How are numbers used to represent letters in binary?

A

UTF (8 or 16)

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

Where do computers calculate?

A

In the ALU

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

ALU

A

Arithmetic and Logic Unit

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

UTF

A

Unicode Transformation Format

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

How are values stored in memory?

A

Registers & RAM

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

RAM

A

Random Access Memory

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

How long does a value stay in RAM?

A

As long as the power stays on (or it isn’t needed anymore)

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

CPU

A

Central processing unit

24
Q

What does the CPU do?

A

Executes programs, ie series or collections of instructions

25
How does the CPU execute programs?
Via Fetch/decode/execute cycle
26
What is clock speed?
How fast a CPU can perform one fetch/decode/execute cycle
27
What unit is clock speed measured in?
Gigahertz, billions of CPU-cycles every second.
28
What's the small piece of RAM installed on the CPU called?
Cache
29
Why do we need a cache?
Because data needs to travel between CPU and RAM it's faster to check first if we already have the value stored in cache.
30
Cache hit
Data found in cache
31
Cache miss
Data **not** found in cache
32
What can multi-core processors do?
Run multiple streams of instructions at once - but sharing cache for example so the cores can work together
33
What is the native language of computers?
Raw binary.
34
What do assemblers do?
Read instructions written in assembly code and translate them to binary.
35
What are assembly languages?
Low level programming languages that map 1:1 to machine instructions.
36
High level languages are fed through ...
A compiler
37
What are the three parts of computer science?
1. Theoretical computer science 2. Computer engineering 3. Applications/software engineering
38
What is the stack?
Short-term memory for currently executing functions. Gets overwritten all the time.
39
What's the heap?
Long-term memory, needs to be allocated and freed or your program will have a memory leak and start running very slow.
40
Stack and/or heap overflow?
Too much memory is used and the stack and the heap start clashing.
41
What can cause stack overflow?
Infinte loops, recursive calls.
42
What's the first thing that happens when we type in a url in the browser?
Request is sent to ISP - ISP asks DNS what IP to go to.
43
ISP
Internet Service Provider
44
What happens when ISP ask DNS about IP address?
IP address is sent to ISP and returned to browser.
45
What happens when IP address is returned from DNS to ISP to browser?
Browser sends request to the IP address directly
46
What happens when the browser sends request to IP address?
Server at IP address either rejects or responds and sends html, css and js files
47
What happens when the browser recieves a server response?
The browser renders the page.
48
What is the Internet backbone?
Physical cables all over the world
49
Three basic ways to improve web performance?
1. Make sure physical distance from servers is small 2. As few trips as possible 3. As small files as possible
50
What is WWW?
A shared language between computers that works on top of the internet.
51
What are 5 expectations of a junior developer?
1. Know the basic stack 2. Basic git 3. Actively seeking to learn 4. Persistent with problem solving 5. Never afraid to ask questions -nothing is dumb
52
"Your code will always ... , may as well ..."
"Your code will always **suck**, may as well **have fun**"
53
"You will never ..., but that's ok"
"You will never **know enough**, but that's ok"
54
"You will never be a master but..."
"You will never be a master but being a student is so much better"
55
QDD
Question Driven Development