Problem, as an interviewer would state it:
"Implement curry(fn) with PLACEHOLDER support — allowing a special _ placeholder value to reserve an argument's position for a LATER call, matching lodash's own well-known _.curry's placeholder behavior."
Examples:
const curried = curry((a,b,c) => a+b+c);
curried(1, _, 3)(2); // 6 -- the placeholder's slot is filled by the LATER call
Clarifying questions expected:
- What should the placeholder's own identity be — a real, unique Symbol, or a simpler sentinel like a string?
- If MULTIPLE placeholders exist in one call, does the next call's own arguments need to fill them in order?
- Does this still need to support a normal, placeholder-free call pattern, working identically to a simpler curry?
Code / implementation expected: Yes — real, direct proof of a placeholder correctly reserving a later slot in several different real positions, plus confirmation a normal, placeholder-free call still works identically.