Quiz: Ruby Internals & Object Model
Test your understanding of Ruby's object model, method lookup chain, eigenclasses, garbage collection, and open classes. This comprehensive quiz covers advanced Ruby internals concepts.
Quiz Instructions
How to Take This Quiz
- Read each question carefully - questions cover object model, method lookup, garbage collection, and open classes
- Think about Ruby's internals - consider how Ruby manages objects, memory, and method resolution
- Use the interactive code runner - test your understanding with real Ruby code
- Take your time - these are advanced concepts that require deep understanding
1
Question 1: Everything is an Object
In Ruby, "everything is an object." Which of the following statements about Ruby's object model are true? (Select all that apply)
💡 Hint: Try using .class, .methods, and .method(:name) to explore Ruby's object model.
2
Question 2: Method Lookup Chain
Given this Ruby code, what will be the method lookup chain when calling obj.greet?
💡 Hint: Use Child.ancestors to see the actual method lookup chain. Remember that included modules are inserted above the class that includes them.
3
Question 3: Eigenclasses & Singleton Methods
What happens when you define a singleton method on a specific object instance?
💡 Hint: Test with str1.singleton_class and str2.respond_to?(:shout) to understand singleton methods.