As reported: Microsoft L60 SDE (Aug 2025), round 3 (DSA, 60 minutes), question 2: LeetCode Largest Number — the idea, test cases and dry runs, then the optimal approach discussed with merge sort and heap sort and a recursion tree for a sample; no code was written for this one.
Given a list of non-negative integers nums, arrange them so that they form the largest number and return it as a string (the result may be too large for an integer type).
This is LeetCode 179 — Largest Number.
Example 1
nums = [10,2] -> "210"
Example 2
nums = [3,30,34,5,9] -> "9534330"
Constraints: 1 ≤ nums.length ≤ 100; 0 ≤ nums[i] ≤ 10^9.
Code runner format: one JSON value per line: nums (LeetCode's test-case format). Implement largestNumber(nums); the harness prints the result.