<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=555865791448670&amp;ev=PageView&amp;noscript=1">

Hire job fit candidates. Faster.

All Posts

Python Interview Question for Experienced

 Looking for Python interview questions? Here is the list of most important questions that can be asked in interviews. Make yourself ready with this comprehensive list of interview questions.

Python Interview Questions:

1. What will be the output of the code below in Python 2? Explain your answer.

def div1(x,y):

print "%s/%s = %s" % (x, y, x/y)

def div2(x,y):

print "%s//%s = %s" % (x, y, x//y)

div1(5,2)

div1(5.,2)

div2(5,2)

div2(5.,2.)

Also, how would the answer differ in Python 3 (assuming, of course, that the above [print] statements were converted to Python 3 syntax)?

2. What are the key differences between Python 2 and 3?

3. What are some alternative implementations to CPython? When and why might you use them?

4. How does Python's garbage collection work?

5. What is the difference between range and xrange? How has this changed over time?

6. Here's a function (Provide a function). Optimize it for me.

7. What will be the output of the code below?

List = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

print list [10:]

8. How does the GIL impact concurrency in Python? What kinds of applications does it impact more than others?

9. How do you iterate over a list and pull element indices at the same time?

10. How do you enforce ordering for a dictionary-style object?

11. How many ways can you append or concatenate strings? Which of these ways is fastest? Easiest to read?

12. What is PYTHONSTARTUP and how is it used?

13. Write a code for downloading a CSV in Python2 and Python3. (Provide a link to CSV file)

14. I'm getting a maximum recursion depth error for a function. What does this mean? How can I mitigate the problem?

15. Here's a class hierarchy with some methods defined. When I call this function, what gets printed?

Apart from these technical questions, ask these following general questions to find out more about candidates Python skills

16. What’s your favorite standard library module?

17. Tell me something you don't like about Python.

18. What was the most interesting project you have participated in? Can you describe it and tell why you consider it to be so interesting?

19. Do you like to participate in the analysis, design and deployment phases of a project or do you prefer to concentrate on the pure development of well-described task? Why?

20. I have noticed you listed Skill X on your CV. What’s your opinion about it?

21. Do you remember any programming project decision you made that was a failure? Why do you think it was a mistake? Why did it happen? What did you learn from this experience?

Nishi More
Nishi More
Nishi More is a Marketer and content writer at Interview Mocha. A writer who enjoys helping small businesses meet their hiring needs. When not writing she enjoys reading motivational books, latest trends in recruitment technology & explore new places.

Topics: Technical Hiring

Related Posts

Top 101 Remote Work Resources and Tools for hiring managers & team leaders

We are witnessing global crises due to the COVID-19 pandemic. We all are pumped up more than before to stay fit, healthy, and productive by functioning remotely or from home. 

The challenges that an IT leader can face when implementing digital transformation, and how to handle them

The whole world is moving towards digital transformation in this time. It comes with several lucrative benefits but also comes with challenges for an IT leader. And surpassing them will mean the difference between success and failure. Here’s a list of challenges any IT leader should be aware of and few important points you need to follow while handling these challenges. 

Keeping your people going - How Violeta Matei, Business Operations Manager at Kambr, helped ensure continuity and sanity during the pandemic

In this Q&A, Violeta Matei, Business Operations Manager at Kambr, speaks about the challenges HR teams can expect amidst the COVID pandemic. She explains how to cope with them to ensure an able and productive workforce and thriving in effecting continuity, all great tips for these times. Born and raised in Bucharest, Romania, Violeta has over 7 years experience as an HR Specialist, with companies such as Société Générale and IBM.   This interview has been edited for clarity and context.