How you sounded
You talked
38%
Of the call’s spoken time.
Filler words
7
About 0.2 a minute.
Longest stretch
1 min 14 sec
The longest you spoke without break.
Preserveinputorder,stopschedulingonfailure,andsupportcancellation.
Durante a chamada
Depois da chamada
Por tipo de conversa
Aprenda
Confiança
Sayli para entrevistas de emprego
Traga seus projetos. Explique seu raciocínio, mesmo nas perguntas mais difíceis.
Exemplos do produto em inglês.
Use a shared index and a fixed pool of workers. Each worker claims its index before awaiting, so two workers cannot claim the same item.
async function mapLimit<T, R>(
items: readonly T[],
limit: number,
run: (item: T, signal?: AbortSignal) => Promise<R>,
signal?: AbortSignal,
): Promise<R[]> {
if (!Number.isInteger(limit) || limit < 1)
throw new RangeError('limit must be a positive integer');
signal?.throwIfAborted();
const results = new Array<R>(items.length);
let next = 0;
let failed = false;
async function worker() {
while (!failed) {
signal?.throwIfAborted();
const i = next++;
if (i >= items.length) return;
try {
results[i] = await run(items[i], signal);
} catch (error) {
failed = true;
throw error;
}
}
}
await Promise.all(Array.from(
{ length: Math.min(limit, items.length) }, worker,
));
return results;
}Why it works: results are written by input index, not completion order. At most limit calls are in flight. A rejection stops new work; already-running tasks finish unless their implementation honours the abort signal.
Edge cases: empty input, a limit larger than the input, out-of-order completion, a rejected task, and cancellation before or during the call. Time is O(n) bookkeeping plus the async work; result storage is O(n).
Guarde as perguntas, suas respostas e o que preparar depois.
Guarde as decisões. Lembre seus compromissos.
Comece grátis. Seu contexto, quando precisar.