Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)
HackerRank Online Assessment Experience (Java + SQL + Debugging)
The test had 4 sections covering MCQs, SQL, bug fixing, and coding.
Time -> 70 minutes.
📌 Section 1 – Java MCQs (4 Questions)
Mix of single and multiple-choice questions focused on core Java concepts:
- Code snippet involving Stack vs Queue behavior. You had to predict the correct output based on insertion/removal order.
- Difference between Vector and ArrayList – mainly around synchronization and performance.
- Understanding the root cause of the Java Exception hierarchy – concepts of Throwable, Error, and Exception.
- Basic Java Garbage Collection question – when objects are eligible for GC, and what makes them unreachable.
📌 Section 2 – SQL Query
Two tables were provided:
- Table 1: id, email
- Table 2: id, date
Task:
Write a SQL query to fetch email IDs where the associated date falls on a weekend (Saturday/Sunday). Required good understanding of JOIN, DATE functions, and filtering logic.
My Solution ->
SELECT t1.email, DAYNAME(t2.date) AS day_name
FROM table1 t1
JOIN table2 t2 ON t1.id = t2.id
WHERE DAYOFWEEK(t2.date) IN (1, 7);📌 Section 3 – Java Debugging Task
You were given a small Java web application with:
Controller, Service, Repository, Unit tests
Objective:
Fix the bugs in the code so that all unit tests pass. This tested understanding of Spring Boot annotations, dependency injection, and logic errors.
📌 Section 4 – Password Validation Coding Question
You were given a list of passwords and had to filter valid ones based on specific rules:
- Password is valid if:
- Length is greater than 5
- It must not contain only characters or only digits
⚠️ Tricky part: Passwords with only special characters (like @#$%) were considered valid


