---
# System prepended metadata

title: Audarya Uttarwar

---

# Audarya Uttarwar
- Python, Javascript
- Mongodb, Psql
- Messaging Queue - Kafka


# Question 1: 


array = [1, 2, 3]

1, 2, 3
1, 3, 2
2, 1, 3
2, 3, 1
3, 1, 2
3, 2, 1
```python!
def getCombinations(arr, n, l):
    if l == n:
        print(arr)
    else:
        for i in range(l, n):
            arr[l], arr[i] = arr[i], arr[l]
            
            getCombinations(arr, n, l+1)
    
            arr[l], arr[i] = arr[i], arr[l]
            
arr = [1,2,3]
getCombinations(arr, len(arr), 0)

```


# Question 2: Database Design

- User Service
- Chat service
    - one to one chat
    - text exchange


    - list of conersations.
    - list of messages.

- user
    - user_id (PK)
    - username

- groups
    - grp_id (PK)
    - grp_name
    - metadata

- group_members
    - membership_id (PK)
    - grp_id (FK)
    - user_id (FK to user)
    - role (member, admin, etc..)
    - metadata

- conversation
    - id (PK)
    - grp_id
    - msg_id
    - metadata

- messages
    - id (PK)
    - grp_id (FK)
    - conv_id (FK to conv.id)
    - sender_id (FK to user)
    - message
    - metadata
