Newgen Software Technologies
10+ OTM Labs Interview Questions and Answers
Q1. String Compression Problem Statement
Implement a program that performs basic string compression. When a character is consecutively repeated more than once, replace the consecutive duplicates with the count of r...read more
Implement a program to compress a string by replacing consecutive duplicates with the count of repetitions.
Iterate through the string and keep track of consecutive characters and their counts.
Replace consecutive duplicates with the count of repetitions.
Handle the case where the count of repetitions is greater than 1 and less than or equal to 9.
Q2. Maximum Non-Crossing Ropes Problem
In a village with a river at its center, there are ‘N’ houses on each bank of the river. The northern bank’s houses have distinct X-coordinates given by an array A[1], A[2], ....read more
The task is to find the maximum number of non-crossing rope connections possible between houses on each bank of a river.
Sort the arrays A and B in ascending order.
Use dynamic programming to find the longest increasing subsequence between A and B.
The length of the longest increasing subsequence is the maximum number of non-crossing connections.
Object-Oriented Programming concepts include encapsulation, inheritance, and polymorphism, which are used to organize and manipulate data in data structures and algorithms.
Encapsulation: Bundling data and methods that operate on the data together in a single unit (object). Example: a class representing a car with properties like color and methods like drive().
Inheritance: Allowing a class to inherit properties and methods from another class. Example: a subclass of the car cla...read more
Explanation of insert, select, and join queries in a database management system.
Insert query is used to add new records to a table.
Select query is used to retrieve data from a table based on specified criteria.
Join query is used to combine rows from two or more tables based on a related column between them.
Examples: INSERT INTO table_name (column1, column2) VALUES (value1, value2); SELECT * FROM table_name WHERE condition; SELECT t1.column, t2.column FROM table1 t1 JOIN table...read more
Q5. How to compile all Java files inside a folder using Cmd
To compile all Java files inside a folder using Cmd, navigate to the folder and run 'javac *.java'
Open Command Prompt and navigate to the folder containing the Java files
Run the command 'javac *.java' to compile all Java files in the folder
Check for any errors or warnings in the output
Q6. Write a query to find out the 2nd highest salary from the table ?
Query to find 2nd highest salary from a table
Use ORDER BY and LIMIT
Exclude the highest salary using subquery
Handle cases where there are ties
Q7. Make a C++ class and show its implementation
Create a C++ class with implementation
Create a class named 'Person' with private data members like name, age, and gender
Include public member functions to set and get the data members
Implement the class in a separate header and source file
Q8. Database design using SQL and queries related to it
Database design is crucial for efficient data management. SQL queries help retrieve and manipulate data.
Understand the data requirements and relationships before designing the database schema
Normalize the data to reduce redundancy and improve data integrity
Use primary and foreign keys to establish relationships between tables
Write efficient SQL queries to retrieve and manipulate data
Optimize the database performance by indexing frequently queried columns
Q9. Which technology you know and worked
I have experience with various technologies including Java, Python, HTML/CSS, JavaScript, and SQL.
Java
Python
HTML/CSS
JavaScript
SQL
Q10. Internal working of Hashmap and Concurrent Hashmap
Hashmap is a data structure that stores key-value pairs. Concurrent Hashmap is a thread-safe version of Hashmap.
Hashmap uses hashing to store and retrieve elements based on their keys.
Concurrent Hashmap allows multiple threads to access and modify the map concurrently.
Hashmap has a load factor that determines when the map needs to be resized.
Concurrent Hashmap uses a technique called lock striping to allow concurrent access to different parts of the map.
Hashmap is not thread-...read more
Q11. Oops concepts with examples and need of them
Oops concepts are fundamental to object-oriented programming. They help in creating modular and reusable code.
Encapsulation - bundling of data and methods that operate on that data
Inheritance - creating new classes from existing ones
Polymorphism - ability of objects to take on many forms
Abstraction - hiding implementation details and showing only functionality
Examples - Car class inheriting from Vehicle class, Animal class having different methods for different species
Need - ...read more
Q12. Concat two linked lists in alternative way
Concatenate two linked lists alternatively
Create a new linked list
Traverse both linked lists simultaneously
Alternate between adding nodes from each list to the new list
If one list is longer than the other, add the remaining nodes to the end of the new list
Q13. what is deadlock
Deadlock is a situation where two or more processes are unable to proceed because each is waiting for the other to release a resource.
Deadlock occurs when two or more processes are stuck in a circular wait, where each process is waiting for a resource held by another process.
Four necessary conditions for deadlock are mutual exclusion, hold and wait, no preemption, and circular wait.
Example: Process A holds resource X and requests resource Y, while Process B holds resource Y a...read more
Q14. System Architecture for higher Experience
System architecture for higher experience involves scalable and efficient design.
Focus on scalability to handle increasing user load
Use microservices architecture for flexibility and easy maintenance
Implement caching mechanisms for faster response times
Utilize load balancing to distribute traffic evenly across servers
Q15. Reverse a string
Reverse a given string
Use a loop to iterate through the characters of the string and build a new string in reverse order
Alternatively, use built-in functions like reverse() in some programming languages
Consider edge cases like empty string or null input
Q16. Stream and collection api usage
Stream and collection api usage involves manipulating data using streams and collections in Java.
Stream API provides a way to process collections of objects in a functional way.
Collection API provides data structures to store and manipulate groups of objects.
Stream API can be used to filter, map, reduce, and collect data from collections.
Collection API includes interfaces like List, Set, and Map for different data structures.
Q17. Joins in SQL
Joins are used in SQL to combine data from two or more tables based on a related column.
Types of joins include inner join, left join, right join, and full outer join.
Inner join returns only the matching rows from both tables.
Left join returns all rows from the left table and matching rows from the right table.
Right join returns all rows from the right table and matching rows from the left table.
Full outer join returns all rows from both tables, with NULL values for non-matchi...read more
Top HR Questions asked in OTM Labs
Interview Process at OTM Labs
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month