Turing OA
Turing OA
Python coding, critical thinking, data analysis, and writing clear explanations.
1. Write a function to compute the moving average of a list of numbers with a given
window size.
2. Implement a function to find duplicate entries in a list and count their occurrences.
3. Given a CSV file with product sales data, write a Python script to group the data by
product category and calculate the total sales for each category.
4. Write a function to remove outliers from a list of numerical values based on a given
standard deviation threshold.
5. Design a function to calculate the cosine similarity between two vectors represented as
lists.
6. Implement a function to parse JSON data and extract specific information, such as
extracting and counting unique values in a nested structure.
7. Write a function to find the longest consecutive sequence in a list of integers.
8. Given a list of dictionaries, write Python code to sort the list by a specific key.
9. Implement a Python function to merge two sorted lists into a single sorted list.
10. Write a function to remove duplicates from a list while preserving the original order.
11. Implement a Python script to read a CSV file and filter rows based on a specific
condition.
12. Write code to count the occurrences of each word in a given string.
13. Create a Python function to find the median of a list of numbers.
14. Write a function to check if two strings are anagrams.
15. Implement a function to calculate the cumulative sum of a list of numbers.
16. Write a Python script to find the most common element in a list.
17. Implement a function to parse and manipulate JSON data to retrieve specific information.
18. Write code to find the intersection of two lists in Python.
19. Implement a function to convert a list of dictionaries into a pandas DataFrame.
20. Write a Python function to replace all NaN values in a DataFrame with the column mean.
21. Given a list of dictionaries representing transactions, write a function to group
transactions by user and sum their amounts.
● Explain, in layman's terms, the difference between supervised and unsupervised learning.
● Write a response explaining why a linear regression model might underperform on a
non-linear dataset.
● Draft an email explaining the results of an AI model evaluation, including key
performance metrics, challenges, and recommendations for improvement.
● You are tasked with reviewing a peer's code. Write constructive feedback on readability,
efficiency, and possible improvements.
OFFICIAL QUESTION BANK FROM TURING
1. Basic Python interview questions and answers (39)
2. Intermediate Python interview questions and answers (31)
3. Advanced Python interview questions and answers (35)