Software Flashcards
What is the Gang of Four?
A book of design patterns written by four authors. Common ones include Factory, Strategy, Singleton, Observer
What is a HAL?
Hardware Abstraction Layer, used to separate hardware specific implementation details from business logic
What is Cache Memory?
High speed volatile memory used by CPU to store frequently accesssed data. Buffer between CPU and main memory (RAM)
What’s the difference between Stack and Heap?
Stack is automatically allocated by compiler whereas heap is dynamically allocated by programmer with malloc() calloc() realloc() free() in C
What is Virtual Memory?
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
What is recursion?
When a function calls itself
Single responsiblity principle
A class should encapsulate one functionality and therefore have only one reason to change
Open-Close Principle
Open to extension closed to modification (abstraction and polymorphism)
Liskov Substitution Principle
Parent class should be replaceable by its subclasses without affecting program correctness
Interface Segregation Principle
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
Dependency Inversion Principle
High level modules should not depend on low-level modules. Rather details should depend on abstractions
What is polymorphism?
Overloading and overriding of functions
What is the strategy pattern?
Allows an object to vary its behavior by selecting from a family of algos at runtime.