DeepFrontend
Practice ArenaBlogSign in
Go Pro
DeepFrontend

Interview-grade learning paths and hands-on practice for mid-to-senior engineers. Master internals, patterns, and system architecture with runnable code.

All systems operational

Core Courses

  • -JavaScript Internals
  • -React Reconciliation
  • -TypeScript rigor
  • -Next.js Caching
  • -Node.js Event Loop
  • -System Design
  • -Web Security
  • -CSS & Page Layouts

Explore

  • Learning Paths
  • Practice Arena
  • Pricing Options
  • HTML Sitemap

Resources

  • Privacy Policy
  • Terms of Service
  • Email Support

© 2026 DeepFrontend. All rights reserved.

Expert learning environments for web engineering teams.

← All challenges
core20 min

Implement curry

Implement curry(fn)

A classic functional-programming interview question that tests whether you actually understand closures, not just recognize the word "curry."

Write a function curry(fn) that transforms a function taking multiple arguments into one that can be called with arguments one at a time, several at once, or all at once — returning a new function until enough arguments have been supplied, at which point it calls the original fn and returns its result.

function add3(a, b, c) { return a + b + c; }
const curried = curry(add3);
 
curried(1)(2)(3);   // 6
curried(1, 2

Run your code to see results.

Stuck? This challenge exercises:

javascript.functional-programmingjavascript.closures
)(
3
);
// 6
curried(1, 2, 3); // 6

Hint: fn.length tells you how many arguments the original function expects.