---
# System prepended metadata

title: SASIDHAR REDDY

---

SASIDHAR REDDY VANUKURI (SDE2 - R1)
https://drive.google.com/file/d/1gqohJ2nZospTg0gSc8d_tQArFnu6jLtR/view


* solved 1 qn quickly and correct
* but not able to solve 2nd qn..somewhat logic building is okay
* prev experience looks good
* ecommerce experience - relevant
* able to explain basic db concepts
* answered mongo db queries qns - correct except for small syntax issues, but good as he said he had worked on nosql long back 
* overall, DSA looks ok ok only, but other skills are relevant..so slightly positive..pushing to next round


```
/**
 * @param {number} num
 * @return {number}
 */
var addDigits = function(num) {
    // const numberArray = num.toString().split("");
    // let sum = 0;
    // for(let each of numberArray){
    //     sum += Number(each)
    // }
    // if(sum < 10){
    //     return sum;
    // }
    // return addDigits(sum); 

    38 is even number 


};
```

2)
```
/**
 * @param {number[]} digits
 * @return {number[]}
 */
var plusOne = function(digits) {


    let sum = '';
    for(let each of digits){
         sum += each
    }
    sum = Number(sum) + 1;
    let numberArray = [];
    // retrun sum.toString().split("")
    // console.log(sum);
    while(true){
        let digit = sum%10; 
        // console.log(digit)
        sum = Math.floor(sum/10);
        // console.log(sum)
        numberArray.unshift(digit)
        if(sum < 10){
            numberArray.unshift(sum)
            break;
        }
    }
    return numberArray;
};
```

3)
https://jsfiddle.net/04zdmewy/
```
/**
/* 
Collection: orders
Schema:
    order_id: String,
    seller_id: String,
    createdAt: Date
*/

// 1) find total order count of a particular seller with seller_id = 'xyz'
// 2) find total order count of a day - Aug 1
// 3) find order counts per seller on a particular day - Aug 1
// 4) for given seller with seller_id = 'xyz', find order count per hour for a given day - Aug 1 */


Orders.count({seller_id : "xyz"})
--------------
Orders.count({createdDate >= ISOString(#begining of the day), createdDate < ISOString(# end of the day)})
----------------------
Orders.aggregate({$match: {
    createdDate : {$gte: ISOString(), $lte: ISOString()}
}},
{
    $groupBy : {
        seller_id : 1,
        _id : $sum(1)
    }
}
)
-------------------------

Orders.aggregate({$match : {
    seller_id : "xyz",
},


 })
```