All questions
Showing of 85What is the difference between nil, empty, and blank in Ruby?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- nil: Represents "nothing" or "no value". Only
nilobject responds true to.nil? - empty: A method that returns true for collections with no elements (arrays, hashes, strings)
- blank: Rails addition that returns true for nil, empty collections, and whitespace-only strings
nil.nil? # true
"".empty? # true
[].empty? # true
" ".blank? # true (Rails only)
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain the difference between single quotes and double quotes in Ruby strings.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Double quotes allow string interpolation and escape sequences, while single quotes treat most characters literally (except for \' and \\).
name = "Alice"
puts "Hello #{name}" # "Hello Alice"
puts 'Hello #{name}' # "Hello #{name}"
puts "Line\nBreak" # Line with actual break
puts 'Line\nBreak' # "Line\nBreak" literally
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are symbols in Ruby and when should you use them?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Symbols are immutable, reusable constants represented internally by an integer value. They're often used as hash keys, method names, or status identifiers because they're memory-efficient - the same symbol always references the same object in memory.
:status.object_id == :status.object_id # true
"status".object_id == "status".object_id # false
# Common usage
user = { name: "John", age: 30 } # symbols as hash keys
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between puts, print, and p in Ruby?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- puts: Outputs value with newline, returns nil, calls
.to_s - print: Outputs value without newline, returns nil, calls
.to_s - p: Outputs inspected value with newline, returns the value, calls
.inspect
puts "Hello" # Hello\n (returns nil)
print "Hello" # Hello (returns nil)
p "Hello" # "Hello"\n (returns "Hello")
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are the three levels of access control for methods in Ruby?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- public: Can be called from anywhere (default)
- protected: Can be called by instances of the same class or subclasses
- private: Can only be called within the same instance (no explicit receiver)
class MyClass
def public_method; end
protected
def protected_method; end
private
def private_method; end
end
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the difference between Array#map and Array#each?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- each: Iterates through elements, returns original array, used for side effects
- map: Transforms elements, returns new array with transformed values
numbers = [1, 2, 3]
numbers.each { |n| n * 2 } # Returns [1, 2, 3]
numbers.map { |n| n * 2 } # Returns [2, 4, 6]
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain the difference between Hash#merge and Hash#merge!
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- merge: Returns a new hash with combined key-value pairs
- merge!: Modifies the original hash in place (destructive)
h1 = { a: 1, b: 2 }
h2 = { b: 3, c: 4 }
h1.merge(h2) # Returns { a: 1, b: 3, c: 4 }, h1 unchanged
h1.merge!(h2) # h1 is now { a: 1, b: 3, c: 4 }
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain the difference between Array#flatten and Array#compact.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- flatten: Removes nested array structure, creating a single-level array
- compact: Removes nil values from array
[[1, 2], [3, [4]]].flatten # [1, 2, 3, 4]
[1, nil, 2, nil, 3].compact # [1, 2, 3]
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Explain the Rails MVC architecture.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
MVC separates application into three components:
- Model: Handles data and business logic (ActiveRecord)
- View: Presents data to users (ERB templates)
- Controller: Coordinates between Model and View, handles requests
The flow: Request → Router → Controller → Model → Controller → View → Response
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What are Ruby's naming conventions?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- Classes/Modules: CamelCase (UserAccount)
- Methods/Variables: snake_case (user_name)
- Constants: SCREAMING_SNAKE_CASE (MAX_USERS)
- Predicates: end with ? (empty?)
- Dangerous methods: end with ! (save!)
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the purpose of Gemfile and Gemfile.lock?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
- Gemfile: Specifies gem dependencies and sources
- Gemfile.lock: Locks specific versions for consistent environments
Both ensure all developers and deployment environments use identical gem versions.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the safe navigation operator (&.) and when should you use it?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
The safe navigation operator (&.) calls methods only if the receiver is not nil, preventing NoMethodError on nil objects.
user&.profile&.name # Returns nil if any part is nil
# Equivalent to:
user && user.profile && user.profile.name
# With arrays
users&.first&.name # Safe even if users is nil
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is the rightward assignment operator in Ruby 3?
Explain the difference between == and === in Ruby.
What is the difference between a class and a module in Ruby?
Explain the concept of Duck Typing in Ruby.
What is the difference between instance variables and class variables?
Explain method visibility inheritance in Ruby.
What is the purpose of super keyword in Ruby?
What is method aliasing and when would you use it?
What is the difference between Array#select, Array#reject, and Array#partition?
How does the Enumerable module work in Ruby?
What is the spaceship operator (<=>) and how is it used?
What is the difference between yield and block.call?
Explain the & operator in method parameters.
What is method chaining and how do you implement it?
What are keyword arguments and how do they differ from positional arguments?
What is the splat operator (*) and double splat (**)?
What is the difference between include, prepend, and extend?
What is the purpose of module_function?
How do you handle module name conflicts?
What is the difference between raise and throw in Ruby?
Explain the structure of begin-rescue-else-ensure-end.
How do you create custom exception classes?
What is the difference between File.open and File.new?
How do you handle file operations safely in Ruby?
What is the difference between require and load?
Explain the difference between system, exec, and backticks for running shell commands.
What is the difference between stub and mock in testing?
What is the purpose of fixtures and factories in testing?
What debugging techniques are available in Ruby?
What is the difference between render and redirect_to in Rails?
What are Rails callbacks and when should you use them?
What is the N+1 query problem and how do you solve it?
What is the difference between concerns and services in Rails?
Explain strong parameters in Rails.
What is the difference between has_many :through and has_and_belongs_to_many?
Explain database transactions in Rails.
What are scopes in ActiveRecord and how do they differ from class methods?
Explain the difference between delete and destroy in ActiveRecord.
What is the difference between lazy and eager evaluation?
How do you securely handle sensitive data in Ruby?
What is the Singleton pattern and how is it implemented in Ruby?
What is the difference between composition and inheritance?
What is the Law of Demeter and how does it apply to Ruby?
What is the difference between fail-fast and fail-safe approaches?
What is pattern matching in Ruby and how does it work?
What are endless method definitions in Ruby 3?
What are numbered block parameters?
Explain keyword argument separation in Ruby 3.0
What is the ... (three dots) operator for argument forwarding?
What is the difference between then, yield_self, and tap?
What is the difference between a block, proc, and lambda?
Explain the Ruby method lookup chain.
What is the difference between rescue StandardError and rescue Exception?
What is the purpose of Rails middleware?
What is optimistic locking in Rails?
What are the common performance optimization techniques in Ruby?
How do you profile Ruby code performance?
What is memory leak in Ruby and how do you prevent it?
What is metaprogramming in Ruby?
Explain method_missing and how to use it safely.
What is the difference between class_eval and instance_eval?
What are singleton methods and singleton classes?
What is the Global Interpreter Lock (GIL) in Ruby?
What is the difference between Thread and Fiber in Ruby?
How do you handle thread safety in Ruby?
What are common security vulnerabilities in Ruby applications?
Explain the SOLID principles in context of Ruby.
What is Rack and why is it important?
Explain the concept of Dependency Injection in Ruby.
How does Ruby's garbage collection work?
What is refinement in Ruby?
What are Ractors and how do they enable true parallelism?
What are Fiber Scheduler and async I/O in Ruby 3?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
73 of 85 Ruby answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.