Accenture
Marsh McLennan Interview Questions and Answers
Q1. How index of an object is calculated using hashcode() in hashmap
Hashcode is used to calculate the index of an object in a hashmap.
Hashcode is a unique integer value assigned to an object by the JVM.
The hashcode value is used to calculate the index of the object in the hashmap.
The index is calculated using the hashcode value and the size of the hashmap.
If two objects have the same hashcode value, they will be stored in the same index using linked lists.
Q2. Java 8 features ( as I had worked on java 8 )
Java 8 introduced several new features including lambda expressions, streams, and functional interfaces.
Lambda expressions allow for functional programming and simplify code.
Streams provide a way to process collections of data in a functional way.
Functional interfaces allow for the use of lambda expressions.
Default methods allow for adding methods to interfaces without breaking existing implementations.
Date and time API improvements.
Optional class for null checking.
Nashorn Ja...read more
Q3. How we use SPFx in SharePoint. How we use jQuery and JSOM Few question related to JavaScript , CSS and HTML
SPFx is used in SharePoint for building web parts and extensions. jQuery and JSOM are used for client-side development. JavaScript, CSS, and HTML are essential for front-end development.
SPFx is used to create web parts and extensions in SharePoint.
jQuery is used for DOM manipulation and event handling.
JSOM (JavaScript Object Model) is used for interacting with SharePoint data on the client side.
JavaScript is used for adding interactivity to web pages.
CSS is used for styling w...read more
Q4. Relation between hashcode() and .equals() method
Hashcode() and equals() are methods used in Java to compare objects.
Hashcode() returns an integer value that represents the object's memory address.
Equals() compares the values of two objects to determine if they are equal.
If two objects are equal, their hashcode values must be the same.
If two objects have the same hashcode value, it does not necessarily mean they are equal.
It is good practice to override both methods when creating custom classes.
Q5. How to print a series of number without using loop?
Using recursion to print a series of numbers without using a loop.
Create a recursive function that takes the starting number and the ending number as parameters.
Print the starting number and recursively call the function with starting number + 1 until it reaches the ending number.
Example: function printNumbers(start, end) { if(start <= end) { console.log(start); printNumbers(start + 1, end); } }
Q6. 1.to print all natural numbers(only logic) 2.AP series 3.and since I am from me mechanical background they asked some questions from training and my project...project is must
Printing natural numbers and AP series using logic.
To print all natural numbers, start from 1 and increment by 1 in a loop until the desired limit.
For AP series, start with the first term and add the common difference in each iteration.
Example: Natural numbers - 1, 2, 3, 4, 5... AP series - 2, 4, 6, 8, 10...
Q7. Internal working of hashmap
Hashmap is a data structure that stores key-value pairs and uses hashing to retrieve values quickly.
Hashmap uses an array to store the key-value pairs
The keys are hashed to generate an index in the array
Collisions can occur when multiple keys hash to the same index
To handle collisions, hashmap uses linked lists or trees
Retrieving a value from hashmap involves hashing the key to get the index and then traversing the linked list or tree to find the value
Q8. Difference between hashmap and hastable
HashMap allows null values and keys, while Hashtable does not. HashMap is not synchronized, Hashtable is synchronized.
HashMap allows null values and keys, while Hashtable does not
HashMap is not synchronized, Hashtable is synchronized
HashMap is faster than Hashtable
Q9. Explain string pool
String pool is a mechanism in programming languages where strings are stored in a shared memory area to optimize memory usage.
String literals are stored in a pool to avoid duplicate storage.
Strings are immutable in the pool, meaning they cannot be changed.
When a new string is created, the JVM checks if it already exists in the pool before creating a new instance.
More about working at Accenture
Interview Process at Marsh McLennan
Reviews
Interviews
Salaries
Users/Month