가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Prepare Interview

Ruby On Rails 면접 질문과 답변

Ques 66. Describe the difference between class and instance variables?

  • Class variables are created with the prefix ‘@@’ and are shared by all objects in a class.

  • Instance variables are created with the prefix ‘@’ and belong to a single object within a class.

도움이 되었나요? Add Comment View Comments
 

Ques 67. Example some of the looping structures available in Ruby?

For loop, While loop, Until Loop.

도움이 되었나요? Add Comment View Comments
 

Ques 68. Explain the difference between a has_one and belongs_to association in Ruby on Rails.

has_one: Indicates a direct 1:1 relationship between objects where each instance of a model contains one instance of another model.
A product has_one provider, a customer has_one order.


도움이 되었나요? Add Comment View Comments
 

Ques 69. Explain a polymorphic association in Ruby on Rails.

Polymorphic associations allow a model to belong to more than one other model through a single association.


class Picture < ActiveRecord::Base
  belongs_to : imageable, polymorphic: true
end

class Employee < ActiveRecord::Base
  has_many : pictures, as: : imageable
end

class Product < ActiveRecord::Base
  has_many : pictures, as: : imageable
end
  • Here, the class Picture belongs_to both Employee and Product, but does so through a single association rather than through multiple.
  • Be sure to know an appropriate situation to create a polymorphic association, such as creating a comment model associated with multiple other models (articles, photos, etc.). The advantage of using polymorphism here is that it allows you to create a single comment model, rather than separate models for each one (PhotoComment model, ArticleComment model, etc.)

도움이 되었나요? Add Comment View Comments
 

Ques 70. What is a Proc?

Procs, short for procedures, act similar to blocks, but can be saved as variables and reused. Think of them as blocks you can call over and over again on multiple arrays.

도움이 되었나요? Add Comment View Comments
 

Most helpful rated by users:

Copyright © 2026, WithoutBook.