Giter Site home page Giter Site logo

vs's Introduction

  1. What is your experience in Rails?

    My experience in Ruby on Rails involves maintaining and developing enterprise applications since early 2022. I've worked extensively with third-party applications such as Xendit and 3PL shipping. These applications primarily focus on procurement-related activities.

  2. How many projects have you worked on?

    I've been working on a project involving API services for a company. It includes a payment service to handle payment notifications, a service for generating various types of files, emails, jobs, and more. The most impressive project was transforming a print procurement application into a marketplace application catering to the needs of suppliers.

    This project is built using Ruby on Rails version 2.7.2. It features modules for product catalog listing, request for quotation, purchase orders, invoices, and everything is seamlessly integrated.

  3. What rails version do you use?

  • 2.7.2
  1. What databases do you usually use?
    1. Postgres sql
  2. What libraries do you usually use:
    1. Database: ActiveRecord for database interactions.
    2. Background process: Sidekiq
    3. Caching: ActiveSupport::Cache, Redis.
    4. Pagination: Kaminari
    5. Upload processing: CarrierWave.
    6. Cronjob: Clockwork.
    7. Unit Test: RSpec
    8. Refactor and fix performance issues: never use this.
    9. Automation tools for deployment process: Jenkins, k8s, docker
  3. Are you familiar with these plugins, if so can you describe the function for each of these plugins:
    1. Sidekiq: A background processing library for Ruby.
    2. Shrine: A versatile file attachment toolkit for Ruby applications.
    3. Ransack: A search library for Ruby on Rails.
    4. Devise: A flexible authentication solution for Rails.
    5. JWT: JSON Web Token authentication for APIs.
    6. Pagy: A lightweight and performant pagination library.
    7. Webpacker: Integrates Webpack with Rails for managing JavaScript and CSS assets.
    8. Sprocket: The Rails asset pipeline for managing and serving static assets.
    9. Capistrano: A remote server automation and deployment tool.
  4. Are you familiar with Linux, which distributions do you often use?
    1. Yes
  5. Are you familiar with ubuntu, which command do you often use?
    1. Cp
    2. Mv
    3. Ssh
    4. Ln
    5. Sudo su
    6. Sudo apt install
  6. Which web server do you usually use? Are you familiar with Nginx?
    1. Indeed, I'm using Nginx.

Technical:

  1. Describe the difference between module and class?

    1. Module
      1. A class is a blueprint for creating objects. It defines a data structure and behavior that the objects instantiated from the class will have.
      2. Objects created from a class can have attributes (properties) and methods (functions).
      3. Classes support inheritance, allowing one class to inherit the properties and methods of another, promoting code reuse.
      4. They are used to model and encapsulate real-world entities or concepts.
    2. Class
      1. A module is a collection of methods and constants. It cannot be instantiated, and it does not have instances or an inheritance hierarchy.
      2. A module is a collection of methods and constants. It cannot be instantiated, and it does not have instances or an inheritance hierarchy.
      3. A module is a collection of methods and constants. It cannot be instantiated, and it does not have instances or an inheritance hierarchy.
      4. A module is a collection of methods and constants. It cannot be instantiated, and it does not have instances or an inheritance hierarchy.
  2. Describe the difference between the class variable and the class instance variable?

    1. Class Variable:
      1. A class variable is a variable that is shared among all instances of a class.
      2. It is defined within the class but outside of any instance methods.
      3. Changes to a class variable affect all instances of the class.
      4. Class variables are typically used to store data that should be common to all instances of the class.
    2. Class Instance Variable:
      1. A class instance variable is associated with a specific class instance (object) rather than the class itself.
      2. It is defined within the class, but outside of any instance methods, similar to class variables.
      3. Each instance of the class has its own copy of the class instance variable, and changes are specific to that instance.
      4. Class instance variables are often used when you need data that is shared among instances but not shared across all instances of the class.
  3. What is polymorphism and give an example for that in a model class?

    • Polymorphism, in the context of object-oriented programming, refers to the ability of objects of different types to be treated as objects of a common type. It allows objects to be used interchangeably based on their common interface or shared behavior.
       class Plant
          def grow
             raise NotImplementedError, "Subclasses must implement the 'grow' method"
          end
          end
    
          class Flower < Plant
          def grow
             "The flower is blooming!"
          end
          end
    
          class Tree < Plant
          def grow
             "The tree is getting taller."
          end
       end

text In this example, Plant is a base class with a method grow that is expected to be implemented by its subclasses. Flower and Tree are subclasses of Plant, each providing its own implementation of the grow method.

Now, you can use polymorphism to treat instances of Flower and Tree interchangeably as instances of Plant:

rose = Flower.new
oak = Tree.new

plants = [rose, oak]

plants.each do |plant|
  puts plant.grow
end
  1. How do you handle N+1 performance issues?

    • Eager Loading: example
          @posts = Post.includes(:comments).all
          @posts.each { |post| puts post.comments.size }
    • Joins: example
          @posts = Post.joins(:author).all
          @posts.each { |post| puts post.author.name }
    • Batch Loading: example
      @authors = Author.preload(:posts)
      @authors.each { |author| puts author.posts.size }
  2. Describe what is Lazy Load, and when to use it?

    • Lazy loading is a programming technique that defers the loading of a particular object or data until the point at which it is needed. In the context of backend development, lazy loading is often associated with database queries and the retrieval of related data.

    • When to Use Lazy Loading:

      • Reducing Initial Load Time
      • Optimizing Resources
      • Improving User Experience
      • Minimizing Database Queries
  3. How to handle Unique Records in Concurrent Process?

    • Use Transactions
      • Wrap your operations in transactions to ensure atomicity. A transaction allows a series of operations to be treated as a single, indivisible unit. If a transaction encounters an error or conflict, it can be rolled back, preventing partial updates and maintaining data consistency.
    • Locking
      • Use database locks to prevent concurrent processes from modifying the same records simultaneously. However, be cautious with this approach, as it can lead to performance issues and contention
    • Database Constraints
      • Leverage database features to enforce uniqueness constraints. Most databases support unique constraints on columns, which can prevent the insertion of duplicate records. This ensures data integrity at the database level

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.