Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: Python Interview Question And Answer
Description: Go through these top Python interview questions and answers to land your dream job
Description: Go through these top Python interview questions and answers to land your dream job
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
https://www
...
com
---------------------------------------------------------------------------------------------------------------------------------------------
1) What is Python? What are the benefits of using Python?
Python is a programming language with objects, modules, threads, exceptions and automatic
memory management
...
2) What is PEP 8?
PEP 8 is a coding convention, a set of recommendation, about how to write your Python code
more readable
...
While the process of retrieving
original Python objects from the stored string representation is called unpickling
...
Python program runs directly from the source code
...
5) How memory is managed in Python?
•
•
•
Python memory is managed by Python private heap space
...
The programmer does not have an access to this
private heap and interpreter takes care of this Python private heap
...
The core API gives access to some tools for the programmer to code
...
6) What are the tools that help to find bugs or perform static analysis?
PyChecker is a static analysis tool that detects the bugs in Python source code and warns about
the style and complexity of the bug
...
7) What are Python decorators?
A Python decorator is a specific change that we make in Python syntax to alter functions easily
...
guru99
...
Tuple can be hashed
for e
...
9) How are arguments passed by value or by reference?
Everything in Python is an object and all variables hold references to the objects
...
However, you can change the objects if it is mutable
...
11) What are the built-in type does python provides?
There are mutable and Immutable types of Pythons built in types Mutable built-in types
•
•
•
List
Sets
Dictionaries
Immutable built-in types
•
•
•
Strings
Tuples
Numbers
12) What is namespace in Python?
In Python, every name introduced has a place where it lives and can be hooked for
...
It is like a box where a variable name is mapped to the object placed
...
13) What is lambda in Python?
It is a single expression anonymous function often used as inline function
...
15) What is pass in Python?
Pass means, no-operation Python statement, or in other words it is a place holder in compound
statement, where there should be a blank left and nothing has to be written there
...
guru99
...
17) What is unittest in Python?
A unit testing framework in Python is known as unittest
...
18) In Python what is slicing?
A mechanism to select a range of items from sequence types like list, tuple, strings etc
...
19) What are generators in Python?
The way of implementing iterators are known as generators
...
20) What is docstring in Python?
A Python documentation string is known as docstring, it is a way of documenting Python functions,
modules and classes
...
copy () or copy
...
You
cannot copy all objects but most of them
...
For positive index, 0 is the first
index, 1 is the second index and so forth
...
23) How you can convert a number to a string?
In order to convert a number into a string, use the inbuilt function str()
...
24) What is the difference between Xrange and range?
Xrange returns the xrange object while range returns the list, and uses the same memory and no
matter what the range size is
...
guru99
...
Each Python program file is a module, which
imports other modules like objects and attributes
...
A package can have modules or
subfolders
...
Global variables: Those variables that are only referenced inside a function are implicitly global
...
Import
the config module in all modules of your application
...
28) Explain how can you make a Python Script executable on Unix?
To make a Python Script executable on Unix, you need to do two things,
•
•
Script file's mode must be executable and
the first line must begin with # ( #!/usr/local/bin/python)
29) Explain how to delete a file in Python?
By using a command os
...
unlink(filename)
30) Explain how can you generate random numbers in Python?
To generate random numbers in Python, you need to import command as
import random
random
...
guru99
...
For instance, 10//5 = 2 and 10
...
0 = 2
...
33) Mention five benefits of using Python?
•
•
•
•
•
Python comprises of a huge standard library for most Internet platforms like Email, HTML,
etc
...
It gives a list of all words present in the string
...
Werkzeug and jingja are two of its dependencies
...
Which means it will have little to no dependencies on
external libraries
...
36) Mention what is the difference between Django, Pyramid, and Flask?
Flask is a “microframework” primarily build for a small application with simpler requirements
...
Flask is ready to use
...
It provides flexibility and lets the developer use the right
tools for their project
...
Pyramid is heavy configurable
...
It includes an ORM
...
Features include for Flask WTF are
•
•
•
•
•
•
Integration with wtforms
Secure form with csrf token
Global csrf protection
Internationalization integration
Recaptcha supporting
File upload that works with Flask Uploads
https://www
...
com
---------------------------------------------------------------------------------------------------------------------------------------------
38) Explain what is the common way for the Flask script to work?
The common way for the flask script to work is
•
•
Either it should be the import path for your application
Or the path to a Python file
39) Explain how you can access sessions in Flask?
A session basically allows you to remember information from one request to another
...
The user can modify
the session if only it has the secret key Flask
...
40) Is Flask an MVC model and if yes give an example showing MVC pattern for your
application?
Basically, Flask is a minimalistic framework which behaves same as MVC framework
...
route(“/”)
Def hello():
return “Hello World”
app
...
route(“/”)
Def hello():
return “Hello World”
•
While you model or main part will
be
app
...
Such system requires creating a schema,
which requires piping the shema
...
So you need to install sqlite3
command in order to create or initiate the database in Flask
...
guru99
...
They are called after the response been constructed
...
42) You are having multiple Memcache servers running Python, in which one of the memcacher
server fails, and it has your data, will it ever try to get key data from that one failed server?
The data in the failed server won’t get removed, but there is a provision for auto-failure, which
you can configure for multiple nodes
...
43) Explain how you can minimize the Memcached server outages in your Python Development?
• When one instance fails, several of them goes down, this will put larger load on the database
server when lost data is reloaded as client make a request
...
When your Memcached server goes down, the client will keep trying
to send a request till the time-out limit is reached
44) Explain what is Dogpile effect? How can you prevent this effect?
Dogpile effect is referred to the event when cache expires, and websites are hit by the multiple
requests made by the client at the same time
...
In this system when value expires, first process acquires the lock and starts generating new
value
...
Data should always be available through another source as well
• Memcached is just a key or value store and cannot perform query over the data or iterate over
the contents to extract information
• Memcached does not offer any form of security either in encryption or authentication
https://www
...
com
---------------------------------------------------------------------------------------------------------------------------------------------
Guru99 Provides FREE ONLINE TUTORIAL on Various courses like
Java
MIS
MongoDB
BigData
Cassandra
Web Services
SQLite
JSP
Informatica
Accounting
SAP Training
Python
Excel
ASP Net
HBase
Test Management
Business Analyst
Ethical Hacking
PMP
Live Project
SoapUI
Photoshop
Manual Testing
Mobile Testing
Data Warehouse
R Tutorial
Tableau
DevOps
AWS
Jenkins
Agile Testing
RPA
JUnit
Software
Engineering
Selenium
CCNA
AngularJS
NodeJS
PLSQL
Project
Management
Title: Python Interview Question And Answer
Description: Go through these top Python interview questions and answers to land your dream job
Description: Go through these top Python interview questions and answers to land your dream job