Ruby Interview | Ruby on Rails
483 subscribers
15 photos
3 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
Which of the following commands will delete a table permanently?
Anonymous Quiz
9%
DELETE TABLE table_name;
89%
DROP TABLE table_name;
2%
REMOVE TABLE table_name;
0%
CLEAR TABLE table_name;
How do you retrieve all users whose name starts with "A" using ActiveRecord?
Anonymous Quiz
77%
User.where("name LIKE 'A%'")
9%
User.find_by(name: 'A%')
4%
User.get_all(name: /^A/)
10%
User.select("name LIKE 'A%'")
x = 5
y = 10
x, y = y, x
puts "#{x} #{y}"

The quiz will be in 1 minute
👍3❤1
What will be the output of the following code?☝️
Anonymous Quiz
5%
5 10
90%
10 5
3%
Error
2%
10 10
array = [1, 2, 3, 4]
array.each do |num|
next if num.even?
print num
end

The quiz will be in 1 minute
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]
4%
[1, 2, 3] [2, 4, 6]
4%
Error
The quiz will be in 1 minute

A - right answer
👍2👎2
👎12🤯6
The quiz will be in 1 minute
👎1🤯1
What will be the output?☝️
Anonymous Quiz
23%
Ruby Ruby
73%
Ruby Rails
4%
nil Rails
1%
Error
👎13
The quiz will be in 1 minute
What will be printed?☝️
Anonymous Quiz
49%
foo
9%
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
43%
nil
1%
undefined
53%
The value of the last executed expression
2%
Error
🥱5