The find_by returns the single resulting object (or if the query returns more than one row, the first object of the result), not an Array containing the result.
When using Rails 3.X, you can use find_all_by, e.g. find_all_by_parent_id_and_question_type_id to get the Array you expected.
find_all_by will still work in Rails 4.0, but is deprecated. Using where
is preferred in both versions of Rails. For your specific example, I like the following format:
Question.where(:parent_id => exam_Question.id).where(:question_type_id => 12).count
See https://github.com/rails/activerecord-deprecated_finders for details.