Data Structures and Algorithms in Go
Go gives you slices and maps and leaves the rest to you: no stack, queue or set type, and a heap in container/heap that does nothing until you implement heap.Interface. This path has you build every structure in Go with structs and pointers, then sort, recurse and search graphs with them, and finish on graded interview problems. Free, in your browser, with a certificate on most courses.
377 lessons228 challenges702 quiz questions
- Beginner friendly
AI-assisted coding help
Hands-on interactive lessons
Audio narration on every lesson
Quizzes to test your knowledge
23 free certificates along the path
DSA in Go, step by step
Each step is a set of existing Coddy courses, and every Start button opens them in Go. The three courses not taught in Go yet are listed after the steps.
- 1Step 15 courses, in order
- 2Step 2
Data Structures Series, part two
Start this stepStartDoubly linked list, heaps and priority queues, tries, graphs and the self-balancing AVL tree.container/listis the first of them, ready-made; after this step the five methods ofheap.Interfacemake sense, because you have built a heap yourself, and the balanced tree Go never shipped is one you can build.Start5 courses, in order- Doubly Linked List - Data Structures Series #614 lessons6 challenges
- Heaps & Priority Queues - Data Structures Series #714 lessons6 challenges
- Tries - Data Structures Series #814 lessons12 challenges
- Graphs - Data Structures Series #914 lessons12 challenges
- AVL Tree - Data Structures Series #1016 lessons6 challenges
- 3Step 3
Sorting algorithms
Start this stepStartBubble, selection, insertion, merge, quick, heap, counting and radix sort, written in Go and watched in the visualizer.sort.Slicehas used pattern-defeating quicksort since Go 1.19,slices.Sortuses it too, and neither is stable, which is whysort.SliceStableexists; after this step you know what each of those words means.Start8 courses, in order- Bubble Sort11 lessons10 challenges
- Selection Sort - DSA Series9 lessons3 challenges54 questions
- Insertion Sort - DSA Series9 lessons3 challenges
- Merge Sort - DSA Series9 lessons3 challenges52 questions
- Quick Sort - DSA Series9 lessons3 challenges52 questions
- Heap Sort - DSA Series9 lessons3 challenges54 questions
- Counting Sort - DSA Series9 lessons3 challenges52 questions
- Radix Sort - DSA Series9 lessons3 challenges55 questions
- 4Step 4
Recursive thinkingDedicated page
Start this stepStartRecursion challenges in Go, where goroutine stacks start small and grow on demand, so a recursion thousands of calls deep rarely overflows. A missing base case still hits the ceiling, 1 GB of stack on 64-bit systems by default, and ends in a fatal error rather than a slow program. Dynamic programming and bit manipulation are listed after the steps, since they are taught in Python and C++.StartDedicated page - 5Step 5
Graph algorithms
Start this stepStartBreadth-first and depth-first search, Dijkstra, Bellman-Ford, topological sort, Kruskal and Prim in Go, on the graph you built in step two. Dijkstra's priority queue in Go iscontainer/heapover a slice of your own type: the heap from step two, behind an interface.Start7 courses, in order- Breadth-First Search - Graph Algorithms9 lessons3 challenges54 questions
- Depth-First Search - Graph Algorithms9 lessons3 challenges54 questions
- Dijkstra's Algorithm - Graph Algorithms9 lessons3 challenges54 questions
- Bellman-Ford Algorithm - Graph Algorithms9 lessons3 challenges54 questions
- Topological Sort - Graph Algorithms9 lessons3 challenges55 questions
- Kruskal's Algorithm - Graph Algorithms9 lessons3 challenges57 questions
- Prim's Algorithm - Graph Algorithms9 lessons3 challenges55 questions
- 6Step 6
Interview practice
Start this stepStartTen interview challenge packs and two coding-problem banks in Go, graded by test cases: unfamiliar problems, solved without a tutorial, with slices, maps and the structures you built on the way.Start12 courses, in order- Interview Coding Challenges - Pack I3 lessons3 challenges
- Interview Coding Challenges - Pack II3 lessons3 challenges
- Interview Coding Challenges - Pack III3 lessons3 challenges
- Interview Coding Challenges - Pack IV3 lessons3 challenges
- Interview Coding Challenges - Pack V3 lessons3 challenges
- Interview Coding Challenges - Pack VI3 lessons3 challenges
- Interview Coding Challenges - Pack VII3 lessons3 challenges
- Interview Coding Challenges - Pack VIII3 lessons3 challenges
- Interview Coding Challenges - Pack IX3 lessons3 challenges
- Interview Coding Challenges - X3 lessons3 challenges
- Coding Problems32 lessons31 challenges
- Coding Problems: Volume 225 lessons24 challenges
Learn by Doing
Write real code, query databases, build websites, and master AI prompts. Our interactive lessons cover every skill modern developers need.
Build Your Coding Streak
Stay consistent and watch your progress grow! Track your daily coding habit, protect your streak with freeze days, and earn rewards for showing up every day.
12 days streak
Return tomorrow to keep your streak!
January 2026
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
21
22
23
24
25
26
27
28
29
30
Double or Nothing
Day 5 of 7
Streak Freeze
2 left
Code Anywhere, Anytime
Take your coding journey on the go! No setup, no downloads - just open and start coding. Available on iOS, Android and Web with 4.9 star ratings.
You're Not Alone in This
Compete on global leaderboards, invite friends to earn rewards, and celebrate each other's wins. Coding is better with friends!
Every way to learn
Read, listen, test yourself, ask the AI, or look up anything you've already covered. Every lesson meets you where you are.
A variable is a named container that stores a value you can reference later in your program.
In Python, you create one by writing the name, an equals sign, then the value you want to store.
The value can change over time - reassigning the name simply points it to a new value.
Prove Your Skills
Earn certificates for every course you complete. Add them to your LinkedIn profile and resume to showcase your coding expertise to employers.
Why learn DSA in Go on Coddy
- The structures Go leaves to you. Go builds in slices and maps and stops there: a stack is a slice you
appendto and reslice, a set is amap[T]struct{}, and there is no queue type or tree at all. Knowing how to write the missing ones, and what each slice operation costs, is part of knowing Go. - Structs and pointers, nothing hidden. Go has no classes: a node is a
structwith a pointer to the next one, and methods hang off the type. A linked list or a tree looks like exactly what it is, generics (since Go 1.18) make it reusable for any element type, and the garbage collector means there is nomallocorfreeto manage. - Nearly the whole path in Go. Every data structure, sort, graph algorithm, recursion challenge and interview pack is taught in Go. Three are taught elsewhere and listed after the steps with a link to each: dynamic programming and the Python interview series in Python, and bit manipulation in C++. Bit manipulation reads naturally from Go, which has C++'s
&,|,^,<<and>>and writes NOT as^x. - Graded like an interview. Every lesson ends in a Go challenge checked by test cases, and when one fails, Bugsy reads your code and nudges you toward the fix without handing over the answer. A free certificate on most courses, each verifiable at its own URL.
Frequently asked questions about DSA in Go
Is Go good for data structures and algorithms?
container/list and container/heap, you write the structures yourself, which on a learning path is the point. Go also runs much of today's cloud infrastructure, Docker and Kubernetes included, which makes it a natural interview language for backend roles.Which Go types and packages match which data structures?
append and reslicing it is also your stack; a map is a hash table, and map[T]struct{} is the idiomatic set; container/list is a doubly linked list; and container/heap runs a binary heap over any type that implements heap.Interface. There is no queue type, tree, trie or graph, so those you build yourself, in steps one and two.How does container/heap work in Go?
container/heap work in Go?heap.Interface on a slice type of your own: Len, Less and Swap from sort.Interface, plus Push and Pop, which only append to and remove from the end of the slice. Then you call the package functions heap.Push and heap.Pop, never your own methods, and they do the sifting up and down that keeps the order. It reads oddly until you have written a heap yourself, which step two has you do.Why does ranging over a Go map give a different order every time?
Which courses on this path are not taught in Go?
&^, AND NOT, which clears in its left operand every bit set in its right.