Skip to content

Ruby Practice (Basics)

Intuition

Learning through practice: Practice problems are like training drills — they help you apply knowledge and identify areas that need more study.

Why it matters: Regular practice builds confidence and reveals patterns in how concepts are tested. Each problem reinforces key programming concepts.

The key insight: Making mistakes during practice is valuable — each error points to a concept that needs clarification.

Ruby — Interactive Practice

10 auto-graded practice problems covering core Ruby concepts. Select an answer, submit, and review the explanation.


Types and Variables


Blocks and Iterators


OOP and Modules


Control Flow and Exceptions


Metaprogramming

Cross-References

  • Ruby Flashcards: Interactive flashcards covering the same core Ruby concepts.
  • Elixir Basics: Functional programming patterns shared between Ruby and Elixir.

Common Mistakes

Using equal? when you mean ==: equal? checks object identity, not content. Two strings with identical content are different objects. Use == for value comparison.

Confusing super with super(): super passes all arguments to the parent method; super() passes none. Using the wrong one causes unexpected argument forwarding or missing argument errors.

Assuming return exits the block: return inside a block exits the enclosing method, not just the block. Use next to skip an iteration or break to exit the block early.