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

Razormet Technology Internship 2024 For Junior Data Analyst | Work From Home

  Razormet Technology Internship 2024:  Razormet Technology Internship 2024 for its Junior Data Analyst. Razormet Technology Drive organizes off-campus drives for candidates in any batch. To apply, candidates should have a Bachelor’s degree in mathematics, engineering, economics, statistics, computer science, information management, or a related field. if you are interested, please apply as soon as possible. Company Name: Razormet Technology Role: Junior Data Analyst Location: Remote Experience: 0 – 1 years Qualification: Bachelor’s degree in mathematics, engineering, economics, statistics, computer science, information management or related field Batch: Any Job Type: Full Time Salary: INR 400,000 – 500,000 Razormet Technology Internship 2024 Job Description: As an Associate Data Analyst, you will become a subject-matter expert in automotive industry data and analysis. You will develop a working understanding of multiple data flows from ingestion to application, directly impac...

IBM Hiring Fresher Procurement Purchase Executive

At IBM, work is more than a job – it’s a calling: To build. To design. To code. To consult. To think along with clients and sell. To make markets. To invent. To collaborate. Not just to do something better, but to attempt things you’ve never thought possible. Are you ready to lead in this new era of technology and solve some of the world’s most challenging problems? If so, let's talk. IBM  looking for passionate fresher graduates with excellent communication skills, good Customer Service skills, and Interpersonal Skills for the role of  Procurement Purchase Executive. Job Designation: Procurement Purchase Executive Qualification:  Bachelor’s Degree Experience:  Freshers / 0 – 1 years Skill Set : Good Customer Service skills and Interpersonal Skills. Proficient working knowledge of MS Office. Familiar with procurement and purchase policies. Problem Solving – Identifies and resolves problems promptly; Gathers and analyses information skillfully. Customer Service – Mana...

Razormet Technologies Hiring Drive 2024 For Data Analyst / Analysis | Work From Home

Razormet Technologies Hiring Drive 2024:  Razormet Technologies Hiring Drive 2024 for its Data Analyst / Analysis. Razormet Technologies Drive organizes off-campus drives for candidates in the 2024 batch. To apply, candidates should have a Bachelor’s degree in Business Analytics, Computer Science, or a related field. if you are interested, please apply as soon as possible. Company Name: Razormet Technologies Role: Data Analyst / Analysis Location: Remote Experience: 0-1 years Qualification: Bachelor’s degree in Business Analytics, Computer Science, or a related field Batch: 2024 Job Type: Full Time Salary: INR 4.0 – 5.0 Razormet Technologies Hiring Drive 2024 Job Description: In this role, you will work with the Lead Data Engineer to serve as the technical experts within the Business Intelligence & Analytics group to support firm-wide reporting needs. A strong background in DOMO combined with writing complex R scripts is highly valued. An ideal candidate is adept at integrating...