Skip to content

asadlive84/interview-prep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

📘 Developer Study Guide

A complete technical summary for core backend and computer science concepts.


🧭 Index

  1. Object-Oriented Programming (OOP)
  2. Database (SQL)
  3. Basic Networking
  4. Problem Solving
  5. Data Structures

Object-Oriented Programming (OOP)

1. Class and Object

  • Class: A blueprint for creating objects that defines attributes and behaviors.
  • Object: An instance of a class.

2. Four Pillars of OOP

  1. Encapsulation – Wrapping data (variables) and methods (functions) into a single unit.
    Example: Using private fields and getter/setter methods.

  2. Abstraction – Hiding complex implementation details and showing only necessary features.
    Example: Abstract classes, interfaces.

  3. Inheritance – Reusing code by deriving a new class from an existing one.
    Example: class Child extends Parent.

  4. Polymorphism – Same function behaves differently based on context.
    Example: Method overriding and overloading.


3. Abstract Class

  • Cannot be instantiated directly.
  • Can contain both abstract and concrete methods.

4. Interface

  • Defines a contract that implementing classes must fulfill.
  • Contains only method declarations.

5. Overloading vs Overriding

a. Method Overloading vs Constructor Overloading

  • Method Overloading: Same method name, different parameters.
  • Constructor Overloading: Multiple constructors with different parameters.

b. Method Overriding

  • Subclass provides its own implementation of a method defined in the parent class.

6. Composition, Aggregation, Association

  • 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.

7. SOLID Principles

  1. S – Single Responsibility Principle
  2. O – Open/Closed Principle
  3. L – Liskov Substitution Principle
  4. I – Interface Segregation Principle
  5. D – Dependency Inversion Principle

8. Composition vs Inheritance

  • Composition: Reuse by containing objects of other classes.
  • Inheritance: Reuse by extending existing classes.

9. Access Modifiers

  • Private – Accessible only within the same class.
  • Protected – Accessible within the same package or subclasses.
  • Public – Accessible from anywhere.

10. Difference Between Abstract Class and Interface

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

11. Multilevel and Multiple Inheritance

  • Multilevel – A → B → C
  • Multiple – A class inherits from more than one parent (via interfaces in Java).

12. Basic Design Patterns

  • 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.

Database (SQL)

1. Various Keys

  • 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).

2. Data Types

Common SQL types: INT, VARCHAR(n), DATE, BOOLEAN, FLOAT, DOUBLE, TEXT, BLOB


3. CRUD Operations

C – Create (INSERT)
R – Read (SELECT)
U – Update (UPDATE)
D – Delete (DELETE)


4. SQL Queries

i. Basic Queries

SELECT, INSERT, UPDATE, DELETE

ii. WHERE vs HAVING

  • WHERE: Filters rows before aggregation.
  • HAVING: Filters groups after aggregation.

iii. GROUP BY and ORDER BY

  • GROUP BY: Groups rows.
  • ORDER BY: Sorts output.

iv. UNION vs UNION ALL

  • UNION: Removes duplicates.
  • UNION ALL: Keeps duplicates.

v. Subqueries

  • Correlated – Runs once per outer query row.
  • Non-Correlated – Independent.

vi. Common SQL Functions

MIN(), MAX(), AVG(), COUNT(), SUM(), LIKE, ILIKE


5. DELETE vs TRUNCATE

Feature DELETE TRUNCATE
Removes specific rows Yes No
Transaction safe Yes No
WHERE clause Yes No
Resets identity No Yes

6. Sequence and Auto-Increment

  • Sequence – Generates numeric values.
  • Auto-Increment – Automatically increases ID on insert.

7. Joins

  • INNER JOIN – Matches both.
  • LEFT JOIN – All left, matched right.
  • RIGHT JOIN – All right, matched left.
  • FULL OUTER JOIN – All from both sides.

8. Relationships

  • One-to-One
  • One-to-Many
  • Many-to-One
  • Many-to-Many

9. ER Diagram

  • Entity – Table or object.
  • Attributes – Fields or columns.
  • Cardinality – 1:1, 1:N, M:N
  • Ordinality – Mandatory or optional.

10. Indexing

Purpose: Faster retrieval.
Types: Primary, Secondary, Clustered
Structures: B-Tree, GIN, GiST


11. Normalization

  • 1NF – Remove repeating groups.
  • 2NF – Remove partial dependencies.
  • 3NF – Remove transitive dependencies.
  • BCNF – Stronger 3NF.

12. Transactions and Problems

a. Common Problems

  • Dirty Read
  • Non-Repeatable Read
  • Phantom Read
  • Incorrect Summary

b. Isolation Levels

  1. Read Uncommitted
  2. Read Committed
  3. Repeatable Read
  4. Serializable

13. ACID Properties

  • Atomicity – All or none.
  • Consistency – Maintains rules.
  • Isolation – Independent execution.
  • Durability – Permanent results.

Basic Networking

  1. OSI Layer → 7 Layers
  2. HTTP, HTTPS, FTP, SFTP, SMTP, POP3, TCP, UDP
  3. HTTP vs HTTPS
  4. TCP vs UDP
  5. DNS (Name Resolution)
  6. LAN, WAN, MAN, PAN
  7. IPv4 vs IPv6
  8. Ping & Traceroute
  9. IP vs MAC Address
  10. TLS/SSL

Problem Solving

  1. Time & Space Complexity
  2. Solve ≥ 50 problems on LeetCode
  3. Solve ≥ 100 Easy problems
  4. Top 30 Array Interview Questions
  5. Sorting Algorithms
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Heap Sort
    • Counting Sort
    • Radix Sort
    • Bucket Sort

Datastructures

  1. Time Complexity & Space Complexity
  2. Linked List → Tortoise & Hare Algorithm
  3. Stack
  4. Queue
  5. Heap
  6. Binary Search Tree
    • Traversal:
      1. In-Order
      2. Pre-Order
      3. Post-Order

Data Structures and Algorithms Priority List

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

High Priority Topics

  • Hashmaps
  • Recursion
  • Depth First Search
  • Breadth First Search
  • Linked Lists
  • Binary Trees
  • Graphs
  • Dynamic Programming

Low Priority Topics

  • Combinatorics
  • Topological Sort
  • Two Pointer
  • Sliding Window
  • Sorting Algorithms
  • Binary Search
  • Heaps
  • Stack
  • Queue

No Priority Topics

  • 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

About

Interview prepation by Habib Bhai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors