Software Flashcards

1
Q

What is the Gang of Four?

A

A book of design patterns written by four authors. Common ones include Factory, Strategy, Singleton, Observer

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

What is a HAL?

A

Hardware Abstraction Layer, used to separate hardware specific implementation details from business logic

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

What is Cache Memory?

A

High speed volatile memory used by CPU to store frequently accesssed data. Buffer between CPU and main memory (RAM)

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

What’s the difference between Stack and Heap?

A

Stack is automatically allocated by compiler whereas heap is dynamically allocated by programmer with malloc() calloc() realloc() free() in C

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

What is Virtual Memory?

A

OSs map actual memory to virtual memory to provide programs the illusion that they have access to large blocks of contiguous memory. The OS uses a page table to map virtual memory addresses to physical memory addresses

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

What is recursion?

A

When a function calls itself

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

Single responsiblity principle

A

A class should encapsulate one functionality and therefore have only one reason to change

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

Open-Close Principle

A

Open to extension closed to modification (abstraction and polymorphism)

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

Liskov Substitution Principle

A

Parent class should be replaceable by its subclasses without affecting program correctness

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

Interface Segregation Principle

A

Software modules should not be dependent on interfaces they don’t use. E.g. interfaces should be small and focused in order to reduce dependencies

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

Dependency Inversion Principle

A

High level modules should not depend on low-level modules. Rather details should depend on abstractions

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

What is polymorphism?

A

Overloading and overriding of functions

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

What is the strategy pattern?

A

Allows an object to vary its behavior by selecting from a family of algos at runtime.

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