JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Ruby interview questions part 9
Ruby interview questions part 9
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What will be the output of the given code? boolean_1 = (3 < 4 || false) && (false || true) puts boolean_1
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
TRUE
2. What will be the output of the given code? boolean_1 = !(3 < 4 || false) && (false || true) puts boolean_1
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
FALSE
3. What will be the output of the given code? boolean_1 = 2**3 != 3**2 || true puts boolean_1
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
TRUE
4. What will be the output of the given code? boolean_1 = false || -10 > -9 puts boolean_1
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
TRUE
5. What will be the output of the given code? boolean_1 = !(700 / 10 == 70) puts boolean_1
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
FALSE
6. What will be the output of the given code? boolean_1 = !true puts boolean_1 boolean_2 = !true && !true puts boolean_2
A. True True
B. False False
C. True False
D. None of the mentioned
Show Correct Answer
Correct Answer is :
True False
7. What will be the output of the given code? boolean_2 = !true && (!true || 100 != 5**2) puts boolean_2
A. TRUE
B. FALSE
C. Error
D. None of the mentioned
Show Correct Answer
Correct Answer is :
FALSE
8. Which of the following is the valid string method?
A. The .length method
B. The .upcase method
C. The .downcase method
D. The .irreverse method
Show Correct Answer
Correct Answer is :
The .irreverse method
9. The .length method is used to check number of characters.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
10. What is the output of the following? "Iam learning ruby language".length
A. 26
B. 23
C. 20
D. 18
Show Correct Answer
Correct Answer is :
26
11. What is the output of the following? ruby.reverse
A. Error in compilation
B. ybur
C. 4
D. Undefined local variable ruby
Show Correct Answer
Correct Answer is :
Undefined local variable ruby
12. What will be the output of the following? "Eric".irreverse
A. Eric
B. cirE
C. undefined method
D. None of the mentioned
Show Correct Answer
Correct Answer is :
undefined method
13. What does the .upcase method do?
A. Convert the string to uppercase
B. Convert only lowercase string to uppercase and vice-versa
C. Convert the string to lowercase
D. None o the mentioned
Show Correct Answer
Correct Answer is :
Convert the string to uppercase
14. What will be the output of the following? "Ruby".reverse.upcase
A. RUBY
B. ybuR
C. YBUR
D. YBUr
Show Correct Answer
Correct Answer is :
YBUR
15. What will be the output of the given code? "I'am learning Ruby Language".length.reverse.upcase
A. 27
B. egaugnal ybuR gninreal ma’I
C. ERAUGNAL YBUR GNINREAL MA’I
D. Undefined method `reverse’ for 27:Fixnum
Show Correct Answer
Correct Answer is :
Undefined method `reverse’ for 27:Fixnum
16. What will be the output of the given code? "I'am learning Ruby Language".reverse.upcase.length
A. 27
B. egaugnal ybuR gninreal ma’I
C. ERAUGNAL YBUR GNINREAL MA’I
D. Undefined method `reverse’ for 27:Fixnum
Show Correct Answer
Correct Answer is :
27
17. The downcase method changes the whole string to smallcase letters.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
18. What will we the output of the given code? "I'am Learning RUBY Language".downcase
A. iam learning ruby language
B. i’AM lEARNING ruby lANGUAGE
C. “i’am learning ruby language”
D. None of the mentioned
Show Correct Answer
Correct Answer is :
“i’am learning ruby language”
19. What is the output of given code? string="I'am Learning RUBY Language".downcase string.upcase
A. Undefined method
B. “I’AM LEARNING RUBY LANGUAGE”
C. I’am Learning RUBY Language
D. None of the mentioned
Show Correct Answer
Correct Answer is :
“I’AM LEARNING RUBY LANGUAGE”
20. What will be the output of the given code? "Come let's learn.reverse Ruby.length language".upcase
A. nreal s’tel emoC 4 LANGUAGE
B. Undefined error
C. “COME LET’S LEARN.REVERSE RUBY.LENGTH LANGUAGE”
D. None of the above
Show Correct Answer
Correct Answer is :
“COME LET’S LEARN.REVERSE RUBY.LENGTH LANGUAGE”
Similar Interview Questions
Search for latest jobs
Find Jobs