Blog

Notes on data structures & algorithms, system design, and things I learn along the way.

Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→
October 7, 2026as const vs enum: Modelling Fixed Sets of Values in TypeScript3 min read

TypeScript widens literals by default and enums generate runtime code. How as const preserves exact values, how to derive a union type from one list, and why many teams now prefer const objects over enums.

#TypeScript
October 7, 2026Conditional Types and infer: If/Else for TypeScript Types3 min read

T extends U ? X : Y lets a type make decisions, and infer lets it pull pieces out of other types. How conditional types work, why they distribute over unions, and how ReturnType, Awaited and Exclude are built from them.

#TypeScript
October 7, 2026Prompting, RAG, or Fine-Tuning? Choosing How to Customise an LLM4 min read

Three ways to make a general model work for your problem: change what you ask, change what it can see, or change the model itself. What each one is actually good at, why fine-tuning is the wrong tool for teaching facts, and the order to try them in.

#AI Engineering
October 7, 2026Streaming LLM Responses: Show the First Word in Under a Second3 min read

A long model answer can take many seconds to finish, but the first tokens exist almost immediately. How streaming works over server-sent events, how to relay it from your server to the browser, and the details — stop reasons, cancellation, errors — that make it production-ready.

#AI Engineering
October 7, 2026Structured Outputs: Getting Reliable JSON From an LLM3 min read

“Respond in JSON” works most of the time, which isn't good enough for software. How schema-constrained generation guarantees the shape of a model's output, how to use it with a Zod schema, and what it still can't guarantee.

#AI Engineering
October 7, 2026Temperature and Sampling: Why the Same Prompt Gives Different Answers4 min read

A language model doesn't choose words — it produces probabilities, and then something draws from them. How temperature, top-p and top-k reshape that draw, why randomness is useful, and why you can't always count on turning it off.

#AI Engineering
October 7, 2026Template Literal Types: String Patterns the Compiler Understands3 min read

The same backtick syntax as template strings, but for types. How to generate every valid combination of a class name or event handler, type routes and IDs by their shape, rename keys in mapped types, and parse strings with infer.

#TypeScript
October 7, 2026The satisfies Operator: Check a Type Without Losing It3 min read

A type annotation validates a value and then forgets everything specific about it. satisfies validates the value and keeps the precise type TypeScript inferred. When to use it, and how it compares with annotations and as.

#TypeScript
October 7, 2026unknown vs any vs never: TypeScript's Special Types3 min read

any switches type checking off, unknown accepts anything but makes you check before using it, and never is the type with no values at all. What each one is for, and why unknown should replace almost every any you write.

#TypeScript
October 7, 2026Why LLMs Hallucinate — and How to Reduce It3 min read

A model trained to predict plausible text will produce plausible text, whether or not it's true. Where hallucinations come from, why they sound so confident, and the practical defences: grounding, letting the model abstain, citations, and verification.

#AI Engineering

148 posts · page 4 of 15