Crack the Code: Python Interview Prep in 15
Sessions
Prerequisites : No prior programming needed—just Python 3.x installed, a code editor,
basic computer skills, and willingness to practice.
Program overview : A focused Python interview prep covering core syntax, data types,
string operations, and functions—designed to build clean, Pythonic code fluently in
interview
Session 1: Core Syntax & Control Flow
● Topics: Variables, data types (int, float, str, bool), and indentation
● Control structures: if, elif, else, loops (for, while)
Session 2: Built‑in Data Types & Collections
● Key concepts: Comparison / vs //, indentation rules
● Topics: Lists, tuples, sets, dicts—properties and use cases
Session 3: Working with Lists , Tuples , Dict
● Operations: Indexing, slicing, adding/removing items
● Comprehensions: List, set, dict comprehensions
Session 4: Strings & Regular Expressions
● Topics: String methods (.upper(), .lower(), .join(), .split(), .strip())
● Operations: Slicing, formatting, character checks (isalnum()), regex basics
● Practice: Parse CSV lines, validate email formats
Session 5: Functions & Scope
● Topics: def, parameters vs arguments, return vs print, mutability, default
parameters
● Advanced usage: Positional, keyword arguments, *args, **kwargs, multiple
return values
● Scope: Local vs global variables
Session 6: String & Array Challenges
● FizzBuzz Variation – Print 1–100, but for multiples of 3 print "Fizz", 5 print
"Buzz", and both print "FizzBuzz"
● Zero-sum Subarrays – Given an array, find all subarrays whose sum equals
zero
● Triplet Maximum Product – Find three numbers in a list whose product is
maximized
.Session 7: Sample coding Questions
● Find Missing Number – From 1 to n with one missing, identify the missing
integer
● Minimum Difference Pair – Given a list, find the pair with the smallest absolute
difference
Session 8: String & Permutation Logic
● Anagram Checker – Check if two strings are anagrams
● Longest Common Prefix – Find the longest common prefix among a list of
strings
● Permutations Generator – Generate all permutations of a list (or string)
Session 9: Number & Math Problems
● Prime Checker – Determine if a number is prime
● Fibonacci Series – Generate first n Fibonacci numbers, both iterative and
generator versions
● Armstrong Number Checker – Check if a number is an Armstrong number
Session 10: List & Numeric Analysis
● Second-largest Element – Find the second-highest number in a list without
sorting
● Duplicate Removal – Remove duplicate characters or numbers, preserving
order
● Intersection of Lists – Return common elements between two lists.
Session 11: Problem solving
● Find the sum and product of digits of a given number
● Check given number is armstrong or not
● Find the factorial of a number
Session 12: Pattern programming
● Full Pyramid of Stars: Given n, print a centered pyramid of * with n rows.
● Inverted Number Pyramid: For input n, print rows of numbers from 1 to n,
then decrement n by 1 each subsequent row.
● Diamond Number Pattern: Print a diamond shape using numbers
incrementally (top half ascending, bottom half descending).
Session 13: Pattern programming
● Hollow Square of Stars: For size n, print a square border of *, leaving interior
spaces empty.
● Floyd’s Triangle: Print Floyd’s triangle with n rows of sequential numbers.
● Palindromic Number Pyramid: Print a pyramid where each row is a
palindrome of numbers increasing to the row number then decreasing.
Session 14 : Normal Coding problems
● Reverse Words: Given a sentence, reverse the order of words (e.g. "Hello
world" → "world Hello").
● Vowel & Consonant Counter: Count the number of vowels and consonants in
a sentence.
● Unique Character Checker: Determine if a string contains all unique
characters.
Session 15 : Normal Coding problems
● Second-Largest Number: Find the second-highest number in a list without
using sort().
● Sum of Digits: Compute the sum of all digits in a given integer.
● Decimal-to-Binary Converter: Convert an integer into its binary representation
as a string.
● Palindrome Detector: Check if a string or number is a palindrome.