Logo

Coding preview

Generate Trade ID's

What this preview is

About this preview

Generate Trade ID's is a cooked quant coding problem on language knowledge in Cpp / Python.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Implementing trade ID generation for a futures exchange

This is a medium-difficulty coding problem that tests your ability to parse structured input, perform time arithmetic, manipulate strings, and compose a multi-part output. It mirrors the kind of backend work junior quant developers handle when building trading infrastructure—here, the focus is on correctness across three distinct transformations and careful handling of edge cases.

The problem requires you to extract and combine information from order timestamps, order identifiers, and instrument names into a single trade ID. Each component involves a different type of processing: time-difference calculation, string permutation with a randomness requirement, and character-to-numeric encoding. Pay close attention to input formats (variable-length timestamps) and the precise rules for each segment. Testing your solution thoroughly against boundary conditions—short IDs, single-digit time differences, alphanumeric instruments—is essential.

  • Time parsing and arithmetic
  • String slicing and random permutation
  • Character mapping and encoding
  • String composition and formatting