Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)
Backend EngineerMorgan Stanley Interview Experience | Associate
AssociateMorgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)
Associate Java Backend HiringMorgan Stanley Interview Experience
Software EngineerMorgan Stanley | Senior Software Developer
Frontend Developer7 more experiences below
Summary
I recently interviewed for a Backend Engineer position at Morgan Stanley, focusing on Java and Microservices, leveraging my 2.4 years of experience. The process involved multiple technical rounds testing my DSA, System Design, and core Java knowledge, culminating in managerial and HR discussions.
Full Experience
Round 1 Online – Technical (Java + DSA + System Design Basics)
This round started with a deep dive into my resume, where we discussed my end-to-end projects in detail. Following that, I was asked questions on Data Structures and Algorithms, specifically regarding Anagrams and its variations.
The discussion then moved to Microservices concepts:
- How to track a request across microservices, focusing on Distributed Tracing.
- Questions about the build tools I have used in my projects.
- The flow of a CI/CD Pipeline.
- The responsibilities of an API Gateway in a microservices architecture.
Round 2 Offline – Technical + Low-Level Design + SQL
The second round, conducted offline, covered a broader range of topics:
- Explanation of SOLID principles and their real-world mapping.
- A comparison between Monolithic and Microservices architectures, including their pros, cons, and appropriate use cases.
- Another DSA question, this time on spiral printing of a matrix.
- Detailed questions about Kubernetes, specifically deployment steps, scaling strategies, and managing instances.
- A Low-Level Design (LLD) problem where I had to write a complete service on paper, detailing the flow from Controller to Service, DAO, and Entity layers.
- Two query-based SQL questions (details not specified).
- Discussions around UI Architecture.
- My latest project was also discussed, covering its architecture, my role, and the challenges I faced.
Round 3 – Advanced Java + Concurrency + Managerial
This round was split into technical and managerial sections.
Technical Questions:
- A multithreading scenario: find the highest number in a random matrix using multiple threads.
- Explanation of CAS (Compare-And-Swap) in Java.
- Discussion on transaction management in Java.
Managerial Questions:
- My reaction if I were asked to report to a junior colleague.
- How I would react if I was not promoted.
- My problem-solving approach: do I solve first and ask later, or understand from others and then solve?
SQL Conceptual:
- Given
table1(10 rows) andtable2(20 rows), what would be the output count ofSELECT * FROM table1, table2? - After deleting 10 rows from
table1, what would be the expected output count from the same query?
HR Round – Discussion
The final round was a standard HR discussion covering:
- My basic details, current role, and responsibilities.
- My current residence and relocation preferences.
- My current and expected CTC.
- What I know about Morgan Stanley and their stock.
- Why I want to join Morgan Stanley, requiring justification.
- My willingness to move to Bangalore and the justification for it.
Interview Questions (17)
Discuss problems related to identifying anagrams of strings and their various common problem variations.
Explain how to track a request as it flows across multiple microservices in a distributed system, specifically discussing concepts like Distributed Tracing.
Discuss common build tools used in project development.
Describe the end-to-end flow of a Continuous Integration/Continuous Delivery (CI/CD) pipeline.
Explain the key responsibilities and functions of an API Gateway in a microservices architecture.
Explain the SOLID principles of object-oriented design and provide examples of their real-world application.
Compare and contrast Monolithic and Microservices architectures, discussing their pros, cons, and appropriate use cases.
Given a matrix, print its elements in spiral order.
Discuss the steps involved in deploying applications using Kubernetes, including concepts of scaling and managing instances.
Design a complete service on paper, outlining its architecture from Controller to Service layer, Data Access Object (DAO), and Entity mapping.
Design a multithreaded solution to find the highest number in a randomly generated matrix.
Explain the Compare-And-Swap (CAS) operation in Java, including its usage and benefits in concurrent programming.
Discuss transaction management concepts and implementations in Java applications.
How would you react if you were asked to report to a colleague who is junior to you in terms of experience or tenure?
How would you react if you were not promoted, especially if you felt you deserved it?
Describe your preferred problem-solving approach: do you attempt to solve problems independently first, or do you seek understanding and input from others before proceeding?
Given two tables, table1 with 10 rows and table2 with 20 rows, what is the expected output count of SELECT * FROM table1, table2? Also, what would be the expected output count after deleting 10 rows from table1?
Summary
I interviewed for an Associate role at Morgan Stanley, completing multiple rounds focused on technical skills, system design, and managerial discussions, and was ultimately selected for the position.
Full Experience
Exp: 4 years College: Tier 3 Current Role: SSE at product based- Backend development Tech Stack: Java, Spring Boot, Spark
Round1:
- Resume Discussion on one of the project
- Given an array Find next permutation
- LLD discussion of Snake and Ladder Game- classes , design patterns and OOP concepts
Round2:
- HLD discussion of one of the project in depth
- Given an array of heights, for each element find differences of indices to the next taller height. If no taller height, return -1 for the element.
Round3- Hiring Manager:
- Resume discussion
- Java17 features usage Discussion in real life.
- How to Migrate Java version without gradle- mainly challenges
- Discussion on Kafka- UI, usecase, partitioning and difference with MQ
- Scenario based question on Multithreaded batch processing- stuck in deadlock- Identify issues
- Some discussion on Caches and real-life implementation details (Since I used it so needed to explain that)
- Difference between Singleton and Decorator Pattern
- Checks before taking software to production
- Discussion on Exception handling
- How to identify and resolve if Database goes in deadlock situation
- Some Batch processing runs for 15 minutes now its time increases to 45 minutes. Identification and resolution discussion.
Round4: HR:
- Behavioural Questions
- Cultural Fit
One more round scheduled to check if I will be able to fit their Big Data Team.
Round5- Discussion with VP:
- Project discussion in depth
- Discussion on how well SQL and data based solutions I have worked on
- Discussion on What kind of Big Data Based problems currently they are working on.
Verdict: Selected. Waiting for final Numbers. Unofficial Numbers: https://leetcode.com/discuss/post/6958673/morgan-stanley-associate-offer-by-anonym-lsu4/
Interview Questions (13)
Given an array, find its next lexicographically greater permutation.
Low-Level Design (LLD) discussion of Snake and Ladder Game, focusing on classes, design patterns, and OOP concepts.
Given an array of heights, for each element find differences of indices to the next taller height. If no taller height, return -1 for the element.
Discussion on Java 17 features usage in real-life scenarios.
How to migrate Java version without Gradle, mainly discussing the challenges.
Discussion on Kafka, including its UI, use case, partitioning, and difference with MQ.
Scenario based question on multithreaded batch processing stuck in a deadlock. Identify issues.
Discussion on Caches and real-life implementation details, specifically based on my usage.
Difference between Singleton and Decorator Pattern.
Discussion on checks required before taking software to production.
Discussion on Exception handling strategies.
How to identify and resolve if a Database goes into a deadlock situation.
Scenario: A batch processing job runs for 15 minutes, now its time increases to 45 minutes. Identification and resolution discussion.
Summary
I completed an online assessment for an Associate Java Backend role at Morgan Stanley, which consisted of four sections: Java MCQs, SQL querying, Java debugging, and a coding challenge.
Full Experience
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
Interview Questions (7)
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.
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.
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.
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
Summary
I interviewed for a Software Engineer position at Morgan Stanley, which felt like a hiring drive. I was asked two algorithmic problems and a question on stack implementation, along with some general Java questions. Despite my efforts, I was rejected, and I attribute some of the difficulty to a rushed and unorganized interviewer.
Full Experience
Hi All,
Today I have given Morgan Stanley interview for Software Engineer postion. It was more of like a hiring drive.
Round 1:
Question1: Given an array of integers of positive numbers. Find the closest number with average of those numbers
Question2: Given the closing prices of a stock on a given day. Find the buying and selling day to maximize the profit. eg: 12, 5, 15, 22 output: [1, 3]
Then some Java related questions for around 10 mins
Then the interviwer asked for the stack implementation.
Verdict: Rejected.
Here's my anaysis what went wrong: Total Interview time: 45 mins Interviwer was in very hurry, firstly he joined 5 mins late for the interview. Then we greeted each other followed by introduction. This eat up around 5 more minutes. Total time left: 35 min Secondly the interviwer was not ready with questions itself, when i ask him some doubt eg: input can be pos/neg, sample input/output. He was taking sometime to give proper responses. He was in very hurry, i told him let me explain the approach first but he kept on insisting to code it. I mean why?? without discussing approach how do you even know solution will work or not, or can be furthure enchanced. When i coded the solution, he started pointing out minor details like loop can be started from index 1 not from 0 also, I agreed. But how does it improve Time complexity, I mean wtf is this? it seems he was just trying to be more smarter.
Then on the stack implementation, I provided him the code and he was like this is not traditional appraoch, I was like so..?? The code is correct it does the job and anyhow, i don't remember the actual solution, whatever is coming to my mind i'm coding it infront of you.
Overall I feel like a bad interviwer has just ruined an opportunity
Interview Questions (3)
Given an array of integers of positive numbers. Find the closest number with average of those numbers
Given the closing prices of a stock on a given day. Find the buying and selling day to maximize the profit. eg: 12, 5, 15, 22 output: [1, 3]
Implement the stack data structure.
Summary
I interviewed for a Frontend Developer role at Morgan Stanley. The interview included rounds on JavaScript, React, a live coding task to build a carousel, and questions on pagination implementation. Despite confident answers, I received feedback that my basics were weak and accessibility was overlooked, which I found surprising given the lack of clear expectations.
Full Experience
I recently interviewed for a Frontend Developer role. The first round focused on JavaScript and React, while the second round involved a live coding task where I was asked to build a carousel. During the session, I was also presented with several JavaScript output-based questions, which I felt confident in answering.
Towards the end of the interview, I was asked how I would implement pagination—both infinite scrolling and numbered pagination. I explained multiple approaches, covering aspects such as state management, dynamic data loading, and overall user experience.
However, when I requested feedback, I was told that my “basics are weak” and was also criticized for not considering accessibility—for example, how someone who is visually impaired would interact with the pagination component.
While I deeply value the importance of accessibility and strongly believe in creating inclusive digital experiences, I was genuinely surprised by this feedback. Accessibility was never mentioned as a specific focus during the task. Had it been indicated as a requirement, I would have gladly addressed how to implement features like ARIA roles, keyboard navigation, and screen reader support.
As an engineer, I take accessibility seriously and care about building solutions that work for everyone. It was disheartening to be judged as lacking in this area simply because it wasn't part of my default explanation—especially without any indication that accessibility was being evaluated.
This experience reflects a broader concern: candidates should be evaluated based on clearly communicated expectations. Interviewers should provide guidance and context to enable fair assessments. When feedback is based on assumptions rather than what was actually asked or discussed, it risks overlooking capable and thoughtful developers.
Transparent and constructive interviews not only help candidates grow—they also strengthen the company’s reputation and ability to attract great talent.
Interview Questions (4)
I was asked to build a carousel component as a live coding task.
I was asked how I would implement pagination, covering both infinite scrolling and numbered pagination. I explained multiple approaches, covering aspects such as state management, dynamic data loading, and overall user experience. I was later criticized for not considering accessibility aspects like interaction for visually impaired users.
let object1 = { name: 'ABC', age: 20, callingFunction: function(){ console.log(this.name, this.age) } }
let object2 = { name: 'XYZ', age: 29, }
object1.callingFunction.call(object2);
What will be the output of this JavaScript code?
let value = 010101011000111010101011;
What will be the output (value)?
Summary
I recently participated in the Morgan Stanley (Code to Give) Online Assessment, which featured three sections: Debugging, Aptitude, and a Coding Round, covering problems like House Robber and variants of array manipulation challenges.
Full Experience
I recently took the Morgan Stanley (Code to Give) Online Assessment. The assessment was structured into three distinct sections.
Debugging Section
This section comprised 10 questions that I had to complete within 20 minutes. The problems were primarily focused on easy syntax-related issues, including tasks like correcting code for matrix addition, bubble sort, selection sort, and string comparison. All of them required only minor adjustments.
Aptitude Section
The Aptitude section consisted of 24 general aptitude questions, for which I was allotted 40 minutes.
Coding Round
The final section was the Coding Round, where I had 60 minutes to solve 3 questions.
Interview Questions (3)
Summary
I successfully navigated the hiring process at Morgan Stanley for a Summer Analyst role, which included an Online Assessment, a technical interview covering DSA, SQL, and C programming concepts, and an HR round focusing on behavioral and project-related questions, ultimately receiving an offer.
Full Experience
I applied to Morgan Stanley for the Summer Technology Analyst role via their careers page in October 2023, without a referral. My resume was shortlisted, and I received an invitation for the Online Assessment on February 12, 2024.
Round-1 (Online Assessment)
I completed the Online Assessment on February 15. It consisted of three sections:
- Debugging Section: This section had debugging questions, to be solved in 20 minutes. I could choose any programming language. It was quite easy; a basic understanding of programming was sufficient to debug the questions.
- Aptitude Section: This section had 10 questions to be solved in 20 minutes, with a difficulty level ranging from easy to moderate.
- Coding Section: This section featured 3 programming questions, with a difficulty level comparable to LeetCode Easy-Medium. I was provided links for two of the questions: Merging Intervals and Level Order Tree Traversal. I managed to solve all three coding questions, and the debugging and aptitude sections also went well.
Round-2 (Technical Interview)
The very next day, on February 16, I received a call from HR informing me that I had cleared the Online Assessment. My technical interview was scheduled for February 20 at 2 PM. It was a Zoom call that lasted over 60 minutes, with two interviewers. They were friendly and made me feel comfortable. First, they asked me to introduce myself. Then, we moved on to SQL queries. They asked me 9-10 SQL queries, and since I had prepared well, I was able to write correct queries for almost all of them, which seemed to satisfy the interviewers. Next, they asked me a question related to C programming: they provided a piece of code, void func(){ int arr[10];}, and explained that this function was being called recursively an infinite number of times, given a system memory of 2 MB. They asked if this scenario would result in an error or a system crash. I was able to answer this question to their satisfaction. Following that, they asked about the difference between "call by value" and "call by reference," requesting an explanation with an example. Finally, they posed a medium-level DSA question, for which I successfully provided the logic and wrote pseudocode. The interviewers seemed happy with my approach. The interview concluded after they asked if I had any questions for them.
Round-3 (HR Round)
I received another call from HR the day after my technical interview, on February 21, with positive feedback from the panel. My HR round was scheduled for February 22. Before this round, I extensively read past Morgan Stanley HR interview experiences, researched the company and its core values, and prepared for common behavioral questions. The HR interview was also a Zoom call. The interviewer joined a bit late and immediately asked me to introduce myself. We then discussed a project mentioned on my resume, specifically why I chose MongoDB over a SQL database. Afterward, they asked several behavioral questions:
- What are your aspirations and career plans?
- Why do you want to join Morgan Stanley?
- What do you know about the business side of Morgan Stanley?
- What are the core values of Morgan Stanley?
- Given two teams, one working on Python and the other on C++, which team would I prefer to join and why?
- Could I describe a scenario where I had to sacrifice my ethics?
- Could I tell an interesting incident related to my project?
- Presented with a scenario: I'm part of a team tasked with delivering a product in one month, but some hypothetical bugs cannot be fixed within that deadline. My options are to deliver the product late or deliver it with bugs. What would I do?
The interview lasted about 30 minutes. The interviewer asked if I had any questions before it ended.
Exactly three weeks later, I received an email confirming my shortlisting for the Summer Analyst role at Morgan Stanley for the Summer of 2024.
Interview Questions (13)
Given a C function void func(){ int arr[10];} that is called recursively an infinite number of times, and a system with 2 MegaBytes of memory, would this lead to an error or system crash? Explain the underlying memory management.
Explain the fundamental differences between "call by value" and "call by reference" parameter passing mechanisms in programming, providing a clear example for each.
Explain your rationale for choosing MongoDB over a traditional SQL database for a project, detailing the advantages and disadvantages for your specific use case.
What are your long-term career aspirations and how do you plan to achieve them?
What specifically attracts you to Morgan Stanley, and why do you want to join our company?
What do you know about the business side of Morgan Stanley and its operations?
Discuss Morgan Stanley's core values and how you see yourself aligning with them.
If you had the choice between joining a team working primarily with Python and another working with C++, which would you prefer and why?
Describe a situation where you had to make a difficult decision that involved potentially compromising your ethics, and how you handled it.
Share an interesting or challenging incident that occurred during one of your projects and how you addressed it.
You are working on a team with a one-month deadline to deliver a product to a client, but some critical bugs cannot be removed within this timeframe. You have two options: deliver the product late, or deliver it with known bugs. What would you do and why?
Preparation Tips
My preparation involved several key areas. For the HR round, I diligently read past Morgan Stanley interview experiences and thoroughly researched the company's core values and business operations. I also prepared for common behavioral questions. For the technical aspects, I focused on practicing Data Structures & Algorithms, including problems like "Merging Intervals" and "Level Order Tree Traversal", and also brushed up on SQL queries and C programming concepts like call by value/reference and memory management in recursive functions.
My general tip is to be patient and maintain self-belief throughout the process, and always review past interview experiences before your own.
Summary
I navigated an off-campus hiring process for a Technology Analyst role at Morgan Stanley in July 2023, which included a HireVue assessment, an SHL Online Assessment with DSA problems, and two rounds of technical interviews covering LeetCode-style problems and core computer science concepts.
Full Experience
I initiated my off-campus job search by sending direct inmails to various recruiters and talent acquisition managers at Morgan Stanley. This proactive approach led to a LinkedIn message from a recruiter regarding an open position. After sharing my resume and successfully passing the screening, I received an application link to their Careers Portal.
The application process involved creating an account on their student and graduate careers page, uploading my details, and submitting an updated resume. My resume strategy involved using a one-column format for better ATS scores, detailing experiences with metrics, target audience, and impact, and highlighting my top three experiences, key projects, and notable achievements. I utilized Overleaf for its ease of use in formatting.
Following the resume screening, I was invited to complete a HireVue Digital Questionnaire, which consisted of four behavioral questions with allotted preparation and recording time. Soon after, I was shortlisted for the next stage and attended an informative session detailing the job description and hiring process. This was followed by an Online Assessment on the SHL Testing Platform.
Online Assessment
The 90-minute assessment had three sections. The first covered aptitude questions, assessing logical reasoning and numerical ability. The second focused on debugging code snippets and determining program output. The final section featured three Data Structures and Algorithms questions of medium-hard difficulty. These were unique, scenario-based problems, not directly from LeetCode. I managed to solve two questions completely and passed most test cases for the third, failing only two hidden cases. It's worth noting that there was section-based timing.
Interview Rounds
I received notification for my interview rounds shortly after.
Round 1: Technical Interview
The first round began with a standard self-introduction, followed by a discussion about my preferred tech stack and architectural choices in my projects. The interviewer also questioned me on fundamental concepts like SOLID principles, ACID properties, the Publisher-Subscriber model, and Consistent Hashing.
I was then given two LeetCode-style problems. For the first, similar to LFU Cache, I drew upon my experience with LRU Cache to devise a solution. The interviewer provided three test cases, and I successfully performed a dry run, matching the expected outputs. For the second problem, similar to Count the Number of Ideal Arrays, I initially proposed a recursive solution with poor time complexity. The interviewer hinted at a mathematical approach, and while I attempted to pivot to a DP solution, it didn't seem to fully satisfy them.
Round 2: Technical and Behavioral Interview
The second interviewer was very supportive. They presented a problem similar to Palindrome Partitioning, with additional constraints: all palindromes had to be distinct and non-overlapping. After I presented a satisfactory approach, a further constraint was added: each partition should be of a specific length 'p'. We discussed the time complexity of my solution, and I performed a detailed dry run with test cases. A key strength during this round was my constant communication, explaining my thought process, problem-breaking strategy, and reasoning behind my chosen approach.
Subsequently, the discussion shifted to C++ memory management, including questions on structs, unions, and object-oriented concepts like Pure Virtual Functions and Friend Functions. I also clarified the differences between void and NULL. The round concluded with general HR questions, which I addressed without difficulty.
Interview Questions (3)
Given a string, partition it such that each substring in the partition is a palindrome. Additionally, all palindromes should be distinct and non-overlapping, and each partition must be of a fixed length 'p'. I discussed my approach, its time complexity, and performed dry runs for given test cases, explaining my thought process throughout.
Preparation Tips
My preparation for this off-campus opportunity involved several key areas. I proactively reached out to recruiters and spent considerable effort optimizing my resume. I used a one-column format for better ATS compatibility, detailed my experiences with quantifiable metrics, and highlighted my top projects and achievements. Overleaf proved invaluable for hassle-free resume editing.
Technically, I focused on building a strong foundation in Data Structures and Algorithms. I paid close attention to time and space complexity constraints, recognizing their importance in competitive environments. During mock interviews and practice, I honed my ability to articulate my thought process, breaking down problems and explaining my chosen approaches clearly. This constant communication of my ideas was a significant advantage.
Additionally, I aimed to stay updated with industry standards, learning new frameworks and skills to differentiate myself, as foundational knowledge in core subjects and DSA is expected of all candidates. Patience was also a critical aspect of my preparation, understanding that hiring processes can be lengthy and outcomes are not always immediate or solely dependent on technical proficiency.
Summary
I interviewed for a Software Engineer position at Morgan Stanley in Bangalore, which involved four rounds covering data structures, Java, SQL, system design, and behavioral aspects. I shared my 3 years of experience across product and service-based companies.
Full Experience
I went through an interview process with Morgan Stanley for a Software Engineer role in Bangalore. My professional background spans approximately 3 years, comprising 1.5 years at a product-based startup and 1.4 years at a service-based MNC.
The entire process was structured into four distinct rounds.
Round 1: Online Assessment
This round consisted of 10 Multiple Choice Questions and 2 coding problems which were comparable to LeetCode Medium difficulty.Round 2: Technical Interview I
This interview focused on both Data Structures and Java. For DS, I was asked to:- Find a loop in a Linked List, with a follow-up to remove it.
- Check if a Linked List is a palindrome.
- Explanation and code implementation of the Singleton design pattern.
- Detailed discussion of OOPS concepts with examples.
- The differences between
StringandStringBuffer. - The internal working mechanism of HashMap.
- SQL queries, specifically for finding the 3rd highest salary and general join-related questions.
- When to choose NoSQL databases over SQL databases.
Round 3: Technical Interview II
This round also heavily focused on Data Structures and Java, with a strong emphasis on optimization and exploring multiple approaches for each problem. The DS questions included:- Finding the starting point of a loop in a Linked List.
- Identifying the first non-repeating character in a string.
- Sorting an array after squaring its elements.
- Finding the longest common prefix of an array of strings.
- The internal working of both HashMap and HashSet.
- Strategies for handling a large number of incoming requests in a system.
- Discussion on different memory areas within the JVM.
Hiring Manager Round
This final round involved broader discussions around my experience and technical decisions:- A brief discussion on my projects.
- Justification for using particular technologies in my projects.
- How I implemented fallback mechanisms in my systems.
Interview Questions (17)
How do you find a loop in a linked list? What is the follow-up to remove the loop from the linked list?
How do you check if a given linked list is a palindrome?
Explain the Singleton design pattern and provide a code implementation for it.
Explain Object-Oriented Programming (OOPS) concepts with examples.
What are the differences between String and StringBuffer in Java?
Explain the internal working mechanism of HashMap in Java.
Write SQL queries to find the 3rd highest salary. Also, discuss and provide examples for join-related questions.
When would you choose a NoSQL database over a SQL database? Discuss the scenarios and reasons.
How do you find the starting node (or entry point) of a loop in a linked list?
Find the first non-repeating character in a given string.
Given a sorted array, return a new array containing the squares of all numbers, also sorted in non-decreasing order.
Find the longest common prefix string amongst an array of strings.
Explain the internal working of both HashMap and HashSet in Java.
How would you design a system to handle a large number of incoming requests?
Explain the different memory areas within the Java Virtual Machine (JVM).
During project discussions, you may be asked to justify why you chose a particular technology or framework.
Explain how you have implemented a fallback mechanism in your previous projects or systems.
Summary
I interviewed for a Web Developer (Application Development) role at Morgan Stanley. The online assessment consisted of MCQs on programming fundamentals, SQL, JavaScript, and CSS, followed by two coding questions: a 0/1 Knapsack problem and a modified Trapped Rainwater problem. I completed the test but have not yet received a response.
Full Experience
Hi Leetcoders,
I recently started my job search last month and applied for the Web Developer (Application Development) role at Morgan Stanley. After about a week of applying, I received an invite to attempt their Hackerrank assessment.
Online Test
Section 1
This section contained 10 Multiple Choice Questions (MCQs) covering Basic Programming, SQL, Javascript snippets, and CSS output. I remember that 5 out of the 10 questions were specifically focused on CSS properties.
Section 2
This section presented two easy/medium LeetCode-style coding questions. A crucial detail was that there was a restriction to write code in Javascript only.
- Q1: This was a classic 0/1 Knapsack problem.
- Q2: The second question was described as a modification of the standard Trapped Rainwater problem.
I managed to attempt all the questions of the test within the given time. However, I still haven't received any response from them. I've been wondering if this has happened to anybody else as well?
Interview Questions (2)
Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. This was specifically the 0/1 variant, meaning each item could either be taken or not taken.
This question was presented as a modification of the classic 'Trapping Rain Water' problem. The standard problem involves calculating how much water can be trapped between bars of varying heights. While the exact modifications were not specified, the core concept of trapping rainwater between elevations was central to the problem.
Summary
I interviewed for an SDE - II position at Morgan Stanley in India in July 2021 and successfully received an offer after navigating through 4 rounds that covered coding, core Java, system design, and managerial aspects.
Full Experience
I interviewed for the SDE - II role at Morgan Stanley in July 2021. I have 4.5 years of experience as a backend developer. The interview process consisted of 4 rounds.
Round 1: Hacker Rank Online (1 Hour)
This round included a mix of MCQs and one medium-level coding question.
Round 2: Technical (1 Hour)
This round primarily focused on Core Java and Multithreading. I was asked two data structure questions:
- The classic House Robber problem (medium difficulty).
- A problem involving searching in a matrix sorted by row (medium difficulty).
Round 3: Technical (1 Hour)
This round covered Core Java and Spring topics. I also solved one data structure question:
- Removing consecutive characters in a string (easy difficulty).
Round 4: Technical + Managerial (50 minutes)
This was a comprehensive round combining technical and managerial aspects. I faced system design problems, specifically discussing how to remove duplicate lines from a 10 GB file with only 2 GB of memory. Other topics included basic memory management, garbage collection, detecting performance issues in production, and discussions related to my projects. Additionally, there was one data structure question:
- Given an input array and a desired output array, I had to return the sequence of stack operations to transform the input to produce the output. For example, for an input
[2,3,4,5,6]and output[3,4,5,2,6], the answer would involve operations like[push-2, push-3, push-4, pop-4, push-5...].
After successfully completing all these rounds, I received an offer.
Interview Questions (5)
Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police. Adjacent houses have security systems connected and will automatically contact the police if two adjacent houses are broken into on the same night.
Given an m x n matrix where each row is sorted in non-decreasing order, write an algorithm to search for a target value in the matrix.
Given a string, remove all consecutive duplicate characters from it. For example, if the input is 'aaabbcddde', the output should be 'abcde'.
Design a system or algorithm to remove duplicate lines from a 10 GB file, given only 2 GB of available memory.
Given an input array and a desired output array, determine the sequence of stack operations (push, pop) required to transform the input array elements into the output array. Assume elements are pushed onto the stack from the input array in order.
Example:
Input: [2,3,4,5,6]
Output: [3,4,5,2,6]
Expected Answer Format: [push-2, push-3, push-4, pop-4, push-5...]
Summary
I interviewed with Morgan Stanley for a position within their Strata team in Mumbai, going through a challenging five-round process. The interviews extensively covered data structures and algorithms, system design, object-oriented programming, and brainteasers, with specific questions on database concurrency, API optimization, and array manipulations. I successfully completed the first two rounds and was progressing to subsequent stages.
Full Experience
I was contacted by Morgan Stanley HR regarding a requirement in their Strata team, which focuses on building software for MS trading platforms. This involves very high traffic from all share markets, with lots of real-time data processing, where both availability and consistency are mandatory. Each interview round lasted 30 minutes.
First Round
The first interviewer was from London, a Cambridge graduate and a veteran in technology with 14 years at Morgan Stanley. The round started with an introduction and a discussion about my future prospects and plans. He then provided an overview of the MS team and their products, followed by a discussion on my language proficiency and current tech stack. Two specific questions were asked:
- What is a percentile, how do you calculate it? Given a list of marks with role numbers, find a given role number's percentile. We discussed related complexity and optimization.
- Given a 3x3 grid, count the number of ways to fill numbers 1-9 uniquely in the grid.
We also talked about my current project, its shortcomings, and areas for improvement. Database discussions included 'Mongo vs Postgres: what's the flaw with Mongo vs Postgres?', 'How can concurrency be achieved in Mongo?', and 'What is the single granular level of concurrency at the DB level we can target to achieve?'
Second Round
This 30-minute round was conducted by an interviewer from the Hong Kong office. After an introduction, I was asked a question about API optimization:
- In an API, how can we optimize sending a large amount of data efficiently? The API's efficiency relies on the size of the data sent in the response. The data being sent is a stream of numbers, in sorted order, e.g., 1,1,1,1,1,1,1,1,1,2,2,9,9, 13,13,13,...
Following this, we discussed what I look for while reviewing a PR and multiple ways to optimize code. The interviewer also gave an overview of their product, codebase, and internal tech stack. We talked about how things work internally at Morgan Stanley and the responsibilities and use cases of the Strata team. There were some more questions, but I don't recall them now. Overall, this round went very well, and the interviewer seemed completely satisfied.
The verdict for the second round was positive, and I am currently waiting for the third round. The total process consists of 5 rounds, so I have 3 more to go.
Third Round (Edit)
The third round, lasting 30 minutes, was with the global head of the Strata team, based in the London office. He introduced himself, his team, how various teams are connected globally, their tech stack, and team size. He then inquired about my background, projects, tech stack, and particularly my interest in moving towards the finance domain in technology. I was asked if I was aware of any finance-related terminologies:
- What's a bond? (I could provide a basic answer).
- Types of bonds? (I had no answer for this).
He then asked about my favorite languages (I mentioned Java, PHP, JavaScript, but he noted Python from my resume). We then delved into Python specifics:
- Difference between tuple and list and their use cases.
- Types of data we can store inside a tuple and list.
I was asked what things I would optimize first in an application for a better user experience, to which I mentioned space and time. He then dug deeper into Python lists and tuples:
- Among tuple and list, which one is more memory efficient and time efficient, and how?
- How is memory allocation done for list and tuple?
My knowledge of tuples and lists was basic, so he continued to dig deeper. He asked if I knew NumPy (I said no), then pivoted to Java:
- What is method overloading and overriding in Java?
- Public and private specifiers in Java and their use cases with an example.
The round concluded with an opportunity for me to ask questions.
Fourth Round
This 30-minute round took place with an interviewer from the Luxembourg office. After introductions, I was asked why I was changing jobs. The technical part included two brainteasers:
- A 10-step ladder: a person can move one or two steps at a time. Count the number of ways they can reach the 10th step.
- Current time is 3:00 PM in a clock. At which time will both the minute and hour hands meet? Calculate.
Followed by Java-specific questions:
- Time series data `{timestamp: array of numbers}`: how will you store this data?
- What does the `==` operator check?
- Method overloading vs. overriding.
- Does Java support multiple inheritance? Why or why not? How do you resolve the multiple inheritance problem in Java?
And a Data Structures question:
- Given an array of numbers and a number X. Find a subarray whose sum is greater than X. We discussed this in detail.
I then asked about how things operate within their team, including tasks, projects, releases, and other activities, which she explained thoroughly. The interviewer was very helpful and cooperative, making it a good experience.
Fifth Round
The final 30-minute round was with an interviewer from the Budapest office. He introduced himself and discussed the team structure. The round started with a brainteaser:
- There are 7 people and a 6-faced dice. We need to pick a loser with a roll of the dice. How do we pick? Follow up: Suppose there is a cost of rolling a dice, so we have to pick the loser with minimum rolls of dice.
Followed by a Computer Science question:
- Given two arrays, find their intersection. I initially proposed an O(n^2) solution, then optimized it to O(n) using a hashset. The interviewer gave follow-ups:
- What if both arrays are sorted? I mentioned a solution similar to merging two arrays in merge sort, achieving O(m+n) time and constant space.
- What if one array is significantly larger than the other (e.g., one has 1 million elements, and the other has only 20)? I mentioned performing a binary search for each of the 20 elements, which would result in O(20 log 1 million) complexity.
The round concluded with an opportunity for me to ask questions.
Interview Questions (24)
Explain what a percentile is and how to calculate it. Given a list of marks with corresponding role numbers, find the percentile for a given role number. Discuss complexity and optimization.
Given a 3x3 grid, count the number of ways to fill it with numbers 1 through 9 uniquely.
Discuss the differences between MongoDB and PostgreSQL, highlighting the flaws or weaknesses of MongoDB compared to PostgreSQL.
Explain how concurrency is achieved in MongoDB.
Describe the single most granular level of concurrency that can be targeted at a database level.
How can an API be optimized to send a large stream of sorted numbers efficiently? The API's efficiency is directly dependent on the size of the data sent in the response. Example data: 1,1,1,1,1,1,1,1,1,2,2,9,9, 13,13,13,...
What factors do you consider when reviewing a Pull Request? What are various strategies to optimize code?
Explain what a bond is and describe different types of bonds.
Explain the differences between Python lists and tuples, and their respective use cases.
What types of data can be stored inside Python lists and tuples?
What aspects would you prioritize for optimization in an application to improve user experience?
Compare the memory and time efficiency of Python lists and tuples, explaining the underlying reasons.
Explain how memory is allocated for Python lists and tuples.
Explain method overloading and method overriding in Java.
Describe the public and private access specifiers in Java, their use cases, and provide an example for each.
A person is climbing a 10-step ladder and can move either one or two steps at a time. Count the number of distinct ways they can reach the 10th step.
Given the current time is 3:00 PM, calculate the next time when both the minute and hour hands of a clock will meet.
Given time series data structured as {timestamp: array of numbers}, how would you store this data efficiently?
What does the == operator check in Java?
Explain the difference between method overloading and method overriding in Java.
Does Java support multiple inheritance? Explain why or why not, and how the multiple inheritance problem is typically resolved in Java.
Given an array of numbers and an integer X, find a subarray whose sum is greater than X. Discuss the approach in detail.
You have 7 people and a 6-faced die. How can you use the die to pick a 'loser'? Follow-up: Assuming there's a cost per die roll, how do you pick the loser with the minimum number of rolls?
Given two arrays, find their intersection. Discuss different approaches and their complexities.
Follow-up 1: What if both arrays are sorted?
Follow-up 2: What if one array is significantly larger than the other (e.g., one has 1 million elements, the other has 20)?