Python
Topic – Python questions for data science interviews
Python is one of the most popular language in the Analytics domain. There are multiple ways in which you can learn this language to prepare for any analytics domain career.
There are many courses which teaches Python questions for data science interviews.
We have interviewed a lot of candidates and we can surely say that people do freak out on simple, in fact very simple questions. And then there are obviously complex questions. The only thing which can help you get better is practice.
Below is a lot of question for at least a week to practice some basic and complex concepts in Python
1st Approach
Start with basic tutorial from any website like www.w3school.com or may by tutorialspoint. And the move to some compilation of Youtube video to clear your concept. Lastly solve at least 200-300 questions on Data Structure, Pandas, Numpy, scikit and matplotlib to get comfortable with the language.
This will cost you nothing as all the above resources are free. But, you just need to be self-disciplined
2nd Approach
Join any course on udemy or coursera with good review. Even they have some good lectures. Then again solve 200-300 questions on your own.
This will cost you around 1000-5000 rupee.
Pros
You will have a structured idea about the language
Not much of a cost because the ROI could be way more
Cons
The course videos sometimes goes too deep in small topics or topics which are not that frequently used on the floor. It creates an illusion that ‘Python is difficult to learn’
No matter what approach you take, you need to solve at least 200-300 questions (ranging from beginners to intermediate level or may be advance level)
Only after completing these questions you should hop on creating models.
Here is a list of ~200 Python questions for data science interviews. Most of these are solved, go through the questions and solve the unsolved questions.
Before starting with the questions make sure to create your account at www.thedatamonk.com to answer these questions.
Solved Python Questions
- How to call a nested lambda function?
- Write a nested lambda function .
- Write addition lambda function.
- Write an addition function.
- Is this a valid string operation?
- Predict the output of code.
- Print sum of numbers.
- Write an infinite loop.
- Print the table of 12.
- Print multiples of 5.
- Print multiples of 10.Print a list.
- Print even numbers.
- Predict the output.
- Use isinstance() on custom class.
- Find the type.
- Find the type.
- What is result 1 in the syntax?
- What is the use of ternary operator?
- Print minimum of two numbers.
- Use conditional operator to check lower case.
- Convert to upper case without using for loop.
- Return string length of list items.
- Add strings using map.
- Add two tuples using map.
- Enumerate the given string.
- Set initial iterator in enumerate.
- Enumerate the given string.
- Enumerate the given list.
- Round off the given number.
- Find absolute value of a complex number.
- Round off the given number.
- Find absolute value.
- What is the difference between parameters & arguments?
- Find the maximum of 3 numbers.
- Write a function with arguments as specified.
- Print the given numbers.
- Write a program to give weather advisory.
- Find list element.
- Print consonants only.
- Insert element in a list.
- Write a program to combine the given lists.
- Find the largest list element.
- Add list items.
- Check if number is palindrome.
- Use recursion to find if a string is palindrome or not.
- Print the pattern.
- Find prime numbers.
- Reverse the list using for loop.
- Write ways to discard a dictionary.
- Delete a dictionary item.
- Alter the dictionary text.
- Update the dictionary.
- Predict the output of the given code.
- What is the difference between tuples and lists?
- Find elements from the given tuple.
- How to create a tuple with a single element.
- How to access a .csv file?
- Convert a string into date/time value.
- Find the total cars per company.
- Does Python support switch or case statement in Python? Why?
- Write a function to construct bar plot.
- How to reverse a string using single LOC?
- Write a program to print the values between the given numbers.
- Write a program to segregate flowers and shrubs.
- Write a program to create a box plot.
- Write a program to drop columns in csv file.
- Plot the data using seaborn library.
- What is the difference between NumPy & SciPy?
- What is self in Python?
- How to sort a list in Python?
- What is the use of map and reduce?
- How to separate a file extension wise?
- What do we mean by a zero-indexed language?
- How to join tables in Python?
- When to use list, set or dictionary?
- What is the difference between extend and append?
- What is the use of map and reduce?
- How to separate a file extension wise?
- What do we mean by a zero-indexed language?
- How to join tables in Python?
- When to use list, set or dictionary?
- What is the difference between extend and append?
- Remove null value from a column.
- How to load a .csv/.txt file in Python?
- How do we use pow() function?
- Use a while loop to print numbers from 1 to 50.
- How to remove duplicates from a list?
How to remove duplicate elements from a list? - How to sort a dictionary by key?
- What information does describe() provide?
- What is the difference between *args and **kwargs?
- Name some mutable data types in Python.
- Explain Python’s parameter passing mechanism.
- What is the difference between NumPy & SciPy?
- What is PEP8 and why is it important?
- What is comprehension in Python?
- What are the various data types in Python?
- What is pass in Python?
- What is the difference between xrange and range in Python?
- What are global, protected and private in Python?
- Explain pass by value and pass by reference in Python.
- What are iterators in Python?
- Explain split and join function in Python.
- What is the difference between .py and .pyc files?
- What is _init_ ?
- What are modules and packages in Python?
- What are decorators in Python?
- What is the main point of difference between list and tuple?
- How do you copy an object in Python?
- What is recursion?
- How do we remove duplicates from a list?
- How to find element from tuple?
- Enumerate the list.
- Find out which library module is necessary to import in the python code.
- Reverse a string without using inbuilt function.
- Write a lambda function that multiplies two arguments Question
- Differentiate between *args and **kwargs.
- What all information you get from describe() in python?
- What is lapply and sapply?
- What is recursion? Give an example.
- What is a table called, if it has neither Cluster nor Non-cluster Index? What is it used for?
- What will be the output of the print(str*3) if str=”TheDataMonk”?
- why do have to use reshape(-1,1) or reshape(1,-1) for a single feature before fitting it to the model in sklearn library?
- How will you approach this problem?
- What is the function of unlist()?
- write a function to exclude columns in csv file.
- What is self in Python?
- What is the difference between NumPy and SciPy?
- Explain Python’s parameter-passing mechanism.
- Explain Python’s parameter-passing mechanism. Question How is it done?
- write a function to construct bar plot
- what happens when argument deep is set to False?
- What is Collation?
- 10 Million Data Points
- Explain the Pandas Time Series?
- Give the output of the following function.
- Can a stored procedure call itself or recursive stored procedure?
- How many level SP nesting possible?
- Write a function that takes in a list of dictionaries with a key and list of integers and returns a dictionary with the standard deviation of each list.
Unanswered Python Questions
- Write a program to reverse a string.
- Try splitting on the given dataset.
- You have two sorted array of integers, write a program to find a number from each array such that the sum of the two numbers is closest to an integer i.
- How can you organize your code to make it easier to change the base class?
- How to fill the zeroes with mean or median? Is Array a matrix or matrix an array ?
- Can the lambda forms in Python contain statements? Why?Sort a List.
- What is a docstring?
- Which data visualization libraries do you use? What are your thoughts on the best data visualization tools?
- What is Scope Resolution in Python?
- Create a queue along with Push,pop function using Array.
- What are the different file processing modes supported by Python
- Define the following functions.
- Does Python support switch or case statement in Python?
- How will you find the second largest element in a Binary Search tree?
- What is the difference between Cluster and Non-Cluster Index?
- Why you need indexing?
- Which algorithm will you use to search the long sorted list for 4 elements?
- Is it possible to accept user inputs during runtime? How will you manage this process?
- What is a docstring?
- What does the zip() function do?
- How to execute a Python script on Unix?
- How is memory managed in Python?
- What is scope resolution in Python?
- What are different types of collation sensitivity?
- How to fill missing values?
- How to fill missing values?
- What file processing modes are supported by Python?
- Can we create a dataframe with multiple datatypes?
- Can lambda forms contain statements?
- Create list comprehension in Python.
- Display numbers using for loop.
- Check if an item exists in the dictionary.
Daily Quiz Repository
Daily Quiz Day 1 Questions
Daily Quiz Day 2 Questions
Daily Quiz Day 3 Questions
Daily Quiz Day 4 Questions
Python questions for data science interviews
We are pleased to inform that we have launched our Live Training session for anyone who wish to learn about Analytics domain. It was invite based for the last 3 batches. Now we are open to all.
Check all the details here – The Data Monk Super 10 and Super 20 Live Classes
There are some good interview questions on Guru.com
For any help, issues, resume overview, buying books, reviewing courses, etc. You can email us at [email protected] or [email protected]