I Opened My First Coding Problem and Wrote Nothing for Thirty Minutes

In July I sat down with my first problem on a practice site, read it twice, and then produced nothing for half an hour. I want to be precise about what went wrong, because it wasn’t syntax. I could write clean Python and my programming marks were good. The trouble was that I had no idea how to begin a problem I had never seen before. Every exam I’d ever passed had asked me to reproduce a solution I’d already been shown. This was asking me to construct one from nothing, and it turned out those are two different skills. I had exactly one of them.

Why memorising failed

For the first few weeks I did what had always worked: I memorised. Definitions, operations, the complexity table, all of it. It was useless. I could recite that a hash map gives constant-time lookup and still stare blankly at a problem that obviously needed one, because knowing what a tool does tells you nothing about when to reach for it.

What finally unstuck me was flipping the question around. Instead of learning each data structure as a definition, I started treating it as the answer to a question the problem was asking. Does the problem need to remember whether it has seen something before, instantly? That’s a hash set. Does it keep asking “what’s the smallest thing right now?” That’s a heap. Is it secretly about relationships between things rather than the things themselves? Then it’s a graph, whatever it says on the surface. Once each structure was an answer rather than a fact, choosing between them stopped being recall and turned into reasoning. That small reframe did more for me than a month of flashcards.

Big-O landed the same week, and not from a lecture. I checked a list for duplicates with two nested loops, ran it on a few hundred thousand items, and watched my laptop simply give up. Rewriting it with a set made the same answer appear instantly.

python

seen = set()
for n in nums: # one pass instead of n² comparisons
if n in seen:
return True
seen.add(n)

You can read about quadratic time for a semester. Watching your own machine refuse to finish teaches it in an afternoon.

Patterns, not problems

The real jump in my solve rate came from noticing that problems repeat themselves in disguise. A handful of shapes, perhaps ten, cover a surprising share of everything: two pointers, sliding windows, binary search on the answer, prefix sums, memoised recursion, breadth-first and depth-first search. My process changed from “read the problem and start typing” to “read the problem and ask which pattern it’s dressed up as.” The first approach produced a lot of confident wrong code. The second produced correct code more often than I expected, and eventually more often than not.

What DSA gave me, and what it didn’t

The internet is loudly divided on whether DSA matters, and having spent a summer on it I think both sides are half right. It gave me decomposition, the habit of breaking a vague problem into pieces small enough to solve. It gave me a reflex for thinking about cost before writing code. Most of all it gave me something exams never did: tolerance for being stuck. No exam had ever asked me to stay confused for more than twenty minutes. A hard problem asks for two hours, and sitting through that without quitting is a muscle I simply didn’t have before.

What it did not give me is any ability to build a system. These problems arrive perfectly specified, with clean input, one correct answer, and no users. Everything I’ve read about real engineering describes the opposite on every axis: vague requirements, hostile input, several acceptable answers, and eventually a stranger typing something you never imagined into a field you forgot to validate. I already know people in my year who have solved hundreds of problems and still freeze when asked to structure a small project. So I’m treating DSA as a habit to maintain rather than a phase to finish: a problem or two most days, indefinitely, while the real hours go somewhere else.

A way of studying I’m keeping

The most useful thing I built this summer wasn’t a solution. It was a study system that runs on producing rather than consuming. I implement things before I import them; I wrote my own hash map in August, and it’s worse than Python’s in every measurable way, which is exactly why I now understand Python’s. I don’t let myself claim to know a concept until I can write a clear paragraph explaining it, because recognising something feels identical to knowing it right up until someone tests you. I revisit topics across weeks instead of cramming them, since everything I’ve ever crammed was gone within a month. And I’ve kept the paper-a-week rule for about ten weeks now. I understand very little of what I read, but the vocabulary has started repeating, and I’m told that’s how this begins.

Which leaves me with a method and no destination. I’m getting better at problems other people specify, but I still haven’t answered what I actually want to build. The only answer I have is the same one as in July: a machine that talks back. So this semester I’m building a chatbot from scratch, badly, to find out what I don’t know. And I can already feel the next question coming. If I build something that seems to work, how will I know whether it actually does? Right now my answer is “I’ll try it and see,” and I have a feeling that won’t survive contact with reality.

Leave a Reply