DEV Community

Divyansh pratap singh
Divyansh pratap singh

Posted on

How to make coding skelton

The Universal Skeleton Framework (USF)

Whenever you learn ANYTHING:

Technology

↓

Answer 12 Questions

↓

Skeleton

↓

Code
Enter fullscreen mode Exit fullscreen mode

I call it PIPES-FLOW.


P — Problem

Why does this exist?

Without this question, you'll memorize forever.

Example

JWT

Problem

↓

HTTP is stateless.

↓

Need identity between requests.
Enter fullscreen mode Exit fullscreen mode

Docker

Problem

↓

"It works on my machine."

↓

Need same environment.
Enter fullscreen mode Exit fullscreen mode

Binary Search

Problem

↓

Searching one by one is slow.
Enter fullscreen mode Exit fullscreen mode

I — Input

What comes into the system?

Examples

JWT

Username

Password
Enter fullscreen mode Exit fullscreen mode

Binary Tree

Root Node
Enter fullscreen mode Exit fullscreen mode

TCP

Packets
Enter fullscreen mode Exit fullscreen mode

Compiler

Source Code
Enter fullscreen mode Exit fullscreen mode

P — Processing

What transformations happen?

JWT

Verify password

↓

Generate token

↓

Sign token
Enter fullscreen mode Exit fullscreen mode

Compiler

Lexing

↓

Parsing

↓

AST

↓

Optimization

↓

Assembly
Enter fullscreen mode Exit fullscreen mode

E — Entities

Who participates?

Authorization

User

Server

Database

JWT

Middleware
Enter fullscreen mode Exit fullscreen mode

TCP

Client

Router

Server
Enter fullscreen mode Exit fullscreen mode

React

State

Component

Virtual DOM

Real DOM
Enter fullscreen mode Exit fullscreen mode

S — States

How does data change?

Git

Working

↓

Staging

↓

Commit

↓

Remote
Enter fullscreen mode Exit fullscreen mode

Request

Unauthenticated

↓

Authenticated

↓

Authorized

↓

Response
Enter fullscreen mode Exit fullscreen mode

F — Flow

The entire process.

One diagram.

Login

↓

Verify Password

↓

Generate JWT

↓

Client Stores JWT

↓

Future Request

↓

Verify JWT

↓

User Available
Enter fullscreen mode Exit fullscreen mode

L — Language

Only now think about code.

jwt.sign()

jwt.verify()
Enter fullscreen mode Exit fullscreen mode

O — Output

What does the system produce?

Compiler

Executable
Enter fullscreen mode Exit fullscreen mode

JWT

Authenticated User
Enter fullscreen mode Exit fullscreen mode

Binary Search

Index
Enter fullscreen mode Exit fullscreen mode

W — Weakness

Every system has tradeoffs.

JWT

Can't revoke easily
Enter fullscreen mode Exit fullscreen mode

Redis

RAM expensive
Enter fullscreen mode Exit fullscreen mode

Binary Search

Requires sorted array
Enter fullscreen mode Exit fullscreen mode

My Favorite Compression Trick

Every technology can fit on ONE PAGE.

Like this.

Docker

Problem

↓

Different environments

-------------------

Input

App

-------------------

Entities

Developer

Image

Container

Host

-------------------

Flow

Dockerfile

↓

Build Image

↓

Run Container

↓

Execute

-------------------

Output

Running App

-------------------

Weakness

Large Images
Enter fullscreen mode Exit fullscreen mode

Notice

You didn't memorize Docker.

You compressed Docker.


Second Framework

I use this for EVERYTHING.

I call it

LEGO Method

Every system has only 7 blocks.

WHO

↓

WHAT

↓

WHY

↓

WHEN

↓

WHERE

↓

HOW

↓

FAILURE
Enter fullscreen mode Exit fullscreen mode

JWT

WHO

Client

Server
Enter fullscreen mode Exit fullscreen mode

WHAT

Identity
Enter fullscreen mode Exit fullscreen mode

WHY

Stateless Authentication
Enter fullscreen mode Exit fullscreen mode

WHEN

Every Request
Enter fullscreen mode Exit fullscreen mode

WHERE

Authorization Header
Enter fullscreen mode Exit fullscreen mode

HOW

JWT Signature
Enter fullscreen mode Exit fullscreen mode

FAILURE

Expired Token
Enter fullscreen mode Exit fullscreen mode

Done.


Third Framework

For code.

Every algorithm has only six questions.

Input?

↓

Output?

↓

Base Case?

↓

State?

↓

Transition?

↓

Return?
Enter fullscreen mode Exit fullscreen mode

Recursion

Input

Node

↓

Output

Height

↓

Base

NULL

↓

State

Left Right

↓

Transition

1+max()

↓

Return

Height
Enter fullscreen mode Exit fullscreen mode

Now every recursive problem looks similar.


Fourth Framework

For System Design.

Client

↓

Gateway

↓

Service

↓

Database

↓

Cache

↓

Queue

↓

Storage
Enter fullscreen mode Exit fullscreen mode

Almost every interview architecture is a variation of this.


Fifth Framework

For DSA.

Instead of remembering 450 questions.

Remember only 18 skeletons.

Sliding Window

↓

Two Pointer

↓

DFS

↓

BFS

↓

Binary Search

↓

Backtracking

↓

Merge Sort

↓

Heap

↓

Trie

↓

Union Find

↓

Topological Sort

↓

DP

↓

Greedy

↓

Monotonic Stack

↓

Prefix Sum

↓

Bit Manipulation

↓

Graph Traversal

↓

Intervals
Enter fullscreen mode Exit fullscreen mode

Everything is built from these.


Sixth Framework

For Debugging.

Problem

↓

Evidence

↓

Hypothesis

↓

Experiment

↓

Observation

↓

Update Mental Model

↓

Repeat
Enter fullscreen mode Exit fullscreen mode

This is literally how senior engineers debug.


The Biggest Secret

This is something I wish someone had taught me earlier.

Everything in Computer Science is either a Flow, a State Machine, a Tree, a Graph, or a Transformation Pipeline.

That's it.

Examples:

Git
↓

State Machine

--------------------

JWT
↓

Pipeline

--------------------

Compiler
↓

Pipeline

--------------------

TCP
↓

State Machine

--------------------

React
↓

Flow

--------------------

Recursion
↓

Tree

--------------------

Filesystem
↓

Tree

--------------------

Network
↓

Graph

--------------------

Docker
↓

Pipeline
Enter fullscreen mode Exit fullscreen mode

Once you recognize which "shape" a concept has, building the mental model becomes much easier.


The Cheat Sheet I'd Print and Keep Beside My Monitor

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

UNIVERSAL MENTAL MODEL BUILDER

1. Problem
   Why does this exist?

2. Input
   What enters?

3. Output
   What leaves?

4. Entities
   Who participates?

5. State
   How does data change?

6. Flow
   Draw arrows only.

7. Decisions
   Where are the if/else points?

8. Implementation
   Translate to code.

9. Complexity
   Time / Space / Cost

10. Failure
    What can go wrong?

11. Trade-offs
    What do we gain and lose?

12. Real-world Analogy
    What everyday system is this like?

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Enter fullscreen mode Exit fullscreen mode

One addition specifically for you

"Can I draw this in under 60 seconds?"

If you can't explain a concept with a simple diagram of boxes and arrows in one minute, you probably understand the details more than the underlying model. That's the habit I'd build over the next few months, because it transfers across DSA, system design, Linux, networking, cybersecurity, and backend engineering. It turns new topics into variations of patterns you've already learned.

Top comments (0)