Iterator Invalidation with Vector Erase - Quant Trader Interview Question
Difficulty: Hard
Category: Code Analysis
Practice quant interview questions from top firms including Jane Street, Citadel, Two Sigma, DE Shaw, and other leading quantitative finance companies.
Topics: cpp, iterator, vector, erase, invalidation
Problem Description
Consider the following C++ code snippet:
The intent of the code is to remove all even numbers from the vector data. What is the most likely outcome when running this code? Assume the code compiles successfully.
Practice this hard trader interview question on MyntBit - the all-in-one quant learning platform with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.