Rubyがミニツク

あなたのRubyの技術に関するより詳しい知識と理解を増やします。

Certified Ruby Programmer Silver Preparation Course

このコースについて

This course contains a set of drills that you can study to prepare yourself for the Certified Ruby Programmer Silver Examination.

コンテンツ一覧

ヒント レッスンの名前をクリックすると、その内容を表示します。

次のレッスン ホームへ戻る

Certified Ruby Programmer Silver Preparation Course - Part 1

コンテンツ概要

Prepare Yourself for the Ruby Association Certified Ruby Programmer (Silver) Examination with the practice questions in this series of drills. The series cover the test curriculum as set out by the Ruby Association. Note, the questions in this drill assume Ruby version 1.8.7 unless otherwise stated.

このドリルは10問の問題があります。


はじめる

問題

Which one of the programs below produces the following output?

Output:

"cde"

選択肢を選ぶ

(c) p "abcdefg" - "ab" - "fg"

(d) p "abcdefg"[2, 3]

(a) p ["a", "b", "c", "d", "e"][0..2].join

(b) p "abcdefg"[2..3]


次の問題へ進む

問題

Of the following pieces of code, which one finishes execution without any errors?

選択肢を選ぶ

(a) 1..10.to_s

(b) 10.*(0xFace)

(c) 10.+("10")

(d) Time.now.strftime(1999, 12, 11)


次の問題へ進む

問題

Which string matches the following regular expression?

/\A\d{3}-\d{4}\z/

選択肢を選ぶ

(b)

690-0823

(d)

690-0x23

(c)

PCODE690-0823

(a)

foo@example.com


次の問題へ進む

問題

Which one of the programs below produces the following output?

Output:

[10, 20, 30, 40]

選択肢を選ぶ

(d) p [1, 2, 3, 4].zip([10, 10, 10, 10])

(b) p (1...5).to_a.map {|i| i * 10}

(a) p [1, 2, 3, 4].select {|i| i * 10}

(c) p (10..40).to_a


次の問題へ進む

問題

Which one of the following choices is a valid name for a local variable in Ruby?

選択肢を選ぶ

(c) case

(d) this

(a) _FILE_

(b) Foo


次の問題へ進む

問題

What is the correct output of the following program?

a = [1, 2, 3]
b = [4, 5, 6]
p a.zip(b).first

選択肢を選ぶ

(b) [1, 2, 3]

(a) 1

(c) [1, 4]

(d) [3, 6]


次の問題へ進む

問題

Which one of the following constants is predefined in Ruby?

選択肢を選ぶ

(a) ARGV

(c) LOAD_PATH

(b) RUBY_ENV

(d) OS


次のレッスン ホームへ戻る