A complete technical summary for core backend and computer science concepts.
- Class: A blueprint for creating objects that defines attributes and behaviors.
- Object: An instance of a class.
-
Encapsulation – Wrapping data (variables) and methods (functions) into a single unit.
Example: Using private fields and getter/setter methods. -
Abstraction – Hiding complex implementation details and showing only necessary features.
Example: Abstract classes, interfaces. -
Inheritance – Reusing code by deriving a new class from an existing one.
Example:class Child extends Parent. -
Polymorphism – Same function behaves differently based on context.
Example: Method overriding and overloading.
- Cannot be instantiated directly.
- Can contain both abstract and concrete methods.
- Defines a contract that implementing classes must fulfill.
- Contains only method declarations.
- Method Overloading: Same method name, different parameters.
- Constructor Overloading: Multiple constructors with different parameters.
- Subclass provides its own implementation of a method defined in the parent class.
- Association – Relationship between two classes.
- Aggregation – "Has-A" relationship; one class contains another but both can exist independently.
- Composition – Strong "Has-A" relationship; if parent is destroyed, child is too.
- S – Single Responsibility Principle
- O – Open/Closed Principle
- L – Liskov Substitution Principle
- I – Interface Segregation Principle
- D – Dependency Inversion Principle
- Composition: Reuse by containing objects of other classes.
- Inheritance: Reuse by extending existing classes.
- Private – Accessible only within the same class.
- Protected – Accessible within the same package or subclasses.
- Public – Accessible from anywhere.
| Feature | Abstract Class | Interface |
|---|---|---|
| Methods | Can have both abstract and concrete methods | Only abstract methods (by default) |
| Variables | Can have fields | Cannot have instance fields |
| Inheritance | A class can extend only one abstract class | A class can implement multiple interfaces |
- Multilevel – A → B → C
- Multiple – A class inherits from more than one parent (via interfaces in Java).
- Singleton – Only one instance exists.
- Builder – Simplifies object creation.
- Factory – Creates objects without exposing creation logic.
- Strategy – Allows selecting an algorithm at runtime.
- State – Object behavior changes based on internal state.
- Primary Key – Uniquely identifies each record.
- Foreign Key – Links one table to another.
- Unique Key – Ensures unique values.
- Candidate Key – Can qualify as a primary key.
- Alternate Key – Candidate key not chosen as primary.
- Composite Key – Multiple columns forming a unique identity.
- Super Key – Attributes that uniquely identify records.
- Surrogate Key – Artificial (auto-increment) key.
- Natural Key – Real-world derived (e.g., email).
Common SQL types:
INT, VARCHAR(n), DATE, BOOLEAN, FLOAT, DOUBLE, TEXT, BLOB
C – Create (INSERT)
R – Read (SELECT)
U – Update (UPDATE)
D – Delete (DELETE)
SELECT, INSERT, UPDATE, DELETE
- WHERE: Filters rows before aggregation.
- HAVING: Filters groups after aggregation.
- GROUP BY: Groups rows.
- ORDER BY: Sorts output.
- UNION: Removes duplicates.
- UNION ALL: Keeps duplicates.
- Correlated – Runs once per outer query row.
- Non-Correlated – Independent.
MIN(), MAX(), AVG(), COUNT(), SUM(), LIKE, ILIKE
| Feature | DELETE | TRUNCATE |
|---|---|---|
| Removes specific rows | Yes | No |
| Transaction safe | Yes | No |
| WHERE clause | Yes | No |
| Resets identity | No | Yes |
- Sequence – Generates numeric values.
- Auto-Increment – Automatically increases ID on insert.
- INNER JOIN – Matches both.
- LEFT JOIN – All left, matched right.
- RIGHT JOIN – All right, matched left.
- FULL OUTER JOIN – All from both sides.
- One-to-One
- One-to-Many
- Many-to-One
- Many-to-Many
- Entity – Table or object.
- Attributes – Fields or columns.
- Cardinality – 1:1, 1:N, M:N
- Ordinality – Mandatory or optional.
Purpose: Faster retrieval.
Types: Primary, Secondary, Clustered
Structures: B-Tree, GIN, GiST
- 1NF – Remove repeating groups.
- 2NF – Remove partial dependencies.
- 3NF – Remove transitive dependencies.
- BCNF – Stronger 3NF.
- Dirty Read
- Non-Repeatable Read
- Phantom Read
- Incorrect Summary
- Read Uncommitted
- Read Committed
- Repeatable Read
- Serializable
- Atomicity – All or none.
- Consistency – Maintains rules.
- Isolation – Independent execution.
- Durability – Permanent results.
- OSI Layer → 7 Layers
- HTTP, HTTPS, FTP, SFTP, SMTP, POP3, TCP, UDP
- HTTP vs HTTPS
- TCP vs UDP
- DNS (Name Resolution)
- LAN, WAN, MAN, PAN
- IPv4 vs IPv6
- Ping & Traceroute
- IP vs MAC Address
- TLS/SSL
- Time & Space Complexity
- Solve ≥ 50 problems on LeetCode
- Solve ≥ 100 Easy problems
- Top 30 Array Interview Questions
- Sorting Algorithms
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Time Complexity & Space Complexity
- Linked List → Tortoise & Hare Algorithm
- Stack
- Queue
- Heap
- Binary Search Tree
- Traversal:
- In-Order
- Pre-Order
- Post-Order
- Traversal:
| high priority | low priority | no priority |
|---|---|---|
| hashmaps | combinatorics | dijkstra's algorithm |
| recursion | topological sort | bellman-ford algorithm |
| depth first search | two pointer | floyd-warshall algorithm |
| breath first search | sliding window | union find |
| linked lists | sorting algorithms | quick select |
| binary trees | binary search | tries |
| graphs | heaps | red-black trees |
| dynamic programming | stack | AVL trees |
| queue | greedy algorithms | |
| Prim's algorithm | ||
| Kruskal's algorithm | ||
| bit manipulation |
- Hashmaps
- Recursion
- Depth First Search
- Breadth First Search
- Linked Lists
- Binary Trees
- Graphs
- Dynamic Programming
- Combinatorics
- Topological Sort
- Two Pointer
- Sliding Window
- Sorting Algorithms
- Binary Search
- Heaps
- Stack
- Queue
- Dijkstra's Algorithm
- Bellman-Ford Algorithm
- Floyd-Warshall Algorithm
- Union Find
- Quick Select
- Tries
- Red-Black Trees
- AVL Trees
- Greedy Algorithms
- Prim's Algorithm
- Kruskal's Algorithm
- Bit Manipulation
Credit @Habib Bhai