Skip to content

Instantly share code, notes, and snippets.

System Design interview - Frontend

Sections to cover in the design:

  1. General reqs
    Who is the customer?
    How and why they gonna use it?
    Are they all from one country or from all over the world?
    What are they using now to solve the problem?
    How many customers we are expecting with simultanious interactions?
@licaomeng
licaomeng / TaskManager.ts
Created October 22, 2022 09:40 — forked from Wicpar/TaskManager.ts
A Typescript task manager that allows promises to be run sequencially. Can be paused and resumed. An onStart event is added to the enqueued promise.
function skipOne(): Promise<void> {
return new Promise(((resolve, reject) => {
setTimeout(resolve, 0)
}))
}
export class TaskManagerPromise<T> extends Promise<T> {
@licaomeng
licaomeng / Messi Li.md
Last active July 26, 2024 12:56
Messi Li

My Solution

function format1(inputString) {
    // String slicing approach
    return inputString.slice(0, 4) + 'Y' +
        inputString.slice(4, 6) + 'M' +
        inputString.slice(6, 8) + 'D ' +
        inputString.slice(8, 10) + ':' +
        inputString.slice(10, 12) + ':' +
        inputString.slice(12, 14);