Skip to main content

Python interview questions. Part I. Junior

 


Questions

Q: What is Python?

Q: What is the lambda function in Python? Why does it exist in Python?

Q: What is pass in Python?

Q: What is *args**kwargs in function definition?

Q: What is docstring in Python? How to write them? Are they required?

Q: What are the built-in data types that Python provides? Which of them are mutable, which are immutable?

Q: What is the difference between list and tuple types in Python?

Q: What keywords can be used in conjunction with the for keyword?

Q: What could be the key in dict?

Q: What's the difference between globals()locals(), and vars()?

Q: What is PEP8 ?

Q: What is slicing in Python?

Q: Is it possible to have a negative index in iterative types in Python?

Q: What is the __init__.py module? What it's for?

Q: How can I swap values of variables in Python?

Q: How do I view object methods?

Q: How do you get documentation on objects' methods in Python?

Q: What is a module in python? What is a package? What is the difference between packages and modules in Python?

Q: Can you write multithreading applications in Python? What is the difference between multithreading and multiprocessing?

Q: What is a decorator? How to create a custom decorator?

Q: What is @classmethod@staticmethod@property?

Q: What is the difference between @classmethod and @staticmethod?

Q: Does Python fully support OOP?

Q: What is the __dict__ attribute of an object in Python?

Q: What the self is used for in Python?

Q: What is the __init__ method used for?

Q: Explain how to make a Python script executable on Unix?

Q: What is pickling and unpickling(marshaling and unmarshaling)?

Code involving questions

Q: Write a function that produces the Fibonacci sequence.

Q: How to translate a string containing a binary code (1 and 0) into a number (integer)? Write a function to do this.

Q: How to check that tuple A contains all elements of tuple B. Do both tuples contain unique values? Write a function to do this.

Q: What is the output of the following code?

def f():
     x = 15
     print(x)
x = 12
f()

Q: How to convert a string to a number that consists of letters ASCII code. Example: 'abcd' -> 979899100. Write a function to do this.

Q: How to remove empty lines from a list of lines (with a length of 0). Write a function to do this.

Q: Write a function that counts all distinct pairs with a difference equal to k.

Q: Write a function that returns a string of numbers from 0 to 100, "0123456789101112...".

Q: Write a function that makes a list with unique items from a list with duplicate items. Example: [1, 1, 2, 3, 3] -> [1, 2, 3].

Q: Make a list of prime numbers from the range (1, 100) using Python.

Q: Write a program that prints the numbers from 1 to 20. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers that are multiples of both three and five print “FizzBuzz”.


Follow Us On Telegram for more click here

Comments

Popular posts from this blog

Data Analysis Interview Question Basic+Adv

  1.    Behavioral Questions : ·     Tell me about a time when you had to analyze a large set of data. How did you approach it, and what was the outcome? ·       Describe a situation where you had to work on a project with tight deadlines. How did you prioritize your tasks? ·       Can you discuss a time when you faced a significant challenge while working in a team? How did you handle it? 2.    Analytical Questions : ·       How would you determine the success of a new product launch on Amazon? ·       If given sales data, how would you identify trends and make recommendations to improve sales performance? ·       How would you assess the impact of changes in pricing on customer behavior and sales? 3.    Case Study/Problem-Solving Scenarios : ·       Analyze a dataset showing customer purchase behavior on Amazon and suggest strategies to increase customer engagement or retention. ·       Given fluctuating sales figures for a particular product category, what factors would you consider

Bytemetrics Solutions Internship 2024 For Data Analyst / Analysis | Work From Home

  Bytemetrics Solutions Internship 2024:  Bytemetrics Solutions Internship 2024 for its Data Analyst / Analysis. Bytemetrics Solutions Internship Drive organizes off-campus drives for candidates in any batch. To apply, candidates should have a Graduate. if you are interested, please apply as soon as possible. Company Name: Bytemetrics Solutions Role: Data Analyst / Analysis Location: Remote Experience: 0 – 1 years Qualification: Graduate Batch: Any Job Type: Full Time Salary: INR 400,000 – 500,000 Bytemetrics Solutions Internship 2024 Job Description: As a Data Analyst at Color Paper India Pvt Ltd you will have the opportunity to gain hands-on experience in data analysis and contribute to real-world projects. Requirements: Currently enrolled in or recent graduate of a relevant academic program. Strong analytical skills with attention to detail. Proficiency in data analysis tools such as Excel, SQL, or Python (preferred but not required). Excellent communication and teamwork skills. Abi

Nindo Education LLP Hiring Drive 2024 For Data Analyst Trainee | Location Mumbai

  Nindo Education LLP Hiring Drive 2024:  Nindo Education LLP Hiring Drive 2024 for its Data Analyst Trainee. Nindo Education LLPDrive organizes off-campus drives for candidates in any batch. To apply, candidates should have a bachelor’s degree. if you are interested, please apply as soon as possible. Company Name: Nindo Education LLP Role: Data Analyst Trainee Location: Mumbai Experience: 0-1 years Qualification: Bachelor’s degree Batch: Any Job Type: Full Time Salary: ₹ 4,00,000 – 5,00,000 Nindo Education LLP Hiring Drive 2024 Job Description: As a data analyst trainee at Nindo Education LLP, you will have the opportunity to work with a dynamic team and gain hands-on experience in the field of data analytics. We are looking for a candidate who is proficient in Python, R Programming, Power BI, and Tableau, and has a strong understanding of data analytics concept Responsibility: Assist in collecting, organizing, and analyzing data from various sources to provide insights and recommenda