Python Interview Questions
- 0of 0 votes
AnswersIs python a case sensitive language?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersName some of the features of Python.
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat are the applications of Python?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is Python?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersFind the error in this code and what will be the output?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is lambda function in python?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the difference between del() and remove() methods of list? Give Examples.
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersHow will you check in a string that all characters are alphanumeric?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersHow will you randomizes the items of a list in place?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWrite a function to give the sum of all the numbers in list?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWrite a program to calculate number of upper case letters and number of lower case letters?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersHow will you get all the keys from the dictionary?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersHow will you create a dictionary in python?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat are Python's dictionaries?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the output of print tuple + tinytuple if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 ) and tinytuple = (123, 'john')?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the difference between tuples and lists in Python?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the basic difference between Python version 2 and Python version 3?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the purpose of PYTHONHOME environment variable?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the purpose of PYTHONCASEOK environment variable?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the purpose of PYTHONSTARTUP environment variable?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersWhat is the purpose of PYTHONPATH environment variable?
- mythili.vestino April 30, 2021 in India for HR| Report Duplicate | Flag | PURGE
vestino technologies HR Executive Python - 0of 0 votes
AnswersI was asked the following question in an interview recently, which was a lot more vague and after asking clarification questions came down to this:
- randomCoder May 13, 2020 in Canada
```
We have to perform N tests [1, 2, ... N] but in randomized order.
We have access to two functions test(x) and rand(x) which both take an integer.
test(x) returns if the current test was succesful or not and rand(x) returns a random integer
from 1<= rand(x) <= x.
The tests fail because of the sequeunce of tests carried out and we want to figure out which
sequences are bad and which sequences are good.
Basically our task is to generate a sequence of test while carrying them out and return the
sequence either when the test failed or when all tests are done.
```
I understand that the problem could be simplified by calling rand(N) just once, say x = rand(N) then we get the xth permuation of the seuence (1...N) and then call the test() function on this sequence reutrning only the part of sequence that finished successfully, this is deterministic and can be done in O(N) time.
Is there a better approach / solution in Python?| Report Duplicate | Flag | PURGE
Amazon Software Developer Python - 0of 0 votes
AnswersGiven two strings of comma-seperated values, sort and return the second list based on the ordering of the first list.
- jkatzwhitew January 29, 2019 in United States| Report Duplicate | Flag | PURGE
Linode Python Developer Python - 0of 0 votes
AnswersGiven an array of 100 numbers, find the (unique set) of duplicate values.
- jkatzwhitew January 29, 2019 in United States| Report Duplicate | Flag | PURGE
Linode Python Developer Python - 0of 0 votes
AnswersFind all of the different permutations of a string without using any built-in permutation functions. Your answer should not contain duplicates.
- jkatzwhitew January 29, 2019 in United States| Report Duplicate | Flag | PURGE
Linode Python Developer Python - 0of 0 votes
AnswersWe woild like to encourage passegers to experience the joy of travel using our transit system, therefore we would like to determine the longest path available to advertise the public. Specifically we would like to determine the longest possible trip on the transit sytem that will involve TWO tickets. The destinations must be connected, and all destinations must be unique.
- NoobieCoder3 November 10, 2018 in United States for Python development
You will be provided input in the format of CHI:NYC:719 where CHI is one location, NYC is a connected locatoion and 719 is the distance between the locations.
one line of output should be provided per line of input in the format of 3167:CHI:NYC:LA where 3167 is the distance of the trip, CHI is the starting, NYC is the intermediary location and LA is the final location.
sequence-------input---------------------------output
1------------------CHI:NYC:719----------------NONE
2------------------NYC:LA:2414----------------3133:CHI:NYC:LA
3------------------NYC:SEATTLE:2448------4862:LA:NYC:SEATTLE
4------------------NYC:HAWAII:4924---------7372:HAWAII:NYC:SEATTLE
Note: the start and end cities are lexicographical sorted.| Report Duplicate | Flag | PURGE
Jr. Software Engineer Python - 0of 0 votes
AnswersRead data from a API call that gives org structure data in JSON format and arrange that data in requested format
- logan July 05, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Site Reliability Engineer Python - 0of 0 votes
Answerslog file parsing.
- logan July 05, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Site Reliability Engineer Python - 0of 0 votes
Answersprint LinkedIn if a number is divisible by 4 and 6, Linked if it is divisible by 4 and in it is by 6.
- logan July 05, 2018 in United States| Report Duplicate | Flag | PURGE
Linkedin Site Reliability Engineer Python - -3of 3 votes
AnswersModify the following code:
def GenerateGraph(data): d = {} g = Graph() for word in data: for i in range(len(word)): bucket = word[:i] + '_' + word[i+1:] if bucket in d: d[bucket].append(word) else: d[bucket] = [word] for v in d.keys(): for word1 in d[v]: for word2 in d[v]: if word1 != word2: g.addEdge(word1,word2) return g
The objective is to find all combination of words by changing one letter at a time and adding to the graph if word exists in the dictionary.
- newbiepython January 28, 2018 in United States
We need to rewrite a different logic for the above code.| Report Duplicate | Flag | PURGE
Google Software Developer Python