CitiusTech
Mahindra Finance Interview Questions and Answers
Q1. Word Frequency Counter
Given a string 'S' consisting of words, your task is to calculate how many times each word appears in the string. A word is a series of one or more non-space characters. In 'S', words can...read more
Count the frequency of each word in a given string.
Split the string by spaces to get individual words.
Use a hashmap to store each word and its frequency.
Iterate through the words and update the hashmap accordingly.
Print out the words and their frequencies in any order.
Comparable is an interface used for natural ordering, while Comparator is an interface used for custom ordering in Java.
Comparable interface is used to define the natural ordering of objects. It is implemented by the class whose objects are to be compared.
Comparator interface is used to define custom ordering of objects. It is implemented by a separate class.
Comparable interface has a single method, compareTo(), which compares the current object with another object.
Comparator...read more
Azure and AWS are two major cloud service providers offering similar services but with some differences in features and pricing.
AWS is the oldest and most widely used cloud service provider, while Azure is catching up quickly.
Azure is known for its strong integration with Microsoft products and services, while AWS has a wider range of third-party integrations.
AWS has a larger global presence with more data centers worldwide compared to Azure.
Pricing models differ between the ...read more
Multithreading in Java allows for concurrent execution of multiple tasks, improving performance and responsiveness.
1. Improved performance by utilizing multiple CPU cores efficiently.
2. Enhanced responsiveness as tasks can run concurrently without blocking each other.
3. Simplified coding for complex tasks by breaking them into smaller threads.
4. Facilitates better resource utilization and scalability.
5. Examples: parallel processing in data analysis, handling multiple client ...read more
Q5. What is Context API in React
Context API in React is a way to pass data through the component tree without having to pass props down manually at every level.
Context API provides a way to share values like themes, user data, etc. across the component tree without having to pass props down manually.
It consists of three main parts: Provider, Consumer, and useContext hook.
Provider component allows the data to be passed down to the tree, Consumer component consumes the data, and useContext hook allows functio...read more
Q6. What is Redux in React
Redux is a predictable state container for JavaScript apps, commonly used with React for managing application state.
Redux helps manage the state of an application in a predictable way
It provides a single source of truth for the state of the application
Actions are dispatched to update the state in a predictable manner
Reducers specify how the state changes in response to actions
Redux is commonly used with React to manage the state of components
Q7. Count duplicate from int array
Count duplicates in an int array
Create a HashMap to store the count of each element in the array
Iterate through the array and update the count in the HashMap
Count the elements with count greater than 1 as duplicates
Q8. Explain Spring Boot
Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured settings and tools.
Spring Boot eliminates the need for manual configuration by providing defaults for most settings.
It allows for easy creation of stand-alone, production-grade Spring-based applications.
Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow, making it easy to deploy applications.
It offers a wide range of plugins to enhance productivity, s...read more
Interview Process at Mahindra Finance
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month