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
Q

How does the CPU execute programs?

A

Via Fetch/decode/execute cycle

26
Q

What is clock speed?

A

How fast a CPU can perform one fetch/decode/execute cycle

27
Q

What unit is clock speed measured in?

A

Gigahertz, billions of CPU-cycles every second.

28
Q

What’s the small piece of RAM installed on the CPU called?

A

Cache

29
Q

Why do we need a cache?

A

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
Q

Cache hit

A

Data found in cache

31
Q

Cache miss

A

Data not found in cache

32
Q

What can multi-core processors do?

A

Run multiple streams of instructions at once - but sharing cache for example so the cores can work together

33
Q

What is the native language of computers?

A

Raw binary.

34
Q

What do assemblers do?

A

Read instructions written in assembly code and translate them to binary.

35
Q

What are assembly languages?

A

Low level programming languages that map 1:1 to machine instructions.

36
Q

High level languages are fed through …

A

A compiler

37
Q

What are the three parts of computer science?

A
  1. Theoretical computer science
  2. Computer engineering
  3. Applications/software engineering
38
Q

What is the stack?

A

Short-term memory for currently executing functions. Gets overwritten all the time.

39
Q

What’s the heap?

A

Long-term memory, needs to be allocated and freed or your program will have a memory leak and start running very slow.

40
Q

Stack and/or heap overflow?

A

Too much memory is used and the stack and the heap start clashing.

41
Q

What can cause stack overflow?

A

Infinte loops, recursive calls.

42
Q

What’s the first thing that happens when we type in a url in the browser?

A

Request is sent to ISP - ISP asks DNS what IP to go to.

43
Q

ISP

A

Internet Service Provider

44
Q

What happens when ISP ask DNS about IP address?

A

IP address is sent to ISP and returned to browser.

45
Q

What happens when IP address is returned from DNS to ISP to browser?

A

Browser sends request to the IP address directly

46
Q

What happens when the browser sends request to IP address?

A

Server at IP address either rejects or responds and sends html, css and js files

47
Q

What happens when the browser recieves a server response?

A

The browser renders the page.

48
Q

What is the Internet backbone?

A

Physical cables all over the world

49
Q

Three basic ways to improve web performance?

A
  1. Make sure physical distance from servers is small
  2. As few trips as possible
  3. As small files as possible
50
Q

What is WWW?

A

A shared language between computers that works on top of the internet.

51
Q

What are 5 expectations of a junior developer?

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

“Your code will always … , may as well …”

A

“Your code will always suck, may as well have fun

53
Q

“You will never …, but that’s ok”

A

“You will never know enough, but that’s ok”

54
Q

“You will never be a master but…”

A

“You will never be a master but being a student is so much better”

55
Q

QDD

A

Question Driven Development