The seven sections
Title
Write a short title that lets anyone — including you six months from now — immediately understand what the note is about. Use noun phrases that name the specific concept, not vague labels.What to write: A phrase that identifies both the topic and the angle. Include the technology name and the specific behavior or decision you are documenting.Examples:
LocalDateTime precision issues and alternativesReliable unlock strategies for distributed locksWhy singleflight prevents cache stampede but needs TTL
Background / Problem
Explain why you are writing this note. Describe the scenario where this problem or concept appeared. This section answers: “Why does this matter, and in what context does it come up?”What to write: One to three sentences describing the real situation that prompted the research. Be specific about the system, the task, and what surprised you or was unclear.Example: During export task processing, you used
LocalDateTime for time comparisons and noticed occasional incorrect orderings in the results. You suspected the issue was related to nanosecond precision, which led you to investigate how LocalDateTime handles time internally.This section is what makes your note useful to others. Without it, the solution has no context.Phenomenon / Case reproduction
Show the problem concretely — with a code snippet, a log excerpt, or a minimal reproduction case. This section answers: “What does the broken or surprising behavior actually look like?”What to write: The smallest possible code or log that demonstrates the issue. Do not explain here — just show.If you cannot reproduce it in a snippet, describe the exact conditions under which you observed the behavior.
Principle analysis
Explain the root cause. This is the most important section. It answers: “Why does this happen?”What to write: The underlying mechanism that causes the behavior. Reference source code, official documentation, or a logical explanation of the system’s internals. Use diagrams or flowcharts when the causation is hard to express in words.Explaining the root cause — not just “here is the fix” — is what separates a note you can reason from from one you just follow blindly. It is also what interviewers probe for when they ask follow-up questions.
Solution comparison
Present the available solutions or alternatives side by side. This section answers: “What are the options, and when should you use each one?”What to write: A table with columns for the approach, its advantages, its disadvantages, and its appropriate use case. Include at least two options so the comparison is meaningful.Presenting trade-offs rather than a single answer reflects how engineering decisions actually work. It also prepares you to answer “why did you choose this approach?” in an interview.
Practical advice
Give concrete, experience-grounded guidance. This section answers: “What should you actually do in practice?”What to write: A short bulleted list of rules of thumb, conventions, or guardrails derived from the principle analysis and solution comparison. These should be specific enough to follow without re-reading the whole note.Example:
- Use a single time type consistently across your service. Do not mix
LocalDateTimeandInstantin the same domain model. - Emit log timestamps in UTC with ISO 8601 format so they are unambiguous across time zones.
References + one-line summary
List your sources, then write one sentence that captures the entire note.References: Link to official documentation, the relevant source code, Stack Overflow threads, or articles. This lets you re-verify the information later and gives readers a way to go deeper.One-line summary: Write a single sentence that acts as a memory anchor — something you could say aloud to a colleague in a hallway conversation to convey the key insight. Frame it as a rule or a finding.Example:
LocalDateTime is not appropriate for high-precision time comparison; use Instant instead.