## Programming problems for data science interview

1. Define a function which takes a list of numbers as input and returns the largest number in that list.You can’t use the max function.

2. Define a function which takes a list of numbers as an input and returns the average of that list.No use of any inbuilt function.

3. Define a function which takes a list of numbers as input and calculates the sum of all the odd numbers.If there are no odd numbers it should return 0.

4. Define a function that takes two non-negative integers as function parameters and returns their least common multiple (LCM).

5. Define a function that takes two positive integers m and n and returns a list of all the even numbers between m and n (including m and not including n)

6. Define a function that takes two positive integers m and n and returns a list of all the even numbers between m and n (including m and not including n)

7. Define a function that takes a positive integer k and returns the list of all the divisors of k. Your list should include both 1 and k.

8. Define a function named list_of_prime_numbers that accepts a positive integer n and returns a sorted list (ascending order) of all the prime numbers between 2 and n (including 2 but not including n)

9. Create a function named price_list that accepts two lists as parameters. The first list contains the quantities of n different items, the second list contains the prices that correspond to those n items respectively. Now, calculate the total amount of money required to purchase those items. Lets keep both the lists of equal lengths.

10. Create a function named unique_common that accepts two lists, both of which contain integers as parameters and returns a list after sorting in ascending order ,which contains unique common elements from both the lists. If there are no common elements between the two lists, then the function should return the keyword None.

11. Write a function named Find_Out_GCD that accepts a list of positive integers and returns their greatest common divisor (GCD). Your function should return 1 as the GCD if there are no common factors between the integers

12. Define a function that takes two lists, both of which consist of whole numbers and returns the total sum of all the even numbers integers from both lists. If there are no even numbers in the list, the function should return 0.

13. Create a function that takes a string of words as input arguments and returns a dictionary of word counts. The keys of this dictionary have to be the unique words and the values should be the total count of those words. Assume that characters are not case sensitive.

14. Write a function named find_palindrome which takes a string as an argument and finds out whether the supplied string is a palindrome or not.

Programming problems for data science interview

**Kunal**

Data science consultant and trainer (IndiQa Analytics LLP)

PCP in Business Analytics, IIM (K)

Certificate Program in Data Science, IIT (M)

MSc Nottingham Trent University

MBA Fore School of Management, New Delhi