Ruby Interview | Ruby on Rails – Telegram
Ruby Interview | Ruby on Rails
476 subscribers
14 photos
2 links
The Ruby Interview channel is a resource for preparing for Ruby developer interviews.

It features questions, problem-solving solutions, and interview tips.

Contact:
@Connor_1992
Download Telegram
What will be the output? ☝️
Anonymous Quiz
3%
1234
28%
24
67%
13
1%
Error
x = [1, 2, 3]
y = x.map { |n| n * 2 }
x[0] = 10
puts "#{x} #{y}"

The quiz will be in 1 minute
What will be printed when the following code is executed? ☝️
Anonymous Quiz
88%
[10, 2, 3] [2, 4, 6]
3%
[10, 2, 3] [1, 2, 3]
5%
[1, 2, 3] [2, 4, 6]
5%
Error
The quiz will be in 1 minute

A - right answer
👍2👎2
👎11🤯6
The quiz will be in 1 minute
👎1🤯1
What will be the output?☝️
Anonymous Quiz
22%
Ruby Ruby
73%
Ruby Rails
4%
nil Rails
1%
Error
👎12
The quiz will be in 1 minute
What will be printed?☝️
Anonymous Quiz
50%
foo
8%
Error
1%
nil
41%
bar
🤯7🤔1
The quiz will be in 1 minute
What does the << operator do with strings?
Anonymous Quiz
18%
HelloWorld
71%
Hello World
10%
Error
1%
nil
How do you correctly create an empty array?
Anonymous Quiz
24%
arr = []
71%
Both options
0%
nil
What is the default return value of a method in Ruby if no explicit return is used?
Anonymous Quiz
44%
nil
1%
undefined
53%
The value of the last executed expression
2%
Error
🥱5
Which of the following is NOT a valid way to define a method in Ruby?
Anonymous Quiz
2%
def my_method; end
2%
def my_method(); end
0%
def my_method(param1, param2 = 5); end
96%
function my_method() {}
🤡3🤔2
Which SQL command is used to remove all records from a table without deleting the table itself?
Anonymous Quiz
56%
TRUNCATE
35%
DELETE
6%
DROP
4%
REMOVE
🤔2💊2
What is the default sorting order in SQL if ORDER BY is used without specifying ASC or DESC?
Anonymous Quiz
19%
DESC (Descending)
62%
ASC (Ascending)
9%
Depends on the database
9%
No default order
What is the main advantage of the CQRS (Command Query Responsibility Segregation) pattern in SQL databases?
Anonymous Quiz
4%
Reduces database size
73%
Separates read and write operations for better scalability
10%
Prevents deadlocks
12%
Ensures strict ACID compliance
Which pattern is used to wrap an object and add new behaviors dynamically at runtime?
Anonymous Quiz
12%
Adapter
10%
Proxy
72%
Decorator
5%
Bridge
Which pattern is used to allow incompatible interfaces to work together?
Anonymous Quiz
78%
Adapter
8%
Strategy
8%
Observer
7%
Factory
Which pattern allows an object to change its behavior dynamically depending on its state?
Anonymous Quiz
24%
Strategy
41%
State
27%
Observer
8%
Factory Method