Ror Software Engineer

filter-iconFilter interviews by

Ror Software Engineer Interview Questions and Answers

Updated 9 Feb 2023

Popular Companies

Q1. what are different types of associations?

Ans.

Different types of associations include one-to-one, one-to-many, many-to-many, and polymorphic associations.

  • One-to-one association: each record in one table is associated with one and only one record in another table.

  • One-to-many association: each record in one table is associated with one or more records in another table.

  • Many-to-many association: each record in one table is associated with one or more records in another table, and vice versa.

  • Polymorphic association: a single ...read more

Q2. how to handle exceptions in ruby?

Ans.

Exceptions in Ruby can be handled using the 'begin', 'rescue', and 'ensure' keywords.

  • Use 'begin' to start a block of code that may raise an exception

  • Use 'rescue' to catch the exception and handle it

  • Use 'ensure' to ensure that a block of code is always executed, regardless of whether an exception was raised or not

  • Use 'raise' to manually raise an exception

  • Use 'retry' to retry a block of code if an exception was raised

Q3. explain model view controller model in ROR

Ans.

MVC is a design pattern that separates an application into three interconnected components: Model, View, and Controller.

  • Model represents the data and business logic of the application

  • View is responsible for rendering the user interface

  • Controller handles user input and updates the model and view accordingly

  • In ROR, the model is typically represented by a database table, the view is an HTML template, and the controller is a Ruby class

  • MVC helps to keep code organized, maintainabl...read more

Q4. use type field in table for polymorphic

Ans.

Using a type field in a table allows for polymorphic associations between different models.

  • The type field stores the name of the associated model.

  • This allows for easy querying and retrieval of associated records.

  • Example: a comments table can have polymorphic associations with both posts and articles.

  • The type field would store either 'Post' or 'Article' depending on the associated record.

Are these interview questions helpful?
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 60 Interviews
2.6
 • 12 Interviews
3.5
 • 10 Interviews
3.7
 • 2 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Recently Viewed
INTERVIEWS
Atul
No Interviews
SALARIES
ZS
INTERVIEWS
Atul
No Interviews
DESIGNATION
INTERVIEWS
Atul
40 top interview questions
DESIGNATION
INTERVIEWS
Blue Dart Express
No Interviews
INTERVIEWS
Atul
No Interviews
SALARIES
Morgan Stanley
INTERVIEWS
Atul
No Interviews
Ror Software Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter