This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* You work for the DMV; you have a specific, sequential way of generating new license plate numbers: | |
* | |
* Each license plate number has 6 alphanumeric characters. The numbers always come before the letters. | |
* | |
* The first plate number is 000000, followed by 000001... | |
* When you arrive at 999999, the next entry would be 00000A, Followed by 00001A... | |
* When you arrive at 99999A, the next entry is 00000B, Followed by 00001B... | |
* After following the pattern to 99999Z, the next in the sequence would be 0000AA... | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given an array of URLs and a MAX_CONCURRENCY integer, implement a | |
// function that will asynchronously fetch each URL, not requesting | |
// more than MAX_CONCURRENCY URLs at the same time. The URLs should be | |
// fetched as soon as possible. The function should return an array of | |
// responses for each URL. | |
// How would you write a test for such a function? | |
async function fetchUrlsFromQueue(urlQueue, fetchResults) { | |
while (urlQueue.length > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function fetchUrlsFromQueue(urlQueue, fetchResults) { | |
while (urlQueue.length > 0) { | |
const currentUrl = urlQueue.shift(); | |
try { | |
const fetchedResponse = await fetch(currentUrl); | |
fetchResults.successfulResponses.push(fetchedResponse); | |
} catch (error) { | |
fetchResults.failedUrls.push({ | |
url: currentUrl, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"clean","settings":"{\"settings\":\"{\\n \\\"files.autoSave\\\": \\\"afterDelay\\\",\\n \\\"git.blame.editorDecoration.enabled\\\": true,\\n \\\"javascript.inlayHints.functionLikeReturnTypes.enabled\\\": true,\\n \\\"search.quickOpen.includeSymbols\\\": true,\\n \\\"git.autofetch\\\": true,\\n \\\"git.confirmSync\\\": false,\\n \\n \\\"cSpell.userWords\\\": [\\n \\\"macd\\\",\\n \\\"supabase\\\",\\n \\\"vapi\\\"\\n ],\\n \\\"[python]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.black-formatter\\\"\\n },\\n \\\"diffEditor.experimental.useTrueInlineView\\\": true,\\n \\\"explorer.confirmDelete\\\": false,\\n \\\"editor.bracketPairColorization.independentColorPoolPerBracketType\\\": true,\\n \\\"debug.showVariableTypes\\\": true,\\n \\\"javascript.inlayHints.parameterTypes.enabled\\\": true,\\n \\\"javascript.inlayHints.variableTypes.enabled\\\": true,\\n \\\"typescript.inlayHints.enumMemberValues.enabled\\\": t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"nvim v1.0.3 2","settings":"{\"settings\":\"{\\n \\\"editor.tabCompletion\\\": \\\"off\\\",\\n \\\"[javascript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[javascriptreact]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[python]\\\": {\\n \\\"editor.tabSize\\\": 4,\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.black-formatter\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"gitlens.codeLens.enabled\\\": true\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.tabSiz |