Table of Contents

When learning any tech (Kafka, Redis, TCP, etc.):

1. Start with WHY (Purpose / Motivation: most important first): Why does this exist?

2. Then WHAT (Concept / Definition: structure, components): What is it?

3. Then HOW (Implementation / Usage: flow, example, code)

4. Then build something small

5. Final summay by yourself (why, what, how)

Framework: Learn Any Technology from First Principles

Instead of memorizing tools, learn technologies using this sequence:

Problem → Theory → Patterns → Standards → Technologies → Implementation → Trade-offs

Example:

Authentication
    ↓
Identity and Access Management
    ↓
Session-Based Authentication
    ↓
OAuth 2.0 / OpenID Connect
    ↓
Keycloak / Auth0 / Cognito
    ↓
SDK Integration

Universal Questions

When learning a new technology, always ask:

* What problem does it solve? * Why did this problem exist? * What is the underlying computer science theory? * What design patterns are commonly used? * What standards or protocols define it? * How does it work internally? * What trade-offs exist? * What alternatives are available? * When should I use it? * When should I avoid it? * What are common mistakes? * How does it fail? * How is it implemented at scale? * What interview questions are commonly asked?

Universal AI Prompt

I want to understand [TECHNOLOGY] deeply.

Explain it using this structure:

1. What problem does it solve?
2. Why did this problem exist?
3. What is the underlying theory or computer science concept?
4. What design patterns are commonly used?
5. What standards or protocols define it?
6. How does it work internally?
7. What are the trade-offs?
8. What alternatives exist?
9. When should I use it?
10. When should I avoid it?
11. What are common mistakes?
12. How does it fail?
13. How is it implemented at scale?
14. Give a real-world architecture example.
15. Explain it from beginner to advanced level.
16. Create a mental model and analogy.
17. Generate common interview questions and answers.

    

Learning Framework

For every technology, organize knowledge into six layers:

Layer 1: Problem

What pain point does it solve?

Example:

* Slow database queries * Secure user login * Service-to-service communication * High availability * Asynchronous processing

Layer 2: Theory

Identify the computer science concepts.

Examples:

* Cryptography * Distributed Systems * Networking * Operating Systems * Database Theory * Information Retrieval

Layer 3: Patterns

Learn common architectural patterns.

Examples:

* Client-Server * Publish-Subscribe * CQRS * Event Sourcing * Cache-Aside * API Gateway * Circuit Breaker

Layer 4: Standards and Protocols

Learn industry standards.

Examples:

* HTTP * TLS * OAuth 2.0 * OpenID Connect * JWT * AMQP * DNS

Layer 5: Technologies

Study implementations.

Examples:

* Redis * Kafka * RabbitMQ * PostgreSQL * Keycloak * NGINX

Layer 6: Implementation

Write code and operate systems.

Examples:

* SDK integration * API design * Monitoring * Logging * Scaling * Deployment

Example: Authentication

Learning Path

Identity Management
    ↓
Authentication vs Authorization
    ↓
Session-Based Authentication
    ↓
OAuth 2.0
    ↓
OpenID Connect
    ↓
Single Sign-On
    ↓
Keycloak / Auth0

AI Prompt

I want to understand authentication deeply.

Start with the theory:

* Identity
* Authentication
* Authorization
* Access Control

Explain the differences between:

* Password authentication
* API keys
* Sessions
* JWT
* OAuth 2.0
* OpenID Connect
* SSO
* Passkeys

For each approach explain:

* How it works
* Security properties
* Advantages
* Disadvantages
* Common attacks
* Scalability characteristics
* Best use cases

Finally, create a decision tree for choosing the right approach. 

Example: Cryptography

Learning Path

Confidentiality, Integrity, Availability
    ↓
Hash Functions
    ↓
Symmetric Encryption
    ↓
Asymmetric Encryption
    ↓
Digital Signatures
    ↓
TLS
    ↓
JWT / OAuth / PKCE

AI Prompt

I want to understand cryptography deeply.

Explain:

* Confidentiality
* Integrity
* Authenticity
* Non-repudiation

Then explain:

* Hashing
* Symmetric encryption
* Asymmetric encryption
* Digital signatures
* Key exchange

Compare:

* AES
* RSA
* ECC
* SHA-256
* HMAC

Finally explain how these concepts are used in:

* HTTPS/TLS
* JWT
* OAuth 2.0
* PKCE
* SSO

  

Example: Caching

Learning Path

Performance Optimization
    ↓
Temporal and Spatial Locality
    ↓
Cache Consistency
    ↓
Cache Patterns
    ↓
Redis

AI Prompt

I want to understand caching deeply.

Explain:

* Why caching exists
* Temporal locality
* Spatial locality
* Cache hit ratio

Compare eviction algorithms:

* LRU
* LFU
* FIFO
* TTL

Explain cache patterns:

* Cache-aside
* Read-through
* Write-through
* Write-behind

Explain:

* Cache invalidation
* Distributed caching
* Consistency challenges
* Redis internals
* Common failure scenarios

  

Example: Message Queues

Learning Path

Asynchronous Communication
    ↓
Producer-Consumer Pattern
    ↓
Publish-Subscribe
    ↓
Delivery Guarantees
    ↓
Kafka / RabbitMQ / SQS

AI Prompt

I want to understand message queues deeply.

Explain:

* Why asynchronous communication exists
* Queue vs Stream
* Ordering guarantees
* Consumer groups
* Backpressure
* Retry mechanisms
* Dead-letter queues
* Idempotency

Compare:

* RabbitMQ
* Kafka
* SQS
* Redis Streams

Include real-world examples. 

Example: Databases

Learning Path

Data Management
    ↓
ACID / BASE
    ↓
CAP Theorem
    ↓
Consistency Models
    ↓
Database Types
    ↓
MySQL / PostgreSQL / MongoDB

AI Prompt

I want to understand databases deeply.

Explain:

* ACID
* BASE
* CAP theorem
* Consistency models

Compare:

* Relational databases
* Key-value databases
* Document databases
* Column-family databases
* Graph databases

Include:

* Indexing
* Replication
* Partitioning
* Sharding
* Transactions
* Query optimization

  

Mental Model

Always think in this order:

Problem
    ↓
Theory
    ↓
Patterns
    ↓
Standards
    ↓
Technologies
    ↓
Implementation
    ↓
Operations

Do not start with tools.

Tools change.

Theory lasts.

Claude.ai

Prompts to Learn the Theory Behind Any Technology

Core Prompt Templates

1. The "Mental Model First" Prompt

Before explaining how to use [technology/concept], explain:
- What problem does it solve?
- What is the core theory/principle behind it?
- What are the fundamental building blocks?
- How does the theory map to the implementation?

2. The "Taxonomy" Prompt

Give me a taxonomy of [topic].
- What are the main categories?
- What theory does each category come from?
- When would you choose one over another?
Example: "Give me a taxonomy of authentication methods and the theory behind each"

3. The "Why Does This Exist" Prompt

Explain [technology] from first principles:
- What problem existed before it?
- What theoretical insight solved it?
- How does the implementation reflect that theory?
- What tradeoffs did the design make?

4. The "Layer by Layer" Prompt

Explain [technology] in layers:
- Layer 1: The math/science/theory underneath
- Layer 2: The abstract concept built on that
- Layer 3: The protocol/standard that implements it
- Layer 4: The library/tool I actually use
Example: "Explain JWT in layers from cryptography theory to Express middleware"

5. The "Compare From Theory" Prompt

Compare [A] vs [B] vs [C] starting from theory:
- What shared theory do they come from?
- Where does each one diverge in its approach?
- What does each tradeoff to gain something else?
Example: "Compare symmetric vs asymmetric encryption vs hashing from theory"

Applied to Your Examples

Topic Prompt to Use
Auth Give me a taxonomy of authentication. Start from the theory of identity verification, then map each method (password, API key, JWT, session) to that theory
Encryption Explain encryption from first principles — what is the mathematical problem each type relies on, and how does that lead to symmetric vs asymmetric?
SSO Why does SSO exist? Explain the theory of federated identity, then show how SAML/OAuth/OIDC each implement that theory differently
Databases Explain database indexing in layers — from the data structure theory (B-tree, hash) to how Postgres implements it

Master Prompt (Reusable)

I'm learning [technology/concept]. Don't start with how to use it.
Instead:
1. What is the core theory or problem it's based on?
2. What are the main categories or approaches, and why do they differ?
3. How does the theory translate into the actual implementation?
4. What are common misconceptions people have when they skip the theory?

Then give me a concrete example that connects theory → implementation.
This gives you the why before the how, so implementation always makes sense instead of feeling like memorization.