BestPeers Infosystem
10+ Patanjali Ayurved Interview Questions and Answers
Q1. what is final finally and difference? what is static final and scope of local variable? what is deadlock and method to prevent? is java fully or partial object oriented if partial then why? all oops concept. li...
read moreQuestions related to Java programming language concepts and SQL queries.
final is a keyword used to declare a constant value, finally is a block of code that executes after a try-catch block
static final is used to declare a constant value that can be accessed without creating an instance of the class, local variable has a limited scope within a method
Deadlock occurs when two or more threads are blocked and waiting for each other to release resources, prevention can be done by ...read more
Q2. what is mixin and does ruby support multiple inheritence if yes then how and no then why?
A mixin is a way to add functionality to a class without using inheritance. Ruby does not support multiple inheritance due to potential conflicts.
Mixins in Ruby are achieved using modules, which can be included in classes to add methods and attributes.
Ruby does not support multiple inheritance because it can lead to the diamond problem, where conflicting methods from different parent classes cause ambiguity.
Instead of multiple inheritance, Ruby encourages the use of mixins an...read more
Q3. what is hash and coding problem to retain only unique elements in a collection
Hashing is a technique to map data to a fixed-size value. To retain unique elements in a collection, use a hash set.
Create a hash set to store unique elements
Iterate through the collection and add each element to the hash set
If an element already exists in the hash set, skip adding it to retain only unique elements
Q4. what are and validations callbacks and difference between destroy and delete
Callbacks are methods that are called at certain points in an object's lifecycle. Destroy permanently deletes a record, while delete marks it as deleted.
Validation callbacks are methods that are called before or after validations on an object. They are used to ensure data integrity.
Destroy method permanently deletes a record from the database, including associated records. It does not trigger callbacks or validations.
Delete method marks a record as deleted in the database, bu...read more
Q5. difference between many to many and has and belongs to many association and explain polymorphic association
Many to many vs has and belongs to many association, and explanation of polymorphic association.
Many to many association involves a join table to connect two models with a many-to-many relationship.
Has and belongs to many association is a simpler version of many to many, where the join table is hidden.
Polymorphic association allows a model to belong to more than one other model, using a single association.
Example: Many to many - Students and Courses, HABTM - Users and Roles, ...read more
Q6. difference between proc and lambda
Proc is a block of code that can be reused, while lambda is an anonymous function.
Proc is a saved block of code that can be called multiple times, while lambda is a one-time anonymous function.
Procs are defined using the 'proc' keyword, while lambdas are defined using the 'lambda' keyword.
Procs can take multiple arguments, while lambdas are limited to a single expression.
Q7. OOPS Concept Array vs Linked LIst What is DBMS DDL and DML What is SDLC Two models of SDLC
Questions related to OOPS, data structures, DBMS, and SDLC models.
OOPS concept refers to the principles of object-oriented programming such as encapsulation, inheritance, and polymorphism.
Array is a static data structure while linked list is a dynamic data structure.
DBMS stands for Database Management System which is a software system used to manage and organize data.
DDL (Data Definition Language) is used to define the database schema while DML (Data Manipulation Language) is...read more
Q8. What is routes, explain mvc architecture, rails filters, callbacks, custom validation
Routes define URL patterns for mapping to controller actions in Rails. MVC architecture separates concerns in web development.
Routes in Rails define URL patterns and map them to controller actions
MVC architecture separates the application into Model, View, and Controller components
Rails filters are methods that run before, after, or around controller actions
Callbacks in Rails are methods that are run at certain points in an object's life cycle
Custom validations in Rails allow...read more
Q9. what is hoisting ?
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope during compilation.
Variable and function declarations are hoisted to the top of their scope.
Only declarations are hoisted, not initializations.
Function declarations take precedence over variable declarations.
Q10. what is clouser
A closure is a function that has access to its own scope, as well as the scope in which it was defined.
A closure allows a function to access variables from its outer function even after the outer function has finished executing.
Closures are commonly used in JavaScript for data encapsulation and creating private variables.
Example: function outerFunction() { let outerVar = 'I am outer'; return function innerFunction() { console.log(outerVar); }; }
Q11. How to implement CI/CD
Interview Process at Patanjali Ayurved
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month