
Practical Coding Reasoning
A focused set of three coding tasks designed to test practical reasoning and implementation skills in real-world scenarios: robust string parsing with edge cases, async concurrency control with ordered results, and immutable nested state updates. Each prompt omits the explicit answer, making it suitable for evaluating both problem understanding and solution correctness without leakage of target outputs.
Prompt
Write a function extract_numbers(s: string) -> number[] that extracts all integer numbers from a string and returns them in the order they appear. Constraints: Numbers may be negative. Numbers may be adjacent to letters without spaces. Ignore decimal numbers (e.g., "3.14" should not count as 3 or 14). Return an empty array if none are found. Example: Input: "abc-12def34gh-5" Output: ?
Answer guidance
[-12, 34, -5]