JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Ruby interview questions part 4
Ruby interview questions part 4
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the output of the given code? a = 5 b=10 while a <10 && b<20 puts a*b a+=2 b+=2 end
A. 45585
B. 15 19 23
C. 50 84 126
D. None of the mentioned
Show Correct Answer
Correct Answer is :
50 84 126
2. What is the output of the given code? a= 5 b=10 while a <10 && b<20 puts a-b a+=2 b+=2 end
A. 45585
B. 15 19 23
C. -5 -5 -5
D. None of the mentioned
Show Correct Answer
Correct Answer is :
-5 -5 -5
3. What is the output of the given code? a = 5 b=10 while a <10 || b<20 puts a*b a+=2 b+=2 end
A. 45585
B. 50 84 126 176 234
C. -5 -5 -5
D. None of the mentioned
Show Correct Answer
Correct Answer is :
50 84 126 176 234
4. What is the output of the given code? a = 5 b=10 while (a <10 || b<20)&&true puts a*b a+=2 b+=2 end
A. 45585
B. 50 84 126 176 234
C. -5 -5 -5
D. None of the mentioned
Show Correct Answer
Correct Answer is :
50 84 126 176 234
5. Ruby is an object oriented general purpose programming language.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
6. Which of the following is supported by Ruby?
A. Multiple Programming Paradigms
B. Dynamic Type System
C. Automatic Memory Management
D. All of the Mentioned
Show Correct Answer
Correct Answer is :
All of the Mentioned
7. Which of the following features does the 2.0 version of ruby supports?
A. Method keyword arguments
B. New literals
C. Security fixes
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
8. Which of the following languages syntax matches with the Ruby’s syntax?
A. Perl
B. PHP
C. Java
D. Jquery
Show Correct Answer
Correct Answer is :
Perl
9. What is the extension used for saving the ruby file?
A. .ruby extension
B. .rb extension
C. .rrb extension
D. None of the mentioned
Show Correct Answer
Correct Answer is :
.rb extension
10. Which of the following are valid floating point literal?
A. 0.5
B. 2
C. 0.5
D. None of the mentioned
Show Correct Answer
Correct Answer is :
0.5
11. Ruby can be embedded into Hypertext Markup Language(HTML).
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
12. It is must for Ruby to use a compiler.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
13. Ruby can be used for developing internet and intranet applications.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
14. Why do we use comments?
A. For later use to understand the working of the program
B. It is an efficient way of programming
C. It makes easy for the third person to understand
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
15. Which of the following type of comments are valid in ruby?
A. Single line comments
B. Multi line comments
C. Double line comments
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
16. How to comment multiple lines in ruby?
A. Using multiline comments
B. Using single line comments
C. No option to comment
D. All of the mentioned
Show Correct Answer
Correct Answer is :
Using multiline comments
17. How to comment a single line?
A. Using #
B. Using begin and end
C. Using //
D. None of the mentioned
Show Correct Answer
Correct Answer is :
Using #
18. This the right way to comment a single line. “Ruby”.length # I’m a single line comment!
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
19. What is the output of the given code? “Ruby”.length #to find the length of given string
A. 4 to find the length of given string
B. 4
C. To find the length of given string
D. Ruby
Show Correct Answer
Correct Answer is :
4
20. The following is the correct way to use multiline comment. = begin # comment = end
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
Similar Interview Questions
Search for latest jobs
Find Jobs