---
# System prepended metadata

title: Interview -

---

# Interview - 




## Python

1. Write a program to generate below pattern
``` python

5 5 5 5 5
4 4 4 4
3 3 3
2 2
1

```

2. Write a program to generate fabonnaci series of n numbers

**Description**
Give a value n `int` (0 < n < 100). generate  fabonnaci series of length n

**Sample Output**
```
n = 2
Output = [0,1]

n = 6
output = [0, 1, 1, 2, 3, 5]
```

3. Find the index of 1st duplicating number from the given list

**Decription**
Given a list, Find the index of first duplicating number

**Explanation**

mylist = [1, 2, 3, 4, 5, 6, 5, 9, 7]
   

- In the given list of integer values, all values upto 5 at index position `6` are unique. number 5 is repeated at index `6` so it is considered as 1st duplicating number

**Sample Output**
```
mylist = [1, 2, 3, 4, 5, 6, 5, 9, 7]
Output = 6

mylist = [10, 10, 20]
output = 1

mylist = [1]
output = None
```


## SQL 

- Write a query to fetch the number of employees working in the department ‘HR’. 

 ![](https://i.imgur.com/HA2brYO.png)


 ![](https://i.imgur.com/I7GIr3s.png)
 
 
 
 1. Write q query to find all the employees whose salary is between 50000 to 100000.

 
 
     **- Answer :**




2. Write a query to find the names of employees that begin with ‘S’

    **- Answer :**



3. Write a query to fetch all employees who also hold the managerial position.

   **- Answer :**






![](https://i.imgur.com/5Jp0uB8.png)


![](https://i.imgur.com/FKJrJrf.png)

4. Write an SQL query to fetch those employees who live in Toronto and work under manager with ManagerId – 321.


   **- Answer :**



5. Write an SQL query to fetch all the Employees who are also managers from the EmployeeDetails table.
6
   **- Answer :**
