Frequently asked Python interview questions with concise answers — data types, comprehensions, functions and pandas basics. Practise them in a free AI mock interview.
Practise these in a free AI mock interviewLists are mutable and use []; tuples are immutable and use (). Use tuples for fixed collections and as dictionary keys, and lists for data that changes.
An insertion-ordered collection of key-value pairs with fast lookups by key, written {}. Keys must be unique and hashable.
A concise way to build a list: [x*x for x in range(5)] gives [0, 1, 4, 9, 16]. It is more readable and often faster than a for-loop with append.
== compares values (are they equal?); is compares identity (the same object in memory?). Use == for value checks and is mainly for None.
*args collects extra positional arguments into a tuple; **kwargs collects extra keyword arguments into a dict. They let a function accept a variable number of arguments.
A small anonymous function, e.g. square = lambda x: x*x. Handy for short throwaway functions such as a key in sorted().
append(x) adds x as one element; extend(iterable) adds each element of the iterable. [1,2].append([3,4]) gives [1,2,[3,4]]; extend gives [1,2,3,4].
A function that wraps another to add behaviour (logging, timing, auth) without changing its code, applied with @decorator syntax.
Through reference counting plus a cyclic garbage collector that frees objects no longer referenced. You usually do not manage memory manually.
A Series is a 1D labelled array (like a column); a DataFrame is a 2D labelled table of rows and columns. They are the core structures for data analysis in pandas.
Knowing the answers isn’t enough — say them out loud
Practise these Python questions in a free AI mock interview: answer by voice, get instant feedback on your strengths and the gaps to fix.
Admissions open · free to apply
Attended a masterclass or have a friend's referral code? You get ₹15,000 off. Fill this and our team takes it from here — pay by cash or online.