Senior Ruby on Rails Developer
Senior Ruby on Rails Developer Interview Questions and Answers
Q1. How an application running in cloud with tightly coupled infrastructure can be deployed to on-premise
An application running in cloud with tightly coupled infrastructure can be deployed to on-premise by decoupling the components and using containerization.
Decouple the application components to make them more portable
Use containerization technologies like Docker to package the application and its dependencies
Deploy the containerized application to on-premise servers using tools like Kubernetes for orchestration
Q2. Add a new column to the database table in production which is already having 100 million of data
Use a tool like Rails migration to add a new column to the database table in production with 100 million data.
Create a new Rails migration file to add the new column to the database table.
Test the migration locally to ensure it works as expected.
Deploy the migration to the production environment during a maintenance window to avoid downtime.
Consider using tools like ActiveRecord's `change_column` method to efficiently add the new column to a large dataset.
Q3. How do you compare STI with Polymorphic association
STI is used for inheritance while polymorphic association is used for multiple associations
STI is used for modeling inheritance relationships where different classes share common attributes and behaviors
Polymorphic association is used when a model can belong to more than one other model on a single association
STI can lead to a large number of columns in a table, while polymorphic association requires an additional column to store the association type and ID
STI can be more eff...read more
Q4. Importance of CSRF tokens and CSP headers
CSRF tokens and CSP headers are important security measures to protect against cross-site scripting attacks.
CSRF tokens are used to prevent cross-site request forgery attacks by generating a unique token for each user session.
CSP headers help prevent cross-site scripting attacks by specifying which resources can be loaded on a webpage.
Both CSRF tokens and CSP headers are essential in securing web applications against malicious attacks.
Q5. Design a API rate limitter
Implementing an API rate limiter to control the number of requests a user can make within a certain time frame.
Use a token bucket algorithm to track and limit the number of requests per user.
Set a limit on the number of requests allowed per user within a specific time window.
Implement a sliding window approach to track request timestamps and enforce rate limits.
Consider using Redis or a similar caching mechanism to store and manage request data efficiently.
Q6. Rails API best practices
Rails API best practices
Use versioning in API endpoints for future changes
Implement proper error handling and response codes
Follow RESTful principles for resource naming and routing
Use serializers to format JSON responses efficiently
Implement authentication and authorization for secure access
Share interview questions and help millions of jobseekers 🌟
Senior Ruby on Rails Developer Jobs
Interview Questions of Similar Designations
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month