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

PubMatic Recruitment 2024 for Software Engineer – Data Analytics

PubMatic Recruitment 2024 for its Software Engineer – Data Analytics, PubMatic Drive is organizing Off Campus Drive for candidates in the 2023 Batch. In order to apply, candidates should have a degree in B.E/B.Tech/MCA Degree. If you are interested, Please apply as soon as possible. Company Name: PubMatic Role: Software Engineer – Data Analytics Location: Pune Experience: Freshers Qualification: B.E/B.Tech/MCA Batch: 2023 Batch Job Type: Full Time Salary: Rs.10LPA(Expected) PubMatic Recruitment 2024 Job Description: PubMatic is hiring candidates who can design and implement next-generation highly scalable, distributed, and low-latency applications. If you get excited building applications and architecture to handle 100’s billions of requests per day, managing millions of requests per second with a creative and fast-paced work environment, competitive pay, great incentives, a culture of teamwork, smart and friendly colleagues, and plenty of opportunity to grow in your career then you sh