Medium-level python questions from real data engineering interviews.
These medium 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. This set leans toward the medium-difficulty band most real interviews actually live in (16 of 16). Recurring themes are join, partition, and python — these patterns appear most often in real interviews and reward the deepest preparation. These questions have been reported across 15 companies including Capco and American Express. Average answer is around 1 minute of reading — plan roughly 1 hour to work through the full set thoughtfully.
This collection contains 16 curated questions: 0 easy, 16 medium. The balanced mix of difficulties makes this set suitable for engineers at any career stage.
The most frequently tested areas in this set are join (12), partition (6), python (5), spark (3), snowflake (1), and window (1). Focusing on these topics will give you the highest return on your preparation time.
Medium-difficulty questions form the bulk of real interviews — spend the most time here and practice explaining your reasoning out loud. For each question, try answering before revealing the solution. Use our AI Mock Interview to simulate real interview conditions and get instant feedback on your responses.
Write a Python function to check if a string is a palindrome.
Write a Python function to check if a string is a palindrome.
Create a Python program to demonstrate the use of set operations (union, intersection).
Describe Spark's memory management model. How do you handle heap memory overhead issues?
Extended the solution to determine the nth largest element in an array.
GeoPandas - definition and features
Grouping and aggregation functions?
How many cities does each department operate in? List the top 3 departments in terms of the most number of cities. In case of a tie, order by dept_id.
How would you decide between using DISTKEY and SORTKEY?
Implement an algorithm to find the longest common prefix among an array of strings.
List customers with more than 5 orders.
List every combination of dept_name, employee_name, and city such that the employee belongs to the department and the same city in which the department is located.
Reverse a string with special characters preserved.
Write Python code to remove duplicates from a string.
Write a Python program to reverse words in a string.
Write a function that replaces all characters in a list except for a given character
The Data Engineering Interview Answer Vault bundles 750+ reviewed answers into 7 focused PDF volumes — SQL, Spark, Python, System Design, Cloud, Behavioral, and Data Modeling. Study on any device, no subscription required.
800+ hands-on courses — Grokking System Design, Coding Patterns, and AI mock interviews for your DE loop.
Turn any topic or your own notes into an interactive, personalized course in 60 seconds.
The book that gets data engineers through system-design rounds. Essential reading.
Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.
Reading answers is step one. Get instant AI feedback on your answers, run mock interviews, and track readiness — built specifically for data engineering interviews.