Sobes.tech

From these tickets, a single, continuous route can be constructed. There are no loops or repetitions in the route. You need to write a program that returns these same ticket objects in the order of the route. ```javascript function getRoute(tickets = []) { const cities = new Map(); for (const ticket of tickets) { cities.set(ticket.from, ticket); } const result = []; let currentCity = startcity; while (cities.has(currentCity)) { const next = cities.get(currentCity); result.push(next); currentCity = next.to; } return result; } console.clear() console.log(getRoute([ { from: 'London', to: 'Moscow' }, { from: 'NY', to: 'London' }, { from: 'Moscow', to: 'Spb' }, ])); ```

265

Did you determine the system load in RPS? What was the amount? Have you experienced passing technical stages in a live-coding format?

255

Our chat application should display new messages received from the server as quickly as possible. The message format: interface Message { id: number text: string } The ID of the very first message = 1, and the ID of each subsequent message is 1 greater than the previous one. We need to display messages in the correct order, but the server does not guarantee the correct order of messages sent to our application. Timeline: // (receives) [phone] // (renders) . 1 2 3 . . 4 5 6 7 8 Display messages using the render function: render(message)

221

Tell me about your experience with Node.js using an example of a project, what exactly did you develop on it

191

/** * It is necessary to write an asynchronous function, * which will "sleep" for a specified number of milliseconds, * and then successfully complete */

180

General understanding of JavaScript: parameter passing, asynchrony, prototypes, error handling.

175

// It is necessary to check the solution to the problem on two services by calling: // 1. checkResult(url1, solution) // 2. checkResult(url2, solution) // // checkResult: (url: string, solution: string | number) => Promise<boolean>; // // - If both requests return true - log success // - If at least one returns false - log fail // - If at least one does not respond - log error // - If at least one responds longer than 1 sec - log timeout

167

Tell us about your work experience at Atwint: projects, responsibilities, team, processes.

161

/** * An array of points with integer coordinates (x, y). * Determine if there exists a vertical line * that divides the points into two sets symmetric about this line. * Note: For convenience, a point can be represented not as an array [x, y], but as an object {x, y} */ isVertSym([[0, 0], [0, 0], [1, 1], [2, 2], [3, 1], [4, 0], [4, 0]]) // true isVertSym([[0, 0], [0, 0], [1, 1], [2, 2], [3, 1], [4, 0]]) // false isVertSym([]) // true isVertSym([[0, 0]]) // true isVertSym([[0, 0], [10, 0]]) // true isVertSym([[0, 0], [11, 1]]) // false isVertSym([[0, 0], [1, 0], [3, 0]]) // false function isVertSym(list) { // code here }

155

/** * The `asyncAuth(callback)` function takes a callback, * which can be passed an error (as the first argument) and data * from the backend (as the second argument). * asyncAuth((error, data) => {}); * * You need to implement the `auth()` function, * which calls `asyncAuth()`, but returns a Promise. * * @returns {Promise} */ export function auth() { // asyncAuth((error, data) => {}); }

152

/ ** * Given an array. Sort the odd numbers in ascending order, * leave the even numbers in their places * / export function oddSort(numbers) { // your code here } console.log(oddSort([2, 3, 7, 4, 6, 1, 5, 8, 9])); // [2, 1, 3, 4, 6, 5, 7, 8, 9] console.log(oddSort([2, 4, 6, 8])); // [2, 4, 6, 8] console.log(oddSort([3, 7, 1, 5, 9])); // [1, 3, 5, 7, 9] // Need to test the solution with two services by calling: // 1. checkResult(url1, solution) // 2. checkResult(url2, solution) // // checkResult: (url: string, solution: string | number) => Promise<boolean>; // // - If both requests return true - log 'success' // - If at least one returns false - log 'fail' // - If at least one does not respond - log 'error' // - If at least one responds longer than 1 sec - log 'timeout' import { checkResult } from '...'; export async function checkResults() { const solution = 'Any answer'; const url1 = 'yandex.ru'; const url2 = 'google.com'; checkResult(url1, solution); checkResult(url2, solution); }

151

Given three sections of code. You need to write the result of each console.log. var n = 1; function f(n) { n = 3; } f(n); console.log(n); // ?? // ------------------ var obj = { a: 1 }; function f1(o) { o.a = 5; } f1(obj); console.log(obj); // ?? // ------------------ var obj = { a: 1 }; function f2(o) { o = { hello: 1 }; } f2(obj); console.log(obj); // ??

150

/** * The function `tryAuth()` uses `auth()` and, in case of an error, * makes N additional attempts. * If all attempts fail - throw the last error * * @returns {Promise} */ export function tryAuth(n) { }

149

// Implement the groupBy method, extending standard array methods. // The method should return a grouped version of the array – an object, // where each key is the result of the function fn(arr[i]), // and each value is an array containing all original array elements with that key.

147

How was your interaction structured in your last project? Was it Agile or something else?

145

What is a decision or improvement you are proud of? Maybe a very complex or important task?

140
/2