Naresh i Technologies
HM Constructions Interview Questions and Answers
Q1. how do you find missing number in a given integer arrary 1to 100 how do you find duplicate how do you find largest and smallest element in arrary find multiple duplicate value in an arrary
To find missing number, duplicate, largest and smallest elements, and multiple duplicates in an array.
To find missing number, calculate the sum of all numbers from 1 to 100 and subtract the sum of the given array.
To find duplicate, use a hash set to store elements as you iterate through the array and check for duplicates.
To find largest and smallest elements, initialize variables with the first element and update them while iterating through the array.
To find multiple duplica...read more
Q2. Q 1. What is constructor. Q 2. What is oops and its features. Q 3.Difference between abstraction and interface. Q 4. Difference between checked and unchecked. Q 5.Throw and throws keyword.
Answers to common programming interview questions.
Constructor is a special method that is called when an object is created.
OOPs is Object-Oriented Programming which focuses on objects and their interactions.
Abstraction is a concept of hiding implementation details while interface is a blueprint of a class.
Checked exceptions are checked at compile-time while unchecked exceptions are not.
Throw keyword is used to throw an exception while throws keyword is used to declare an exce...read more
Q3. Which is responsible for execute java program
Java Virtual Machine (JVM) is responsible for executing Java programs.
JVM is a virtual machine that interprets compiled Java code.
It provides a runtime environment for Java programs to run.
JVM is platform-independent and provides memory management, security, and other features.
Java programs are compiled into bytecode, which is then executed by the JVM.
JVM is responsible for loading classes, verifying bytecode, and executing the program.
Q4. Why are not remove Servlet from Java technology
Servlets are still relevant for web development in Java
Servlets provide a lightweight and efficient way to handle HTTP requests and responses
They can be used for dynamic web content generation and server-side processing
Servlets are extensible and can be integrated with other Java technologies like JSP and JDBC
Alternative technologies like Spring MVC and RESTful APIs build on top of Servlets
Removing Servlets would break backward compatibility and disrupt existing Java web appl...read more
Q5. how do you reverse an array
To reverse an array of strings, iterate through the array and swap elements from start to end.
Iterate through the array using two pointers, one starting from the beginning and the other from the end.
Swap the elements at the two pointers and move the pointers towards the center until they meet or cross each other.
Q6. how to find median in 2 arrays
To find the median in 2 arrays of strings, merge the arrays, sort them, and then calculate the median.
Merge the two arrays into one array
Sort the merged array
Calculate the median based on the length of the array (odd or even number of elements)
Q7. difference between array and Arrarylist
Array is a fixed-size collection of elements of the same data type, while ArrayList is a dynamic collection that can grow or shrink in size.
Array is a static data structure with a fixed size, while ArrayList is a dynamic data structure that can resize itself.
Arrays can hold primitive data types and objects, while ArrayList can only hold objects.
Arrays are faster than ArrayList for accessing elements, but ArrayList is more flexible and easier to work with.
Example: String[] nam...read more
Q8. Difference between python2 and Python 3 version
Q9. What is coockies
Interview Process at HM Constructions
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month