42  Course Wrap-Up and What’s Next

43 Course Wrap-Up and What’s Next

Week 10, Session 2. CSS 343.

43.1 Twenty weeks of computer science

If you went through both 342 and 343, here is what you can now do that you could not do twenty weeks ago.

Build it from scratch: a vector, linked list, BST, AVL tree, heap, hash table, graph. All from raw pointers and template machinery.

Reason about cost: state the time and space complexity of any algorithm you have seen, derive recurrences, apply Master Theorem.

Design algorithms: identify whether a problem fits divide-and-conquer, greedy, DP, or simple search; write the solution from a recurrence; space-optimize when possible.

Structure programs: split classes across files, apply the Rule of Three, use templates for genericity, identify the right design pattern, use smart pointers for resource management.

Think about limits: classify problems as P, NP, NP-complete; recognize an undecidable problem.

This is the toolkit of a working software engineer. From here you do not learn fundamentally new ideas — you apply these to bigger problems.

43.2 The full container selection cheat sheet

Combine 342 chapter 20’s table with what you can build:

Need STL What’s underneath
Sequence vector<T> Dynamic array (chapter 2)
Unique elements, sorted set<T> Red-black tree (chapter 29)
Unique elements, fast unordered_set<T> Hash table (chapter 28)
Key→value, sorted map<K, V> Red-black tree
Key→value, fast unordered_map<K, V> Hash table
LIFO stack<T> Adapter (chapter 35) over deque
FIFO queue<T> Adapter over deque
Max/min priority_queue<T> Heap (chapter 25)
Doubly linked list<T> Linked list (chapter 16)

You have implemented every one of these structures yourself. When the STL hides them, you know what it is hiding.

43.3 A LeetCode roadmap

By the end of 343 you should be able to handle most LeetCode mediums and many hards. The patterns and where they live:

Pattern Chapter Sample problem
Two pointers 7 (warmup), 16 Reverse String, Palindrome Linked List
Sliding window future Longest Substring Without Repeating
Tree DFS 17 Maximum Depth
Tree BFS 22 Level Order Traversal
Graph DFS/BFS 26 Number of Islands
Dijkstra 27 Network Delay
Binary search variants 8, 31 Search in Rotated Sorted Array
Heap (top K) 25 Kth Largest
Hash map (frequency) 28 Two Sum, Group Anagrams
Backtracking 18 Subsets, N-Queens
Greedy 32 Jump Game
DP (1D / 2D) 33, 34 Coin Change, LCS
Union-Find 27 Number of Connected Components
Topological sort 27 Course Schedule

For interview prep: pick one pattern per week. Solve 5-10 problems in that pattern. Move to the next. Twelve weeks gives you broad coverage.

43.4 What 343 did not cover (and where to learn it)

  • Move semantics, the Rule of Five: Scott Meyers, Effective Modern C++.
  • Concurrency: CSS 430 (Operating Systems) is the next door. C++ Concurrency in Action by Williams.
  • Advanced algorithms: network flow, suffix arrays, segment trees, FFT. Coursera Stanford algorithms specialization. Skiena’s Algorithm Design Manual.
  • Computational complexity: CSS 432 (Theory of Computation) goes deeper. Introduction to the Theory of Computation by Sipser.
  • Machine learning: CSS 459. The DP you learned here is the same DP behind sequence alignment, Viterbi decoding, and beam search.
  • Distributed systems: 460-level / graduate. Designing Data-Intensive Applications by Kleppmann.

43.5 A few principles I want you to leave with

Code first. When you do not understand something, write the code. Reading explanations only takes you so far. Compiling the code, running it, watching it fail, debugging, then watching it work — that is when the synapse forms.

Debug with intent. Random changes are not debugging. Print statements at chosen points are debugging. Read the failure carefully. Form a hypothesis. Test the hypothesis. This is the scientific method applied to your own code.

Match the data structure to the problem. Most slow programs are slow because the wrong container was picked. Most clean programs are clean because the right one was picked. The cheat sheet above is your shortcut.

Read the standard library source. When you wonder how unordered_map actually works, open the file. The STL is the most carefully written C++ in existence. Reading it teaches you idioms you cannot pick up any other way.

Have someone review your code. Discord is full of senior students. Office hours exist for this. Get a second pair of eyes on every assignment.

43.6 Thank you

I have taught 342 and 343 dozens of times. Every quarter the students teach me something new — a clever trick, a way to explain something, a gap in my materials. This book is the accumulated result.

If you found a bug here, please open an issue. If you have a better explanation, please send a PR. The version of this book your future classmates read should be better than the one you read. That is how teaching works.

Good luck with the final. And for what it is worth: I am proud of how far you have come.

— Yusuf Woodinville, WA

Now go build something. The world has too few engineers and too many CRUD apps. Pick a problem you actually care about and write the program. The chapters above will not teach you the discipline — they will give you the toolkit. The discipline is yours to build, one project at a time.

You are here Coming up
End of CSS 343 Appendices (C++ refresher, LeetCode index, toolchain, glossary)