/learn-rust

Projects to help me learn the Rust programming language

Primary LanguageRustMIT LicenseMIT

Learning Rust through Interview Questions

This reposity is the product of my first in earnest attempt to learn Rust.

I didn't have a particular probem to tackle so I used job interview coding questions that I found on the internet. In particular, "Hacking a Google Interview" contains a lot of interesting questions.

Since this was a learning project, some of the code might not be idiomatic (or even sane). Corrections are welcome and can be sent in the form of pull requests or an email to brian@sweetapp.com.

Understandability

Assuming that you are a programmer unfamiliar with Rust, here is my arrangement of problems in order of increasing difficult to understand algorithms and Rust idioms.

  • printmult - Print the 12x12 multiplication table.
  • fizzbuzz - Count to 100 using the words "Fizz", "Buzz" and "FizzBuzz".
  • oddman - Find the missing integer in a list.
  • substring - Determine if a string is a substring of another.
  • sumfile - Sum the contents of a text file.
  • targetsum - Find pairs in a list that sum to a value.
  • addlist - Increment a number represented as a linked-list.
  • pancake - Sort a list using a function that reverse the list between [0..n].
  • validbtree - Determine if a binary tree is valid.
  • reversewords - Reverse the words in a string.
  • minstack - Implement a stack with O(1) getMinimumValue.
  • bestpath - Return the fastest path through a maze.
  • i18n - Expand patterns like "i18n".