Questions et réponses d'entretien les plus demandées et tests en ligne
Plateforme d'apprentissage pour la preparation aux entretiens, les tests en ligne, les tutoriels et la pratique en direct

Developpez vos competences grace a des parcours cibles, des tests blancs et un contenu pret pour l'entretien.

WithoutBook rassemble des questions d'entretien par sujet, des tests pratiques en ligne, des tutoriels et des guides de comparaison dans un espace d'apprentissage reactif.

Preparation a l'entretien

Ruby On Rails Questions et reponses d'entretien

Question 61. What is an object?

Textbook answer here is that an object is an instance of a class and has state, behavior, and identity. In a plain text example, you can say that a truck and a car are both objects of the class Vehicle, or that apple and pear are both objects of the class Fruit.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 62. How would you declare and use a constructor in Ruby?

Constructors are declared via the initialize method and get called when you call on a new object to be created.

Using the code snippet below, calling Order.new acts as a constructor for an object of the class Order.

class Order
  def initialize(customer, meal, beverage)
    @customer = customer
    @meal = meal
    @beverage = beverage
  end
end

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 63. How does a symbol differ from a string?

Symbols are immutable and reusable, retaining the same object_id.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 64. How and when would you declare a Global Variable?

Global variables are declared with the ‘$’ symbol and can be declared and used anywhere within your program. You should use them sparingly to never.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 65. How would you create getter and setter methods in Ruby?

Setter and getter methods in Ruby are generated with the attr_accessor method. attr_accessor is used to generate instance variables for data that’s not stored in your database column.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Les plus utiles selon les utilisateurs :

Copyright © 2026, WithoutBook.