Python Interview questions – Part1

• Write a program to execute command on remote machine and get the out of command
• Best way to read bigger size files > 10GB
• Explain Python Global interpreter lock
• Validate file copy by calculating its hash (hashlib module)
• Write a program to find URLs in a text file and verify if the URL is valid
• Write a Python program to check if the input python module/package is already installed, upgrade the module/package if already present, install the module if not present (using pip)
• Find the maximum nested depth of curly braces
Wrongly ordered braces should return -1
Example:
Input: {a+b} * {b+c}. Output: 1
Input: {a + {c + {e / 9} – d} * 4} Output: 3
Input: {a – c *{s} Output: -1

Leave a comment