Dev terms Flashcards
Big O Notation
Defines the performance of an algorithm/system O Complexity Rate of growth O(1) constant fast O(log n) logarithmic O(n) linear time O(n * log n) log linear O(n^2) quadratic O(n^3) cubic O(2^n) exponential O(n!) factorial slow
Recursion
Increments n from previous result
Step 1 If you are at home, stop moving. Step 2 Take one step toward home. Step 3 "find your way home".
Big Data
Big data describes data sets so large and complex that is impossible to manage with conventional data processing tools.
Data Structures
Array =
data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key.
Tree =
a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.
Stack=
collection of elements, with two principal operations:
push, which adds an element to the collection,
AND
pop, which removes the most recently added element that was not yet removed.
Queue=
a collection of entities that are maintained in a sequence and can be modified by the addition of entities at one end of the sequence and removal from the other end of the sequence
Graph
Hash Table=
a structure that can map keys to values.
Linked List =
each node contains: data, and a reference (in other words, a link) to the next node in the sequence.
Heap=
for any given node C, if P is a parent node of C, then the key (the value) of P is greater than or equal to the key of C. In a min heap, the key of P is less than or equal to the key of C.
Greedy Algorithm
Picks a selection based on one parameter at the beginning and never reconsiders.
A greedy algorithm picks the best immediate choice and never reconsiders its choices.
Hill Climbing
The hill climbing algorithm attempts to find a better solution by generating a neighboring solution. Each neighboring solution is generated based on the best solution so far, with a single element modified.
Dynamic Programming
Memoization (yes emoization not memorization), a top-down approach in dynamic programming, which store the results of previous computations for future use.
it refers to simplifying a complicated problem by breaking it down into simpler sub-problems in a recursive manner
P vs NP Problem
Finding the original factors of a number is hard. So P is a (polynomial) problem because it is easy to solve. Computer can easily multiply 2 super large numbers without spending significantly more computer time than small numbers.
Q2 is a NP (nondeterministic polynomial) problem because it is easy to verify, but hard to solve.
How do computers work?
Abstraction
- Low level = Assembly language, hardware manipulation. Machine language is binary
- Mid level = performance critical software. C, C++
- High level = Ease of use. Python, java, C#
Parallelism
Parallelism allows 2 or more tasks to run at the same time,.
Race Condition
Output can’t be consistently predicted because dependent on a sequence or timing.
This is what will happen if you allow concurrent transactions in a banking system and race condition isn’t handled.
Mutual Exclusion (Mutex)
Now, whenever there’s an ongoing transaction, the system will lock the account(s) involved in the transaction.
Semaphore
Binary Semaphore =
2 different states.
Counting Semaphore =
More than 2 states
Deadlock
2 oposite transactions crate a deadlock because each transaction blocks its source account.
Computer Hacking
Brute-force Attack = A brute-force attack tries every possible passwords, and usually starts by guessing commonly used passwords like “123456”, “abcdef”, etc.
Social Engineering = Social engineering is tricking users into revealing their private information.
Security Exploit
Trojan Horse = A trojan horse is malware program that pretends to be useful or helpful and runs malicious code in the background.
Rootkit = A rootkit gains administrator or root access of a computer through various ways then disguise as necessary files that is hard to detect by antivirus software.
Distributed Denial-of-service Attack (DDoS) = DDoS attempts to bring a site or service down by flooding it with visitors.