119 questions · from 15 interviews · 1 asked more than once

Morgan Stanley interview questions

Every question candidates reported from their Morgan Stanley interviews, most frequently asked first. Each links to the write-up it came from, so you can see the round and how it went.

Morgan Stanley coding and DSA questions

  1. 01

    House Robber

    I encountered a problem similar to 'House Robber I', though its exact wording was different.

    Medium · Asked 2 times · From 📍📍 Morgan Stanley (Code to Give) Online Assessment Questions

  2. 02

    XOR Array Traversal

    Problem based on XOR operation combined with array traversal. The solution passed all 15 test cases in the coding section of the online assessment.

    From Morgan Stanely Intern 2027 OA + Interview (On Campus)

  3. 03

    3D Knapsack Problem

    A 3‑dimensional knapsack problem was presented in the coding section of the online assessment. The solution passed all 22 test cases.

    From Morgan Stanely Intern 2027 OA + Interview (On Campus)

  4. 04

    Generate Strings of Length ≥3 from Given Characters

    Given a vector ['a','b','c','d','e'], generate all possible strings formed with these characters where the string length is at least 3. I solved this using recursion and backtracking during the technical interview round.

    From Morgan Stanely Intern 2027 OA + Interview (On Campus)

  5. 05

    Group Anagrams

    I was asked a LeetCode question related to grouping anagrams.

    From Morgan Stanley - R1- Jan 2026

  6. 06

    Multithreaded File Processing

    How to scale more than 100 threads efficiently in Java. Write a program that reads a file and writes in a different file using multithreading/concurrent programming.

    From Morgan Stanley Sr. Java Dev 6 YOE Reject Q3 2025

  7. 07

    HashMap Internal Working

    Explain the internal working of Java's HashMap.

    From Morgan Stanley Sr. Java Dev 6 YOE Reject Q3 2025

  8. 08

    Anagrams and its Variations

    Discuss problems related to identifying anagrams of strings and their various common problem variations.

    Medium · From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  9. 09

    Spiral Matrix Traversal

    Given a matrix, print its elements in spiral order.

    Medium · From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  10. 10

    Find Max in Matrix using Threads

    Design a multithreaded solution to find the highest number in a randomly generated matrix.

    Hard · From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  11. 11

    Next Permutation

    Given an array, find its next lexicographically greater permutation.

    Medium · From Morgan Stanley Interview Experience | Associate

  12. 12

    Next Taller Height Index Difference

    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.

    Medium · From Morgan Stanley Interview Experience | Associate

  13. 13

    Password List Validation

    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 @$%)…

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  14. 14

    Closest Number to Average in Array

    Given an array of integers of positive numbers. Find the closest number with average of those numbers

    Medium · From Morgan Stanley Interview Experience

  15. 15

    Best Time to Buy and Sell Stock (Indices)

    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]

    Medium · From Morgan Stanley Interview Experience

  16. 16

    Implement Stack

    Implement the stack data structure.

    Easy · From Morgan Stanley Interview Experience

  17. 17

    Build a Carousel Component

    I was asked to build a carousel component as a live coding task.

    Medium · From Morgan Stanley | Senior Software Developer

  18. 18

    JavaScript 'this' Context with Call Method

    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?

    Easy · From Morgan Stanley | Senior Software Developer

  19. 19

    JavaScript Octal Literal Interpretation

    let value = 010101011000111010101011; What will be the output (value)?

    Easy · From Morgan Stanley | Senior Software Developer

  20. 20

    Shortest Subarray to Be Removed to Make Array Sorted

    The task was to find the number of subarrays that could be removed such that the remaining array became strictly increasing and non-empty.

    Medium · From 📍📍 Morgan Stanley (Code to Give) Online Assessment Questions

  21. 21

    Subarrays with K Different Integers

    This problem asked me to find subarrays with exactly k different integers, presented with different wording than the standard LeetCode problem.

    Hard · From 📍📍 Morgan Stanley (Code to Give) Online Assessment Questions

  22. 22

    Merge Intervals

    Given a collection of intervals, merge all overlapping intervals. For example, merge [1,3] and [2,6] into [1,6] .

    Medium · From Morgan Stanley Interview Experience for Summer Technology Analyst

  23. 23

    Level Order Tree Traversal

    Given the root of a binary tree, traverse and print its nodes level by level, meaning all nodes at the current depth are processed before moving to the next depth.

    Easy · From Morgan Stanley Interview Experience for Summer Technology Analyst

  24. 24

    LFU Cache

    Design and implement a data structure for a Least Frequently Used (LFU) cache. I discussed my approach based on variations of the LRU Cache problem, and then performed a dry run for provided test cases.

    Hard · From Morgan Stanley | Technology Analyst | US | July 2023

  25. 25

    Count the Number of Ideal Arrays

    I initially proposed a recursion-based solution, but the interviewer hinted at a mathematical approach due to its time complexity issues. I attempted to adapt it to a DP solution, but it didn't fully satisfy the interviewer.

    Hard · From Morgan Stanley | Technology Analyst | US | July 2023

17 more in the Morgan Stanley write-ups.

Morgan Stanley system design questions

  1. 01

    Battleship Game Class Design

    Create the classes for a Battleship game.

    From Morgan Stanley Sr. Java Dev 6 YOE Reject Q3 2025

  2. 02

    Distributed Tracing in Microservices

    Explain how to track a request as it flows across multiple microservices in a distributed system, specifically discussing concepts like Distributed Tracing.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  3. 03

    API Gateway Responsibilities

    Explain the key responsibilities and functions of an API Gateway in a microservices architecture.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  4. 04

    Monolithic vs. Microservices Architecture

    Compare and contrast Monolithic and Microservices architectures, discussing their pros, cons, and appropriate use cases.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  5. 05

    Kubernetes Deployment and Scaling

    Discuss the steps involved in deploying applications using Kubernetes, including concepts of scaling and managing instances.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  6. 06

    Low-Level Design of a Service

    Design a complete service on paper, outlining its architecture from Controller to Service layer, Data Access Object (DAO), and Entity mapping.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  7. 07

    LLD: Snake and Ladder Game

    Low-Level Design (LLD) discussion of Snake and Ladder Game, focusing on classes, design patterns, and OOP concepts.

    From Morgan Stanley Interview Experience | Associate

  8. 08

    Implement Pagination (Infinite Scrolling & Numbered)

    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…

    Medium · From Morgan Stanley | Senior Software Developer

  9. 09

    MongoDB vs. SQL Database Choice

    Explain your rationale for choosing MongoDB over a traditional SQL database for a project, detailing the advantages and disadvantages for your specific use case.

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  10. 10

    SQL vs NoSQL

    When would you choose a NoSQL database over a SQL database? Discuss the scenarios and reasons.

    From Morgan Stanley | Bangalore | Senior Associate | Mid April 2022 | India

  11. 11

    Handling High Incoming Requests

    How would you design a system to handle a large number of incoming requests?

    From Morgan Stanley | Bangalore | Senior Associate | Mid April 2022 | India

  12. 12

    Fallback Mechanism Implementation

    Explain how you have implemented a fallback mechanism in your previous projects or systems.

    From Morgan Stanley | Bangalore | Senior Associate | Mid April 2022 | India

  13. 13

    Remove Duplicate Lines from Large File

    Design a system or algorithm to remove duplicate lines from a 10 GB file, given only 2 GB of available memory.

    From Morgan Stanley | SDE - II | India | July 2021 | Offer

  14. 14

    MongoDB vs. PostgreSQL Comparison

    Discuss the differences between MongoDB and PostgreSQL, highlighting the flaws or weaknesses of MongoDB compared to PostgreSQL.

    Medium · From Morgan Stanley | Mumbai | 2021 | Macro Strata Team

  15. 15

    Concurrency in MongoDB

    Explain how concurrency is achieved in MongoDB.

    Medium · From Morgan Stanley | Mumbai | 2021 | Macro Strata Team

  16. 16

    Granular Concurrency in Databases

    Describe the single most granular level of concurrency that can be targeted at a database level.

    Hard · From Morgan Stanley | Mumbai | 2021 | Macro Strata Team

  17. 17

    Optimize API for Large Sorted Data Stream

    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,...

    Hard · From Morgan Stanley | Mumbai | 2021 | Macro Strata Team

  18. 18

    Storing Time Series Data

    Given time series data structured as {timestamp: array of numbers} , how would you store this data efficiently?

    Hard · From Morgan Stanley | Mumbai | 2021 | Macro Strata Team

Morgan Stanley behavioural and HR questions

  1. 01

    Reporting to a Junior Colleague

    How would you react if you were asked to report to a colleague who is junior to you in terms of experience or tenure?

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  2. 02

    Reaction to Not Being Promoted

    How would you react if you were not promoted, especially if you felt you deserved it?

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  3. 03

    Problem-Solving Approach

    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?

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  4. 04

    Career Aspirations and Plans

    What are your long-term career aspirations and how do you plan to achieve them?

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  5. 05

    Why Morgan Stanley?

    What specifically attracts you to Morgan Stanley, and why do you want to join our company?

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  6. 06

    Knowledge of Morgan Stanley's Business

    What do you know about the business side of Morgan Stanley and its operations?

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  7. 07

    Morgan Stanley Core Values

    Discuss Morgan Stanley's core values and how you see yourself aligning with them.

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  8. 08

    Team Preference: Python vs. C++

    If you had the choice between joining a team working primarily with Python and another working with C++, which would you prefer and why?

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  9. 09

    Scenario: Sacrificing Ethics

    Describe a situation where you had to make a difficult decision that involved potentially compromising your ethics, and how you handled it.

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  10. 10

    Interesting Project Incident

    Share an interesting or challenging incident that occurred during one of your projects and how you addressed it.

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  11. 11

    Scenario: Product Delivery Dilemma

    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?

    From Morgan Stanley Interview Experience for Summer Technology Analyst

  12. 12

    Technology Choices Justification

    During project discussions, you may be asked to justify why you chose a particular technology or framework.

    From Morgan Stanley | Bangalore | Senior Associate | Mid April 2022 | India

Morgan Stanley other questions

  1. 01

    Spring Security Concepts

    The interviewer asked questions related to Spring Security.

    From Morgan Stanley - R1- Jan 2026

  2. 02

    Multithreading Concepts

    Questions on multithreading were discussed during the round.

    From Morgan Stanley - R1- Jan 2026

  3. 03

    Build Tools Discussion

    Discuss common build tools used in project development.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  4. 04

    CI/CD Pipeline Flow

    Describe the end-to-end flow of a Continuous Integration/Continuous Delivery (CI/CD) pipeline.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  5. 05

    SOLID Principles and Real-World Applications

    Explain the SOLID principles of object-oriented design and provide examples of their real-world application.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  6. 06

    Compare-And-Swap (CAS) in Java

    Explain the Compare-And-Swap (CAS) operation in Java, including its usage and benefits in concurrent programming.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  7. 07

    Transaction Management in Java

    Discuss transaction management concepts and implementations in Java applications.

    From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  8. 08

    SQL Cartesian Product and Row Count

    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 ?

    Easy · From Morgan Stanley – Interview Experience (Backend Engineer | Java + Microservices)

  9. 09

    Java 17 Features Discussion

    Discussion on Java 17 features usage in real-life scenarios.

    From Morgan Stanley Interview Experience | Associate

  10. 10

    Java Version Migration Challenges without Gradle

    How to migrate Java version without Gradle, mainly discussing the challenges.

    From Morgan Stanley Interview Experience | Associate

  11. 11

    Kafka Discussion

    Discussion on Kafka, including its UI, use case, partitioning, and difference with MQ.

    From Morgan Stanley Interview Experience | Associate

  12. 12

    Multithreaded Batch Processing Deadlock Scenario

    Scenario based question on multithreaded batch processing stuck in a deadlock. Identify issues.

    From Morgan Stanley Interview Experience | Associate

  13. 13

    Caches and Real-life Implementation

    Discussion on Caches and real-life implementation details, specifically based on my usage.

    From Morgan Stanley Interview Experience | Associate

  14. 14

    Singleton vs. Decorator Pattern

    Difference between Singleton and Decorator Pattern.

    From Morgan Stanley Interview Experience | Associate

  15. 15

    Pre-Production Software Checks

    Discussion on checks required before taking software to production.

    From Morgan Stanley Interview Experience | Associate

  16. 16

    Exception Handling Discussion

    Discussion on Exception handling strategies.

    From Morgan Stanley Interview Experience | Associate

  17. 17

    Database Deadlock Identification and Resolution

    How to identify and resolve if a Database goes into a deadlock situation.

    From Morgan Stanley Interview Experience | Associate

  18. 18

    Batch Processing Performance Degradation

    Scenario: A batch processing job runs for 15 minutes, now its time increases to 45 minutes. Identification and resolution discussion.

    From Morgan Stanley Interview Experience | Associate

  19. 19

    Java Stack vs. Queue Output Prediction

    Code snippet involving Stack vs Queue behavior. You had to predict the correct output based on insertion/removal order.

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  20. 20

    Vector vs. ArrayList Differences

    Difference between Vector and ArrayList – mainly around synchronization and performance.

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  21. 21

    Java Exception Hierarchy

    Understanding the root cause of the Java Exception hierarchy – concepts of Throwable, Error, and Exception.

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  22. 22

    Java Garbage Collection Basics

    Basic Java Garbage Collection question – when objects are eligible for GC, and what makes them unreachable.

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  23. 23

    SQL Query: Emails on Weekends

    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.

    Medium · From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  24. 24

    Java Spring Boot 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.

    From Morgan Stanley Online Assessment, April 2025 - Associate Java Backend Hiring (2025)

  25. 25

    Recursive Function Memory Allocation

    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.

    From Morgan Stanley Interview Experience for Summer Technology Analyst

22 more in the Morgan Stanley write-ups.

Morgan Stanley interview questions FAQ

What questions are asked in Morgan Stanley interviews?

Candidates reported 119 distinct questions across 15 Morgan Stanley interviews. 42 coding and DSA questions, 18 system design questions, 12 behavioural and HR questions, 47 other questions.

Which Morgan Stanley interview questions are asked most often?

The most repeated are "House Robber" (2 times).

How difficult are Morgan Stanley interview questions?

Of the questions candidates rated, 29% were easy, 51% medium and 20% hard.