6D Technologies
10+ Material Sources International Interview Questions and Answers
Q1. Write a program to find a duplicate in two list (Take two list and wirte a program to print the same elementsin both list in note pad)
Program to find duplicates in two lists and print them in notepad
Iterate through each element in the first list and check if it exists in the second list
If a duplicate is found, print it to a notepad file
Use a hash set to store elements from the first list for efficient lookup
Q2. What is the method to find the first two maximum numbers in a given set of data?
To find the first two maximum numbers, iterate through the data while keeping track of the largest and second largest values.
Initialize two variables, max1 and max2, to hold the maximum and second maximum values.
Iterate through the array of numbers.
For each number, compare it with max1 and max2.
If the current number is greater than max1, update max2 to max1 and then update max1 to the current number.
If the current number is less than max1 but greater than max2, update max2 to...read more
Q3. What is thread pool and what are its functions
A thread pool is a collection of worker threads that efficiently execute asynchronous tasks.
Thread pool helps in managing and reusing a pool of threads to execute tasks concurrently.
It improves performance by reducing the overhead of creating new threads for each task.
Thread pool can limit the number of concurrent threads to prevent resource exhaustion.
Examples include Java's Executor framework and .NET's ThreadPool class.
Q4. What is the method to reverse a string in Java?
Reversing a string in Java can be done using various methods, including StringBuilder, recursion, and character arrays.
Using StringBuilder: StringBuilder sb = new StringBuilder("Hello"); sb.reverse(); System.out.println(sb.toString()); // Output: olleH
Using a character array: char[] charArray = "Hello".toCharArray(); for (int i = 0; i < charArray.length / 2; i++) { char temp = charArray[i]; charArray[i] = charArray[charArray.length - 1 - i]; charArray[charArray.length - 1 - i...read more
Q5. What is lookup annotation in springboot
Lookup annotation in Spring Boot is used to indicate that a method should be cached for faster retrieval.
Lookup annotation is used in conjunction with @Cacheable annotation to cache the result of a method.
It is commonly used in Spring Boot applications to improve performance by caching frequently accessed data.
Example: @Lookup @Cacheable("books") public List
findAllBooks() { return bookRepository.findAll(); }
Q6. What is memory management in java
Memory management in Java refers to the process of allocating and deallocating memory for objects in the Java Virtual Machine (JVM).
Java uses automatic memory management through garbage collection to handle memory allocation and deallocation.
Memory in Java is divided into two main areas: stack memory and heap memory.
Stack memory is used for storing primitive data types and references to objects, while heap memory is used for storing objects themselves.
Java automatically manag...read more
Q7. Who program to print from 100 to 1
Program to print numbers from 100 to 1
Use a loop to iterate from 100 to 1
Print the current number in each iteration
Q8. Write a program to implement a stack using array
Implement a stack using array in a program
Create an array to store the stack elements
Implement push and pop functions to add and remove elements from the stack
Keep track of the top of the stack using a variable
Q9. Create a form in react without any libaraies
Creating a form in React without any libraries
Use state to manage form data
Use onChange event to update state as user types
Use onSubmit event to handle form submission
Q10. What is critical section
A critical section is a part of a program where shared resources are accessed and must be protected from concurrent access.
Critical sections are used to prevent race conditions and ensure data integrity.
They are typically protected using locks or other synchronization mechanisms.
Only one thread can execute the critical section at a time.
Examples include accessing a shared database, updating a global variable, or modifying a linked list.
Q11. Difference between hashmap and hashset
HashMap is a key-value pair collection while HashSet is a collection of unique elements.
HashMap stores key-value pairs while HashSet stores unique elements
HashMap allows duplicate values but keys must be unique, HashSet does not allow duplicates
HashMap uses keys to retrieve values, HashSet does not have keys
Q12. Explain java oops concept
Java OOPs concept is a programming paradigm that focuses on objects and their interactions.
OOPs stands for Object-Oriented Programming System
It is based on the concepts of classes and objects
Encapsulation, Inheritance, Polymorphism, and Abstraction are the four main pillars of OOPs
Java supports all the OOPs concepts
Example: A class 'Car' can have properties like 'color', 'model', and 'year' and methods like 'start', 'stop', and 'accelerate'
Q13. Merge two linked list..
Merging two linked lists involves combining the elements of both lists into a single sorted list.
Create a new linked list to store the merged list
Compare the values of the nodes from both lists and add the smaller value to the merged list
Move the pointer of the list with the smaller value to the next node
Repeat the comparison and addition until both lists are exhausted
If one list is exhausted, append the remaining nodes of the other list to the merged list
Q14. program for selection sort
Selection sort is a simple sorting algorithm that repeatedly selects the minimum element from an unsorted portion of the array and swaps it with the first element.
Iterate through the array and find the minimum element
Swap the minimum element with the first element
Repeat the process for the remaining unsorted portion of the array
Top HR Questions asked in Material Sources International
Interview Process at Material Sources International
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month