Morgan Stanley software engineer interview questions and process
Morgan Stanley software engineer interviews usually combine data structures and algorithms, strong fundamentals in Java, C++ or Python, design questions about trading, risk or wealth management systems, and behavioral questions about integrity and clients. Campus candidates often report an online coding assessment followed by a final round of several interviews; experienced hires usually meet the hiring team, and the details vary by division and location.
By Evin JohnPublished 6 min read
How the Morgan Stanley technology loop often runs
Technology at Morgan Stanley supports institutional securities, wealth management and investment management, plus firm-wide platforms for data, cloud, security and risk. The steps below are what candidates commonly report. Rounds and timing differ between campus programs, experienced hiring, divisions and countries, so use this as a guide and confirm with your recruiter.
- Application and online assessment. Campus and early-career candidates often describe a timed online coding test, sometimes with a short set of other questions.
- First interview. A technical or mixed conversation with an engineer or manager, which may include live coding.
- Final round. Commonly several back-to-back interviews in one day: coding, language and design depth, and behavioral questions with senior team members.
- Team placement. For some programs, placement into a specific team happens after the offer.
For the general shape of coding and design rounds, read the software engineer interview guide. The Java developer guide is useful because many teams at large banks work heavily in Java.
What Morgan Stanley tends to look for
Morgan Stanley publishes a short set of core values, which include putting clients first and doing the right thing; read the current wording on its site before the behavioral rounds. In engineering terms that means code that is correct before it is clever, a record of who changed what, and comfort working under the controls a regulated firm needs. Interviewers often like hearing how you test, how you handle failure and how you explain technical risk to people outside engineering.
Coding questions
| Question | What it checks | What a strong answer shows |
|---|---|---|
| Match incoming buy and sell orders by best price, then by arrival time. | Heaps or sorted maps. | Two books, partial fills, and price-time priority spelled out before coding. |
| Compute realized profit for a stream of fills using first in, first out lots. | Queues and careful state. | Long and short positions handled the same way, integer prices and a test that flips a position. |
| Return the volume-weighted average price over the last N minutes of trades. | Sliding windows. | Running sums of price times volume and volume, with expiry of old trades. |
| Merge several sorted price feeds into one sorted stream. | K-way merge. | A min-heap of the head of each feed and handling a feed that ends early. |
| Parse tag and value pairs from a delimited message into a map and validate required tags. | Parsing. | Splitting by the right delimiter, repeated tags and a clear error list. |
| Find the best single buy and sell days in a price series. | One-pass scan. | Tracking the minimum so far and the case where prices only fall. |
| Report the top k instruments by traded value in a window. | Heaps and maps. | A counter per instrument and a heap or sort at report time, with the trade-off stated. |
| Group trades into netting sets by counterparty and instrument. | Grouping. | A composite key and net quantity per group. |
| Detect when an account's exposure exceeds its limit as trades arrive. | Incremental aggregation. | Updating exposure per trade instead of recomputing, and an alert only on crossing the limit. |
| Implement a thread-safe cache of the latest price per instrument. | Concurrency. | A concurrent map, what readers can see during an update, and why a lock around everything would hurt. |
The second row in Python. It was run against a slow, unit-by-unit reference over thousands of random fill sequences, including position flips from long to short.
from collections import deque
def realized_pnl(fills):
"""fills: list of (side, qty, price_cents) for one instrument, in time order.
side is "B" or "S". Open lots close first in, first out. Returns realized
profit in cents and the remaining open lots as (signed qty, price)."""
lots = deque() # each lot: [signed_qty, price]; all lots share one sign
pnl = 0
for side, qty, price in fills:
sign = 1 if side == "B" else -1
while qty and lots and lots[0][0] * sign < 0: # this fill closes old lots
lot = lots[0]
take = min(qty, abs(lot[0]))
# long lot: exit - entry; short lot: entry - exit
pnl += take * (price - lot[1]) * (-sign)
lot[0] += take * sign
qty -= take
if lot[0] == 0:
lots.popleft()
if qty:
lots.append([qty * sign, price])
return pnl, [tuple(l) for l in lots]Language and fundamentals questions
- What does volatile guarantee in Java, and what does it not? Visibility and ordering for that field, not atomic compound updates such as an increment.
- When would you use a ConcurrentHashMap over a synchronized map? Many concurrent readers and writers, where finer-grained locking avoids a single bottleneck.
- How do garbage collection pauses affect a latency-sensitive service, and how do you reduce them? Allocation rate, object lifetimes, collector choice and measuring pause times rather than guessing.
- In C++, why might a vector beat a linked list even for inserts in the middle? Contiguous memory and cache behavior often outweigh the extra copying.
- What is the difference between a process and a thread, and how do they share data? Separate versus shared memory and the tools for each.
- How does a hash map work, and what breaks when keys are mutable? Buckets, equality and hash contracts, and lookups that fail after a key changes.
- Explain the producer-consumer problem and one way to implement it. A bounded blocking queue and what happens when either side is faster. The multithreading guide has more of these.
- How would you speed up a slow SQL report on trade history? Look at the query plan, indexes on filter columns and partitioning by date. See the SQL guide.
Design and finance-aware questions
| Prompt | What it tests | What a strong answer covers |
|---|---|---|
| Design an order management system that routes client orders to exchanges. | State machines and reliability. | Order states, acknowledgments, cancels that race with fills and a complete audit log. |
| Design a market data feed handler that publishes prices to many internal consumers. | Latency and fan-out. | Sequence numbers, gap detection and recovery, and slow consumers that must not block fast ones. |
| Design an end-of-day risk calculation across many portfolios. | Batch compute at scale. | Splitting work by portfolio, retries, a deadline and reproducible inputs. |
| Design trade matching between your records and a counterparty's confirmations. | Matching with tolerance. | Keys for matching, rules for near-matches, and a queue of breaks for people to resolve. |
| Design a client portfolio dashboard for wealth advisors. | Read-heavy platforms. | Precomputed positions, caching, entitlements so advisors see only their clients, and freshness labels. See caching. |
| Design an audit trail that regulators can rely on. | Immutability. | Append-only storage, timestamps from a trusted source, and retention and access rules. |
- What is the difference between a trade's execution and its settlement? Agreeing the deal versus actually exchanging cash and securities, a few business days apart at most depending on the market.
- What is P&L, and why split realized and unrealized? Profit already locked in by closing versus the change in value of positions still open.
- Why can a bond's price fall when interest rates rise? Its fixed payments are worth less when new bonds pay more.
- What is a position? The net amount of an instrument an account holds after all its trades.
Behavioral questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Tell me about a time you found a mistake that others had missed. | Attention to detail. | How you caught it, how you raised it and what changed afterward. |
| Describe a situation where doing the right thing was the harder option. | Integrity. | A clear choice, who you involved and the outcome. |
| Tell me about explaining a technical risk to a business stakeholder. | Client and partner focus. | Plain words, the options you offered and the decision made. |
| Describe working under a tight deadline with no room for error. | Composure. | How you prioritized, tested and communicated. |
| Tell me about a time you worked with people across offices or time zones. | Collaboration. | Handoffs, written updates and a resolved disagreement. |
| Why Morgan Stanley, and why technology in finance? | Motivation. | A specific interest in markets, wealth or the engineering problems they create. |
Fictional example
- Interviewer
- Write a function that matches incoming orders against a book.
- Candidate
- Let me confirm the rules. Better price matches first, and at the same price the earlier order wins? Can an order partly fill and leave the rest resting in the book? And are prices integers, like ticks or cents?
- Interviewer
- Yes to all three.
- Candidate
- Then I will keep sells in a min-heap by price then arrival, and buys in a max-heap the same way. An incoming buy keeps matching the cheapest sell while that price is at or below its limit, reducing quantities as it goes, and any remainder joins the buy side. I will test a partial fill, an exact fill and an order that matches nothing.
A three-week plan
- Week 1: timed coding on heaps, windows, hashing and merges, with at least three finance-flavored problems.
- Week 2: language depth in your main language, especially concurrency and memory, and two designs from the table above.
- Week 3: finance basics, stories about integrity and detail, and a full mock final round of back-to-back interviews.
Sibling guides: the Intuit guide for consumer finance software with a presentation round, and the AMD guide for a performance-heavy systems loop.
To rehearse a back-to-back final round, run your mocks with Natively open on your computer. It transcribes each session, so you can look back at whether you clarified the matching rules before coding or jumped straight in, and the transcripts and notes stay in your history. Screenshot a practice problem and it reads it and drafts an approach for you to compare with yours. With your résumé and the role's description added (Pro or the free trial), suggested answers for the behavioral interviews come from your own experience. Find out more about the AI interview assistant.
Questions people ask
What coding questions does Morgan Stanley ask software engineers?
Standard data structure and algorithm problems, sometimes with a markets angle: order matching, FIFO profit and loss, VWAP windows, merging sorted feeds and thread-safe price caches.
What is the Morgan Stanley software engineer interview process?
Campus candidates often report an online coding assessment, a first interview and a final round of several interviews; experienced hires usually meet the hiring team. Details vary by division and location.
Do I need finance knowledge for a Morgan Stanley technology interview?
Not deep knowledge, but knowing what a trade, a position, settlement and P&L are helps you follow design questions and shows interest in the business.
How should I prepare for a Morgan Stanley interview?
Drill heaps, windows and hashing, deepen your main language, especially Java concurrency, practice a trading or risk design and prepare stories about integrity and attention to detail.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
