Uber interview question

memoize is a function that takes one argument, asynchronousFunction: function memoize(asynchronousFunction) { } where asynchronousFunction is a function that takes n arguments. The last argument of asynchronousFunction is a callback in the form of function callback(error, result).

Interview Answer

Anonymous

9 Dec 2024

function memoize(asynchronousFunction) { const calculatedResult = new Map(); return async function(...params) { ... } }