Easy-level python questions from real data engineering interviews.
These easy python questions are selected from real interviews at top companies. Each question includes a detailed expert answer and pro tip to help you nail your interview.
What are traits in Scala, and how are they different from classes?
What is the difference between a list and a tuple in Python?
Explain the difference between shallow copy and deep copy in Python.
Write a Python function to find the first non-repeating character in a string.
What are decorators in Python, and how do they work?
Explain the difference between args and kwargs in Python.
Write a Python function to find the first non-repeating character in a string.
Explain the difference between a list and a tuple in Python.
How do you handle exceptions in Python? Provide an example.
What is the difference between shallow copy and deep copy in Python?
Write a Python function to find the first non-repeating character in a string.
What are decorators in Python, and how do they work?
Explain the difference between args and kwargs in Python.
What is the difference between a set and a list in Python?
How do you handle memory management in Python?
Write a Python function to find the maximum value in a list without using the built-in max() function.
Amazon Deequ usage and what sort of quality checks are done using it?
Anagram Detection - find all anagrams from a given list of strings
Can you give an example of processing nested JSON data using these functions?
Case Class and StructType Syntax
Check if a number is prime.
Closure Function - explain
Collaborating with cross-functional teams to resolve data quality issues
Compare compression algorithms: Gzip vs Snappy.
Concatenating lists within a range using list comprehensions
Convert a Binary Search Tree (BST) into a skewed tree in either increasing or decreasing order
Convert a sorted array into a Binary Search Tree
Convert the list [1, [2, 3], 4, 5, 6, [7, 8, 9]] to a single list [1, 2, 3, 4, 5, 6, 7, 8, 9].
Count of Alphabets in String
Create a dictionary with list elements as keys and their occurrences as values.
Create a function to detect anomalies in sales trends using Pandas and NumPy.
Create a script to parse and transform a JSON file into a structured CSV.
DSA: Array-based problem - brute-force and optimized solutions
Describe script implementation and deployment.
Detect a loop in a singly linked list
Develop a Python script to clean data by removing duplicates and handling missing values.
Differences between Stack, Queue, and Linked List
Discuss the tech stacks and responsibilities at Morgan Stanley
Discuss your approach to unit testing in your code.
Explain Lambda functions in Python.
Explain Stack vs Unstack and their use in data transformation.
Explain and implement Semaphore in Java
Explain techniques for ensuring data quality in cross-functional team scenarios
Explain the difference between mutable and immutable objects in Python.
Explain the differences between multiprocessing and multithreading.
Explain the internal working of a HashMap
Explain this code: [f(2) for f in [lambda x: x * i for i in range(5)]].
Fibonacci Series Problem - solve using brute force and optimized approaches
Find pairs with sum X from a list of numbers
Find the Lowest Common Ancestor (LCA) in a Binary Tree.
Find the minimum and maximum values in an array
Find the next greatest element in a linked list.
Find the three numbers from a list whose multiplication equals 180
Finding Complete String Pairs - identify pairs of strings that when concatenated contain all 26 English alphabets
Flatten nested lists recursively using Python
Garbage Collector in Python - explain
Given a list of integers, write a Python function to return the number of unique pairs that sum up to a target.
Given a list of intervals, merge the overlaps. How do you optimize it?
Given a string 'AAAVGXFHHFSGFGGLK', find the non-repeating letters.
Given an n-ary tree, write code to flatten it and store the output in a list.
Download the complete interview prep bundle with expert answers. Study offline, on your commute, anywhere.