TGViewer
BlissCodeHub BlissCodeHub @blisscodehub · 159 subscribers
Post #60 456
#backend #полезно

Вот вам несколько тасок с недавнего собеседования на позицию middle backend node.js(стек: nest.js, redis, mongodb, typeorm, rabbitmq, docker). Попробуйте свои силы, падаваны🧐

Суть задачек в том, чтобы исправить ошибки(если есть) в коде и описать примерно, что тут хотел сделать автор. Прошу к ознакомлению:
1.
async function timeOutWrapper<T>(func: () => Promise<T>): Promise<T | null> {
return await new Promise((resolve, reject) => {
console.log("Timer start");
const timeout = setTimeout(() => { console.log("Timeout"); resolve(null)); }, 100*1000};
func().then(result => {
console.log("Success");
resolve(result);
})
.catch(error => {
console.error("Error");
reject(error);
});
});
}


2.
class HttpRequestMaker {
async request(): Promise<number> {
await new Promise((resolve) => setTimeout(resolve, 1000));
throw new Error('Something went wrong...');
}
}

const httpServer = new HttpRequestMaker();

try {
httpServer.request().then(console.log);
} catch (error: any) {
console.error(error.message);
}


3.
new Promise(async () => {
throw new Error('message');
}).catch(console.error);


Присоединяйтесь к нашему общему чату и Discord серверу :)
  • 👍 3
  • 🔥 2
More from @blisscodehub
  1. Nov 18, 2025Всех приветствую 🧐 Давно от нас не было новостей и постов в целом 😭 Как можно заметить,…
  2. Oct 11, 2025Спасибо, null, вот ваши NaN в валюте undefined 🤜
  3. Oct 6, 2025В Южной Корее парализована цифровая инфраструктура всего государства из-за пожара в дата-ц…
  4. Oct 2, 2025Норм в резюме такой бигтех поставить?
  5. Sep 20, 2025#backend #полезно Апдейты с предыдущего фидбека 🧐 🟣 Ситуация в backend (Golang/Node.js)…
  6. Sep 19, 2025#backend Всех приветствую🧐 Давно я вам ничего не рассказывал, и этот период был насыщен с…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →