building a rag chatbot taught me more about data structures than 800 leetcode, unpopular opinion

building a rag chatbot taught me more about data structures than 800 leetcode problems did. unpopular opinion probably.

i'm at 800+ problems on here so i'm not saying this to dunk on leetcode. it genuinely got me through interviews and i don't regret a single hour of it. but something happened while building a rag-based chatbot for a side project that made me realize how differently i think about data structures now compared to when i was just grinding for interviews.

on leetcode, a hashmap is a hashmap. you reach for it when you need o(1) lookup and you move on. clean, isolated, no real consequences if you pick a slightly suboptimal structure since the test cases are small and forgiving.

building this chatbot, i had to actually think about how a vector database stores and retrieves embeddings, and suddenly the abstraction wasn't free anymore. choosing how to chunk documents before embedding them, deciding what metadata to attach to each vector, figuring out the retrieval strategy when similarity search alone wasn't precise enough - none of that has a clean leetcode equivalent. it's data structure thinking, but with fuzzy real world inputs and no single "correct" answer to converge toward.

the part that broke my brain a little was realizing that the same intuition i built solving graph problems - thinking about how nodes relate to each other, how information flows, what needs to be cached versus recomputed - transferred almost directly into thinking about how chunks of a document relate to each other semantically. i wasn't applying a leetcode algorithm. i was applying the underlying way of thinking that leetcode trained into me, just in a domain leetcode never tests directly.

so i guess my actual point is this - leetcode trains pattern recognition and structured thinking, not memorized solutions for real systems. anyone telling you it's "useless for real engineering" is partially right in a narrow sense and completely wrong in the broader one. the algorithms rarely show up verbatim. the way of breaking a fuzzy problem into structured pieces shows up constantly.

genuinely curious if anyone else working with llm/agent systems has felt this same weird translation happening. does dsa intuition transfer for you too, or am i just rationalizing all the hours i put into this site.

Comments (1)