Virtu Financial Quantitative Trading question.

virtu financial logo
virtu financial
Quantitative Trading
April 1, 20257 reads

Summary

This post details a specific algorithmic problem encountered during an interview with Virtu Financial for a Quantitative Trading role.

Full Experience

The post only contains a single interview question without further details on the interview experience itself.

Interview Questions (1)

Q1
Student Test Scores Adjustment
Data Structures & AlgorithmsMedium

Write a function that, given a zero-indexed array A consisting of N integers representing the initial test scores of a row of students, returns an array of integers representing their final test scores (in the same order).

There is a group of students who sit next to each other in a row. Each day, the students study together and take a test at the end of the day. Test scores for a given student can only change once per day as follows:

  • If a student sits immediately between two students with better scores, that student's score will improve by 1 when they take the next test.
  • If a student sits between two students with worse scores, that student's test score will decrease by 1.

This process will repeat each day as long as at least one student's score changes. Note that the first and last student in the row never change their scores as they never sit between two students.

Return an array representing the final test scores for each student.

You can assume that:

  • The number of students is in the range from 1 to 1,000.
  • Scores are in the range from 0 to 1,000.
Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!