---
# System prepended metadata

title: Asfan Ulla

---

# Asfan Ulla

- Nodejs, Python
- Mysql, Mongo
- AWS, 

# Question 1: Find the 2nd largest number in an array. 
```python=
# logic

arr = [1, 2, 3, 4, 5, 5]
#arr = sorted(arr, reverse=True)
max = 0
for i in range(arr):
    if(arr[i] > max):
        max = arr[i]
arr = arr.remove(max)
arr = sorted(arr, reverse=True)
print(arr[0])


```


# Question 2: Js Question 
```javascript=
// const arrObj = [
//     { age: 9, class: 6, name: 'A'},
//     { age: 10, class: 5, name: 'B'},
//     { age: 11, class: 6, name: 'C'},
//     { age: 10, class: 5, name: 'D'},
//     { age: 12, class: 6, name: 'E'},
//     { age: 10, class: 5, name: 'F'},
//     { age: 12, class: 7, name: 'G'},
// ]

// const result = {
//     5: {
//         10: ['B', 'D', 'F']
//     },
//     6: {
//         9: ['A'],
//         11: ['C'],
//         12: ['E']
//     },
//     7: {
//         12: ['G']
//     }
// }

const arrObj = [
    { age: 9, class: 6, name: 'A'},
    { age: 10, class: 5, name: 'B'},
    { age: 11, class: 6, name: 'C'},
    { age: 10, class: 5, name: 'D'},
    { age: 12, class: 6, name: 'E'},
    { age: 10, class: 5, name: 'F'},
    { age: 12, class: 7, name: 'G'},
]

const result = {}

for(var i=0; i<arrObj.length; i++){
    if (!(arrObj[i]["class"] in result)){
        result[arrObj[i]["class"]] = {}
    }
    //console.log(result)
    
    if(!(arrObj[i]["age"] in result[arrObj[i]["class"]])){
        result[arrObj[i]["class"]][arrObj[i]["age"]] = []
    }
    result[arrObj[i]["class"]][arrObj[i]["age"]].push(arrObj[i]["name"])
}
console.log(result)



```


# Question 3: 

order placed at 3:44 PM
sms/app-notification at exactly x hrs (2) - 5:44..



