Zopsmart Technology
20+ Drishti Institute of Hotel Management Interview Questions and Answers
Given an array “arr” of “N” integers. Your task is to find and return all the indices of local minima and local maxima in the given array. You need to return the indice...read more
The task is to find and return the indices of local minima and local maxima in the given array.
Iterate through the array and compare each element with its neighbors to determine if it is a local minima or maxima.
Consider corner elements separately by comparing them with only one neighbor.
Store the indices of local minima and maxima in separate lists.
If there are no local minima or maxima, return -1 as the only row element in the 2-D list.
You are given two Strings 'P' and 'Q' of equal length. Your task is to check whether String 'P' can be converted into String 'Q' by cyclically rotating it to t...read more
The task is to check if one string can be converted into another string by cyclically rotating it to the right any number of times.
Check if the lengths of the two strings are equal. If not, return 0.
Concatenate the first string with itself and check if the second string is a substring of the concatenated string.
If the second string is a substring, return 1. Otherwise, return 0.
Bob lives with his wife in a city named Berland. Bob is a good husband, so he goes out with his wife every Friday to ‘Arcade’ mall.
‘Arcade’ is a very famous mall in Berland. It has a very unique t...read more
This question asks for the minimum number of trampoline jumps a person needs to make in order to reach the last shop in a mall.
The shops in the mall are laid out in a straight line and each shop has a constant value representing the maximum distance it can be jumped to.
The person starts at shop 0 and wants to reach the last shop, shop N-1.
If it is impossible to reach the last shop, the function should return -1.
The function should take the number of test cases, the number of ...read more
Q4. Write a program to slice the array from given index and re-arrange the array without using extra variables, inbuilt methods
Program to slice and rearrange array without extra variables or inbuilt methods
Use a loop to iterate through the array and shift elements to the left
Use a temporary variable to store the first element and move the rest of the elements one position to the left
Repeat the above step until the desired index is reached
Then move the temporary variable to the end of the sliced array
Continue shifting the remaining elements to the left until the end of the array is reached
Q5. delete middle node of linked list
To delete the middle node of a linked list, we can iterate through the list to find the middle node and then remove it by adjusting the pointers.
Iterate through the linked list to find the middle node by using two pointers - one moving one node at a time and the other moving two nodes at a time.
Once the middle node is found, adjust the pointers to skip over the middle node and connect the nodes before and after it.
Handle edge cases like when the list has an even number of nod...read more
Q6. SQL vs NoSQL and when to use what
SQL is best for structured data, NoSQL for unstructured. Use SQL for complex queries, NoSQL for scalability and speed.
SQL is best for structured data, NoSQL for unstructured
Use SQL for complex queries, NoSQL for scalability and speed
SQL is ACID compliant, NoSQL is BASE
Examples of SQL: MySQL, Oracle, PostgreSQL
Examples of NoSQL: MongoDB, Cassandra, Redis
Q7. DB queries on finding the second largest element
Query to find the second largest element in a database table
Use ORDER BY and LIMIT to select the second largest element
For MySQL: SELECT column FROM table ORDER BY column DESC LIMIT 1,1
For Oracle: SELECT column FROM (SELECT column FROM table ORDER BY column DESC) WHERE ROWNUM <= 2 MINUS SELECT column FROM (SELECT column FROM table ORDER BY column DESC) WHERE ROWNUM <= 1
Q8. What is launch modes in android
Launch modes determine how a new instance of an activity is associated with the current task.
There are four launch modes: standard, singleTop, singleTask, and singleInstance.
Standard is the default mode and creates a new instance of the activity every time it is launched.
SingleTop mode checks if there is already an instance of the activity at the top of the task stack and reuses it if possible.
SingleTask mode creates a new task for the activity and places it at the root of th...read more
Q9. Linkedlist insertion & deletion in Go
Linkedlist insertion & deletion in Go
In Go, linked lists can be implemented using structs and pointers.
Insertion involves creating a new node and updating the pointers of adjacent nodes.
Deletion involves updating the pointers of adjacent nodes to bypass the node being deleted.
Go's garbage collector automatically frees memory of unused nodes.
Q10. What is the keyword used in interface if we want concreate method?
The keyword used in interface for concrete method is 'default'.
The 'default' keyword is used in interfaces to provide a default implementation for a method.
It allows interfaces to have concrete methods without requiring implementing classes to override them.
Example: 'default void methodName() { // method implementation }'
Q11. Design patterns in java
Design patterns in Java are reusable solutions to common problems in software design.
Design patterns help in creating flexible, maintainable, and scalable code.
Some common design patterns in Java include Singleton, Factory, Observer, and Strategy.
Each design pattern has its own purpose and can be applied in different scenarios.
Design patterns promote code reusability and help in organizing code in a structured manner.
Q12. Can we create object for abstract classes and interfaces?
Yes, we can create object for abstract classes and interfaces in Java.
Objects cannot be created for abstract classes directly, but can be created for concrete subclasses that extend the abstract class.
Interfaces cannot be instantiated, but objects can be created for classes that implement the interface.
Example: Abstract class Animal { abstract void makeSound(); } Class Dog extends Animal { void makeSound() { System.out.println('Bark'); } } Animal obj = new Dog();
Example: Inte...read more
Q13. first and last occurrence of an element in a sorted array
Find the first and last occurrence of an element in a sorted array.
Use binary search to find the first occurrence of the element.
Modify binary search to find the last occurrence of the element.
Handle cases where the element is not found in the array.
Q14. What is inline function
Inline function is a function that is expanded in line when it is called, rather than calling a separate function.
Inline functions are used to improve performance by reducing the overhead of function calls.
They are defined using the 'inline' keyword.
They are commonly used in C++ programming.
Example: inline int add(int a, int b) { return a + b; }
Q15. What is the job culture of zopsmart
The job culture at Zopsmart is collaborative, innovative, and fast-paced.
Collaborative work environment where team members support and help each other
Emphasis on innovation and creativity in problem-solving
Fast-paced atmosphere with opportunities for growth and learning
Open communication and feedback encouraged
Diverse and inclusive workplace culture
Q16. What is use of factory
A factory is used to create objects of a specific class without exposing the creation logic to the client.
Factories provide a way to create objects without exposing the creation logic to the client.
They can be used to create objects of a specific class or a group of related classes.
Factories can be used to implement the Singleton pattern, where only one instance of a class is created.
They can also be used to implement the Abstract Factory pattern, where a family of related ob...read more
Q17. What is string contant pool?
String constant pool is a memory area in Java where unique string literals are stored to optimize memory usage.
String constant pool is a part of the Java heap memory.
It stores unique string literals to avoid duplicate storage.
Strings created using double quotes are stored in the string constant pool.
Strings created using new keyword are stored in the heap memory.
Q18. What is oops concepts
Object-oriented programming concepts that focus on data encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features to the outside ...read more
Q19. Detect loop in a linkedlist
Use Floyd's Tortoise and Hare algorithm to detect loop in a linked list.
Initialize two pointers, slow and fast, at the head of the linked list.
Move slow pointer by one step and fast pointer by two steps.
If they meet at any point, there is a loop in the linked list.
Q20. SQL query for fetching some info
SQL query to fetch specific information from a database
Use SELECT statement to specify the columns you want to retrieve
Use FROM clause to specify the table from which to retrieve the data
Use WHERE clause to add conditions for filtering the data
Use JOIN clause to combine data from multiple tables if needed
Q21. What is cross join
Cross join is a type of join operation in SQL that returns the Cartesian product of two tables.
Cross join does not require any matching condition between the tables.
It combines each row from the first table with every row from the second table.
Cross join can result in a large number of rows if the tables are big.
Example: SELECT * FROM table1 CROSS JOIN table2;
Q22. Find middle element of linked list
To find the middle element of a linked list, use the slow and fast pointer technique.
Initialize two pointers, slow and fast, at the head of the linked list.
Move the slow pointer by one node and the fast pointer by two nodes until the fast pointer reaches the end of the list.
The node pointed to by the slow pointer at this point will be the middle element of the linked list.
Q23. Inner join of three tables
Inner join of three tables in SQL
Use the JOIN keyword to combine three tables based on a common column
Specify the columns to select from each table
Use the ON keyword to specify the join condition
Q24. reverse a string
Reverse a string by iterating through the characters and swapping them.
Create a new string to store the reversed string
Iterate through the original string from end to start
Append each character to the new string
Return the new string as the reversed string
Q25. Last F2F round .
The last face-to-face round of the interview process.
Prepare to discuss your experience and skills in more detail.
Be ready to answer any final questions the interviewer may have.
Show enthusiasm and interest in the position and company.
Ask about next steps in the hiring process.
Thank the interviewer for the opportunity.
Q26. Explain acid properties
ACID properties are a set of properties that guarantee database transactions are processed reliably.
ACID stands for Atomicity, Consistency, Isolation, Durability
Atomicity ensures that either all operations in a transaction are completed or none are
Consistency ensures that the database remains in a consistent state before and after the transaction
Isolation ensures that multiple transactions can be executed concurrently without affecting each other
Durability ensures that once a...read more
Top HR Questions asked in Drishti Institute of Hotel Management
Interview Process at Drishti Institute of Hotel Management
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month