What to do if the database loads at 100% every 30 minutes? How to solve the heavy analytical query problem?
Node.js
How to process parallel balance deduction operations sequentially to avoid double deduction (race condition)?
Why did you choose an object for storing subscribers? How does unsubscription through filter work? What is the algorithm complexity of filter?
/* * Implement an EventEmitter. * With methods emit and on. * * on(eventName: string | Symbol, callback: (payload?: any) => void): * () => void; * Takes an event name and a callback function. * The function subscribes to the event. * The result of the function should be an unsubscribe function. * * emit(eventName: string | Symbol, payload?: any): void * Takes an event name and a payload that will * be passed to each listener of eventName; the function triggers the event. * If no listener is found, it should throw an exception. * * ------------------------------------------------------ * * Example: * const myEmitter = new EventEmitter(); * * const unSubscribe = myEmitter.on('event', (payload) => { * console.log('an event occurred!!!', payload); */
What are the purposes of indexes in PostgreSQL?
Tell about the principles of ACID in relational databases.
// [DATABASE] Design a database for users and their electronic wallets. // A user can own multiple electronic wallets in different currencies, but cannot own two wallets in the same currency. // Possible currencies: USD/EUR/RUB. The wallet should contain the current balance; // Currencies should have an additional name in Russian.
What are connection pools in the context of working with databases, and what are they used for?
What are FK and UNIQUE constraints in a database?
What levels of transaction isolation do you know and what do they mean?
Why choose FLOAT type for balance? How does it differ from DECIMAL? What changes if INTEGER is used?
Tell us about your experience with monitoring and logging (Grafana, Kibana)
// 2. Formulate a query to select users who do not have a EUR wallet.
What is the difference between synchronous and asynchronous code?
What is the difference between Map and WeakMap?
What is Node.js and what does it consist of?
// The user may own multiple electronic wallets in different currencies, but cannot own two wallets in the same currency. // Possible currencies: USD/EUR/RUB. The wallet must contain the current balance; // Currencies should have an additional name in Russian. // ADD Currency -> BTC/ETH/TON // ADD language ES/FR/EN User { id int PK string email string } Currency { code varchar(3) PK // USD, EUR, RUB name_ru string optional type enum('fiat', 'crypto') } CurrencyTranslations { } Wallet { user_id FK (User.id) currency_code FK (Currency.code) balance decimal }
Name the promise methods (Promise.resolve, Promise.reject, and others)
What is an EventEmitter and how does it work?
What type of relationship will there be between the books and authors tables?