## NodeJS

#### Recent solutions:

Check these solutions from our community:
NodeJS / Authentication DifficultyMedium JavaScript
This technical problem deals with writing a function to authenticate a user based on their email and password. If the user is authenticated, the function should return true. Otherwise, it should return false .
About this solution: This solution is a good start, but it is not complete. In order to authenticate a user, you will need to check if the email and password are valid. If they are, then return true. Otherwise, return false.
Nov 27
NodeJS / MongoDB DifficultyMedium JavaScript
Update the email field for all users in a MongoDB document whose id is greater than 100.
About this solution: The candidate's solution is complete and solves the problem. The candidate has used the \$gt operator to find all documents where the id is greater than 100 and the \$set operator to update the email field for all documents that match the query.
Nov 27
NodeJS / Streaming DifficultyMedium JavaScript
Given a stream of integers, this problem seeks to find the median of the stream at any given point. For example, given the input of [2, 1, 5, 7, 2 , 0, 5], the corresponding output would be [2, 1.5, 2, 3.5, 2, 2, 2].
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The candidate has correctly identified the problem and has provided a solution that solves the problem. The candidate's approach is sound and their use of a binary search is clever. The only improvement that could be made is to provide more comments explaining the code.
Nov 26
NodeJS / Streaming DifficultyMedium JavaScript
Given a stream of integers, this technical problem describes how to print out the average of all the integers seen so far at each point in the stream.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The solution is optimal in terms of time and space complexity.
Nov 25
NodeJS / Streaming DifficultyMedium JavaScript
Given an input string, this NodeJS code snippet reverses the order of the words.