TCS
DELUXE INDUSTRIES Interview Questions and Answers
Q1. How is Ruby return keyword different from Java
Ruby's return keyword is different from Java in terms of behavior and syntax.
In Ruby, the return keyword is optional and can be omitted.
Ruby's return keyword can be used to explicitly return a value from a method.
In Java, the return keyword is mandatory and must be used to return a value from a method.
Java's return keyword cannot be used to return from a block or lambda expression.
Q2. Why is docker system prune used?
docker system prune is used to clean up unused Docker resources.
docker system prune helps to free up disk space by removing unused containers, images, networks, and volumes
It can be used to remove stopped containers, dangling images, unused networks, and unused volumes
The command can be customized with flags to specify which resources to prune
Example: docker system prune -a removes all unused resources, including stopped containers and unused images
Q3. How do you declare variable in ruby
Variables in Ruby are declared by assigning a value to a name using the assignment operator (=).
To declare a variable, simply write the name of the variable followed by the assignment operator (=) and the value.
Ruby is dynamically typed, so you don't need to specify the type of the variable.
Variables can hold any type of data, including numbers, strings, arrays, hashes, etc.
Variable names in Ruby are case-sensitive and can start with a lowercase letter or an underscore.
You ca...read more
Q4. Why is docker ps command used?
The docker ps command is used to list all the running containers on a Docker host.
It provides information about the container ID, image used, command being run, status, ports, and names of the running containers.
It helps in monitoring and managing the containers on a Docker host.
The command can be used with various options to filter and format the output as per requirements.
Example: 'docker ps -a' lists all containers, including the ones that are not running.
Example: 'docker ...read more
Q5. List any 5 gems you have used in rails application
1. Devise - authentication solution. 2. Paperclip - file attachment management. 3. Cancancan - authorization solution. 4. Sidekiq - background job processing. 5. RSpec - testing framework.
Devise: A flexible authentication solution for Rails applications.
Paperclip: A file attachment management library for ActiveRecord.
Cancancan: An authorization solution that provides a simple way to define abilities.
Sidekiq: A background job processing library that uses threads to handle mult...read more
Q6. What are migrations in rails
Migrations in Rails are a way to manage database schema changes.
Migrations are Ruby classes that help modify the database schema.
They allow you to create, modify, or delete database tables, columns, and indexes.
Migrations provide a version control system for the database schema.
They ensure that all developers working on the project have the same database structure.
Migrations can be easily rolled back if needed, making it easy to revert changes.
They are executed using the 'rak...read more
More about working at TCS
Reviews
Interviews
Salaries
Users/Month