DEV Community

Cover image for COMPUTER SCIENCE 101 – SUMMARY
Aman Verma
Aman Verma

Posted on

COMPUTER SCIENCE 101 – SUMMARY

▶ Coding Reality

  • Most developers debug by re-running code without understanding it.
  • You can earn well in software while treating computers like magic.

▶ What a Computer Is

  • A computer is essentially a Turing Machine.
  • Built from billions of transistors acting as ON/OFF switches.
  • Smallest unit: Bit (0 or 1)
  • 8 bits = 1 Byte (256 values)
  • Characters mapped using ASCII / UTF-8.

▶ Binary & Machine Code

  • Computers use binary (base-2).
  • Humans prefer hexadecimal (base-16).
  • Code is converted into machine code for the CPU.

▶ Memory & Hardware

  • RAM stores data using memory addresses.
  • CPU + RAM = the brain of the computer.
  • Input devices (keyboard, mouse), Output devices (monitor).
  • OS (Linux, Windows, macOS) manages hardware via drivers.
  • Shell = interface to interact with OS (CLI, SSH).

▶ Programming Languages

  • Interpreted: Python (line-by-line execution).
  • Compiled: C/C++ (compiled to executable).
  • Abstraction hides hardware complexity.

▶ Variables & Memory

  • Variable names and data are stored in memory.
  • Dynamic typing (Python) vs Static typing (C).
  • Pointers store memory addresses.
  • The garbage collector manages memory automatically.

▶ Data Types

  • int, float, double for numbers.
  • char, string for text.
  • Big-endian vs Little-endian memory storage.

▶ Data Structures

  • Array/List: indexed, ordered.
  • Linked List: nodes with pointers.
  • Stack: LIFO
  • Queue: FIFO
  • Hash Map / Dictionary: key–value pairs.
  • Tree: hierarchical structure.
  • Graph: nodes + edges (relationships).

▶ Algorithms

  • Algorithms solve problems using data structures.
  • Functions take input → process → return output.
  • Expressions produce values; Statements perform actions.
  • Conditionals (if/else), Loops (for/while).
  • Recursion uses a call stack → risk of stack overflow.
  • Base condition prevents infinite recursion.

▶ Performance Analysis

  • Big-O notation measures efficiency.
  • Time complexity & Space complexity.

▶ Algorithm Types

  • Brute Force
  • Divide & Conquer (Binary Search)
  • Dynamic Programming (Memoization)
  • Greedy Algorithms (e.g., Dijkstra)
  • Backtracking (exploring all paths)

▶ Programming Paradigms

  • Declarative (what to do)
  • Imperative (how to do)
  • Functional, Procedural
  • Object-Oriented Programming (Classes & Objects)
  • Inheritance & Design Patterns

▶ Memory Areas

  • Stack: short-lived function calls.
  • Heap: long-lived objects, passed by reference.

▶ Concurrency & Parallelism

  • Threads enable parallel execution.
  • Concurrency via event loops & coroutines.

▶ Networking & Cloud

  • Virtual Machines simulate hardware.
  • IP addresses identify machines.
  • DNS maps URLs to IPs.
  • TCP handshake establishes a connection.
  • SSL encrypts data.
  • HTTP transfers web data.
  • APIs (REST) expose server data.

▶ Final Truth

  • You must learn printers.
  • Because grandma will ask you to fix them.

Top comments (0)