Filter interviews by
I applied via Company Website and was interviewed in Sep 2024. There was 1 interview round.
Reverse a string while keeping the position of spaces intact
Split the string into an array of characters
Iterate through the array and reverse the characters while keeping track of space positions
Join the array back into a string
I applied via Naukri.com and was interviewed in Jan 2024. There was 1 interview round.
Round 1 was an online hackerank coding test + technical MCQs.
It consisted of 5 MCQs + 1 SQL problem + 1 DSA problem based on queue + 1 Graph question + 1 java based question to create a REST API.
I was interviewed in Oct 2021.
Round duration - 60 minutes
Round difficulty - Easy
Technical Interview round with questions on DSA and Java.
The brute force approach is to do a linear search. Traverse the array and keep track of maximum and element. And finally return the maximum element.
Time Complexity : O(n)
The efficient approach is to use Binary Search. The standard Binary search algorithm can be modified for the given type of arrays :
i) If the mid element is greater than both of its adjacent elements, then mid is the maximum.
ii) If mid...
Internal working of hash map in Java
Index Calculation in Hashmap :
Hash code of key may be large enough to create an array. hash code generated may be in the range of integer and if we create arrays for such a range, then it will easily cause outOfMemoryException. So we generate index to minimize the size of array. Basically following operation is performed to calculate index :
index = hashCode(key) & (n-1).
where n is number of buckets or t...
Why do we need to override equals and hashcode methods in Java?
Two objects are considered equal only if their references point to the same object, and unless we override equals and hashCode methods, the class object will not behave properly on hash-based collections like HashMap, HashSet, and Hashtable. This is because hash-based collections are organized like a sequence of buckets, and the hash code value of an object is used to determine the bucket where the object would be stor...
Round duration - 60 minutes
Round difficulty - Medium
Technical Interview round with questions based around Java.
Print even and odd numbers in increasing order using two threads in Java
The idea is to create two threads and print even numbers with one thread and odd numbers with another thread. Below are the steps:
Create two threads T1 and T2 using the below syntax, where T1 and T2 are used to print odd and even numbers respectively.
Thread T1 = new Thread(new Runnable() {
public void run() { mt.printEvenNumber(); }
});
Thread T2 = new Thread(new Runnable() {
public void run() { mt.printOddNumber(); }
});
wh...
Internal working of CopyOnWrite ArrayList ?
"Copy on write" means whenever there is write operation such as add, set and so on. it copies the underlying array. So it is a thread-safe variant of ArrayList in which all mutative operations (add, set, and so on) are implemented by making a fresh copy of the underlying array. So basic idea is whenever we add or remove to the CopyOnWriteArrayList, the underlying array is copied with the modification. Remember this poi...
Differences between Synchronized Collection and Concurrent Collection in Java
1. Synchronized Collection can be modified by one thread at a time(i.e. it is not possible to modify or access Synchronized Collection by multiple threads simultaneously). Concurrent Collection can be modified by multiple threads at a time(i.e. it is possible to modify or access Concurrent Collection by multiple threads simultaneously).
2. Concurrent Collection has high performance than Synchronized Collection because a...
Tip 1 : Thread concept is must for Morgan Stanley. So prepare that on priority
Tip 2 : Basic concepts of Oops/collection framework should be clear.
Tip 3 : Array based program will be asked so have some hands-on.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Morgan Stanley interview questions for designations
Top trending discussions
I applied via Indeed and was interviewed in Jul 2024. There was 1 interview round.
Objects of String are stored in the String Pool in Java.
String objects are stored in the String Pool, a special memory area in Java heap memory.
String literals are automatically stored in the String Pool.
String objects created using the new keyword are not stored in the String Pool.
String.intern() method can be used to store a String object in the String Pool.
A bean in Spring Boot is a Java object that is instantiated, assembled, and managed by the Spring IoC container.
Beans are defined in the Spring configuration file or using annotations like @Component, @Service, @Repository, etc.
Beans are singleton by default but can be scoped as prototype, request, session, etc.
Beans are injected into other beans using dependency injection.
Example: @Component annotation is used to defi
Query parameters are used to pass data to a web server through the URL, while path parameters are part of the URL itself.
Query parameters are key-value pairs added to the end of a URL after a '?'
Path parameters are variables within the URL path itself, denoted by curly braces {}
Example of query parameter: www.example.com/api/users?id=123
Example of path parameter: www.example.com/api/users/{userId}
Exceptions are recoverable errors that can be handled in code, while errors are unrecoverable issues that usually result in program termination.
Exceptions are checked at compile time, while errors are unchecked.
Exceptions are subclasses of Throwable, while errors are subclasses of Error.
Examples of exceptions include FileNotFoundException, NullPointerException, while examples of errors include OutOfMemoryError, StackOv
I applied via Indeed and was interviewed in Feb 2024. There was 1 interview round.
Answers to common Java Developer interview questions
1) Concurrency is achieved using multithreading in Java. Use threads, executors, or synchronized blocks. Example: using ExecutorService to run multiple tasks concurrently.
2) Rest API in Springboot: Entity class defines database table, Service class contains business logic, Repository class interacts with database, Controller class handles HTTP requests.
3) Volatile key...
I applied via Naukri.com and was interviewed in Oct 2023. There were 2 interview rounds.
Design patterns are reusable solutions to common problems in software design. Singleton ensures a class has only one instance, while factory creates objects without specifying the exact class.
Design patterns are best practices for solving common software design problems.
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Factory pattern creates objects without specifying ...
Create a Spring Boot program to accept JSON requests and process the data.
Create a Spring Boot application with a REST controller to handle incoming JSON requests.
Use @PostMapping annotation to map the endpoint for accepting JSON requests.
Use @RequestBody annotation to bind the incoming JSON data to a Java object.
Process the JSON data as needed in the controller method.
Return a response as JSON if required.
3 coding questions were given and to be solved only in java
posted on 25 Nov 2022
I applied via Company Website and was interviewed in May 2022. There were 2 interview rounds.
Java coding and apptitude questions
I worked on a project to develop a web application for an e-commerce company.
Developed the front-end using HTML, CSS, and JavaScript
Implemented the back-end using Java and Spring framework
Integrated payment gateway and order management system
Optimized database queries for improved performance
I worked at XYZ Company as a Java Developer.
Developed and maintained Java applications for XYZ Company.
Collaborated with a team of developers to implement new features and fix bugs.
Used Java frameworks like Spring and Hibernate to build robust and scalable applications.
Worked on database design and optimization using SQL.
Participated in code reviews and provided feedback to improve code quality.
Implemented unit tests t...
Associate
3k
salaries
| ₹5.1 L/yr - ₹19.1 L/yr |
Senior Manager
2.5k
salaries
| ₹15.9 L/yr - ₹54 L/yr |
Manager
2k
salaries
| ₹10.6 L/yr - ₹42 L/yr |
Senior Associate
1.5k
salaries
| ₹7.1 L/yr - ₹26 L/yr |
Vice President
1.2k
salaries
| ₹21 L/yr - ₹80 L/yr |
JPMorgan Chase & Co.
Goldman Sachs
TCS
Deloitte