Menu
Coddy logo textTech
Learning path

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

DSA in Go, step by step

38 courses377 lessons228 challenges702 quiz questions

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.

  1. 1
    Start this stepStartStack, queue, binary tree, hash table and linked list, each built from scratch in Go and then used to solve problems. After it, a slice used as a stack and a map used as a set are choices you can defend, and the queue type Go does not have is one you have written.Start
  2. 2
    Start this stepStartDoubly linked list, heaps and priority queues, tries, graphs and the self-balancing AVL tree. container/list is the first of them, ready-made; after this step the five methods of heap.Interface make sense, because you have built a heap yourself, and the balanced tree Go never shipped is one you can build.Start
  3. 3
    Start this stepStartBubble, selection, insertion, merge, quick, heap, counting and radix sort, written in Go and watched in the visualizer. sort.Slice has used pattern-defeating quicksort since Go 1.19, slices.Sort uses it too, and neither is stable, which is why sort.SliceStable exists; after this step you know what each of those words means.Start
  4. 4
    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
  5. 5
    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 is container/heap over a slice of your own type: the heap from step two, behind an interface.Start
  6. 6
What you get
Everything you'll use to learn to code

Learn by Doing

Write real code, query databases, build websites, and master AI prompts. Our interactive lessons cover every skill modern developers need.

playground.js
Code Editor
1const greeting = "Hello, Coddy!"
2function sayHi(name) {
3    return greeting + " " + name
4}
5
bottombar Collapse icon
Test #1test Case Success icon
Test #2test Case Success icon
Test #3test Case Failure icon
Input
"Alex"
Output
"Hello, Coddy! Alex"

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!

fire Filled icon
left icon

January 2026

right icon

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

product Double Or Nothing icon

Double or Nothing

Day 5 of 7

fire Freeze icon

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.

Python
7Streak
250Score
5Energy
Variables
journey Hex Done Base iconjourney Hex Done Shadow iconjourney Hex Done Top iconjourney Lesson Done icon
journey Path Right Done icon
journey Hex Done Base iconjourney Hex Done Shadow iconjourney Hex Done Top iconjourney Lesson Done icon
journey Path Left Done icon
journey Hex Active Base iconjourney Hex Active Shadow iconjourney Hex Active Top iconjourney Lesson Theory Challenge icon
CONTINUE
journey Path Right icon
journey Hex Locked Base iconjourney Hex Locked Shadow iconjourney Hex Locked Top iconjourney Lesson Theory Challenge icon
journey Path Left icon
journey Hex Locked Base iconjourney Hex Locked Shadow iconjourney Hex Locked Top iconjourney Lesson All icon
Journey
Goals
Leaderboard
Profile
4.9
StarStarStarStarStar
Rating

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!

Challenger League
Challenger LeagueTop 7 advance
leaderboard First icon1
avatar 1 icon
fire Filled icon
Alex7+ Days
2840
leaderboard Second icon2
avatar 2 icon
fire Filled icon
Jordan7+ Days
2650
leaderboard Third icon3
avatar 3 icon
fire Filled icon
Sam7+ Days
2420
4
avatar 4 icon
Casey
2180
5
avatar placeholder icon
fire Filled icon
Morgan7+ Days
1950
leaderboard Arrow Up iconPromotion zoneleaderboard Arrow Up icon

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.

Intro to Variables
Audio

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.

1xSarah

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.

CoddyCertificate of Completion
This certifies thatJohn Doehas successfully completed
python iconPython Fundamentals
Verified
DateJan 2026
LinkedInAdd to LinkedIn

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 append to and reslice, a set is a map[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 struct with 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 no malloc or free to 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?

Yes. It compiles to fast native code, its syntax is small enough that the algorithm is most of what you read, and generics (since Go 1.18) make a typed stack or heap reusable. The trade-off is a lean standard library: beyond slices, maps, 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?

A slice is a dynamic array, and with 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?

You implement 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?

Because Go randomizes map iteration order on purpose, so that no program comes to depend on it. A hash table has no meaningful order in any language; Go just makes sure you notice. When order matters, as in output a test compares, collect the keys into a slice and sort it, or keep a slice beside the map.

Which courses on this path are not taught in Go?

Three: dynamic programming and the Python interview series, taught in Python, and bit manipulation, taught in C++. They are listed after the steps, each with a link that opens it in its own language. A memo table in Go is a slice or a map, and Go adds one bit operator C++ lacks: &^, AND NOT, which clears in its left operand every bit set in its right.

Do I need to know Go before starting this path?

Structs, pointers, slices, maps and methods, at least; generics help, and you can pick them up on the way. If those are new, Coddy's Go course takes you there first, free, and this path picks up where it ends.

Other learning paths

The same courses, arranged for a different role. Progress carries over: a course finished on one path counts on every path that includes it.

All learning paths
Coddy programming languages illustration

Start the Data Structures & Algorithms path for free

Start learning