IBM Python Developer
Coding Assessment Guide
Complete 3-Day Preparation Plan
Essential Patterns & Cheat Sheet
Table of Contents
1. Understanding the Assessment 2
2. Assessment Structure & Topics 2
3. 3-Day Preparation Plan 3
4. Essential Code Patterns 5
5. Common Algorithms 8
6. Day of Assessment Strategy 10
1. Understanding the Assessment
Platform: HackerRank
Role: Python Developer (Open Source)
Format: Timed assessment in single session
Deadline: Complete within 7 days (recommended: 3 days)
Key Points to Remember:
• Multiple choice questions + coding challenges
• Python is the preferred language - prioritized for next rounds
• Cannot pause once started - complete in one session
• Typically 60-90 minutes total duration
• Test technical knowledge AND problem-solving ability
2. Assessment Structure & Topics
Typical IBM HackerRank Pattern:
Component Quantity Time Difficulty
Coding Problems 2-3 problems 50-60 min Easy to Medium
Multiple Choice 10-15 questions 15-20 min Varies
SQL Queries 0-2 questions 10-15 min Basic to Medium
Common Topic Areas:
Coding Problems Focus:
• String manipulation & pattern matching
• Array/List operations (sorting, searching, transformations)
• Dictionary/HashMap problems
• Data structure implementation (stacks, queues, sets)
• Two pointers, sliding window techniques
• File handling or data parsing
• Mathematical computations
MCQ Topics:
• Python data structures (lists, tuples, dictionaries, sets)
• OOP concepts (classes, inheritance, polymorphism)
• Exception handling
• Lambda functions, map/filter/reduce
• List comprehensions
• Time/space complexity basics
• Basic SQL (joins, GROUP BY, aggregations)
3. Three-Day Preparation Plan
DAY 1: Python Fundamentals + Practice
Morning Session (3 hours):
• Review Python core: lists, tuples, dicts, sets
• String methods: split(), join(), strip(), slicing
• List comprehensions: [x*2 for x in nums if x > 0]
• Dictionary methods: get(), items(), values()
• Built-ins: sorted(), enumerate(), zip(), map(), filter()
• Practice MCQs on GeeksforGeeks Python Quiz
Afternoon Session (4 hours):
Solve 5-6 Easy Problems on HackerRank:
• HackerRank → Python → Practice
• Focus: Strings section (3 problems)
• Basic Data Structures (2 problems)
• Collections (1-2 problems)
Recommended Problems:
String validators, Merge the Tools, [Link](), DefaultDict Tutorial, Word Order
DAY 2: Medium-Level Problem Solving
Morning Session (3 hours):
Solve 4-5 Medium Difficulty Problems:
• Arrays: Find duplicates, rotate array, two-sum variations
• Strings: Anagrams, palindromes, substring problems
• HashMaps: Frequency counting, grouping
Key Problems to Practice:
Valid Anagram, Group Anagrams, Two Sum, Contains Duplicate, Longest Substring Without Repeating
Characters
Afternoon Session (3 hours):
• Learn algorithm patterns: Two Pointer, Sliding Window
• Frequency Counter Pattern
• Hash Map lookups
• Practice 3 problems using these patterns
DAY 3: Mock Test + Review
Morning (2 hours):
Take a Mock Assessment - HackerRank Python Basic Certification (free)
Or: Set 90-minute timer and solve 3 random medium problems
Afternoon (3 hours):
• Create quick reference sheet with code templates
• Review common mistakes (off-by-one errors, edge cases)
• Practice input handling patterns
• Review dictionary operations and list comprehensions
Evening (1-2 hours):
• Review notes and cheat sheet
• Practice 1-2 easy problems for confidence
• Get good sleep!
4. Essential Code Patterns
Input Handling Patterns
Single integer:
n = int(input())
Multiple integers:
a, b, c = map(int, input().split())
List of integers:
nums = list(map(int, input().split()))
Multiple lines:
lines = [input().strip() for _ in range(n)]
String Operations
Check substring:
if "pattern" in text:
Count occurrences:
count = [Link]("substring")
Replace:
new = [Link]("old", "new")
Split and join:
words = [Link](); result = "-".join(words)
Character frequency:
from collections import Counter; freq = Counter(text)
Check palindrome:
is_palindrome = (text == text[::-1])
List/Array Operations
List comprehension:
squares = [x**2 for x in range(10)]
Filter with condition:
evens = [x for x in nums if x % 2 == 0]
Sort with key:
[Link](key=len) # by length
Find max with key:
longest = max(words, key=len)
Remove duplicates:
unique = list(set(nums))
Enumerate:
for i, val in enumerate(nums):
Dictionary Operations
Frequency counter:
freq = {}; freq[item] = [Link](item, 0) + 1
Using Counter:
from collections import Counter; freq = Counter(items)
Default dict:
from collections import defaultdict; d = defaultdict(list)
Get with default:
value = [Link](key, default_value)
Iterate items:
for key, value in [Link]():
Sort by value:
sorted_items = sorted([Link](), key=lambda x: x[1])
Set Operations
Union:
set1 | set2
Intersection:
set1 & set2
Difference:
set1 - set2
Symmetric difference:
set1 ^ set2
Check membership O(1):
if item in my_set:
Useful Built-in Functions
Map:
squares = list(map(lambda x: x**2, nums))
Filter:
evens = list(filter(lambda x: x % 2 == 0, nums))
All/Any:
all_positive = all(x > 0 for x in nums)
Sum with condition:
total = sum(x for x in nums if x > 0)
5. Common Algorithms & Patterns
Binary Search (on sorted list)
def binary_search(arr, target): left, right = 0, len(arr) - 1 while left <= right: mid =
(left + right) // 2 if arr[mid] == target: return mid elif arr[mid] < target: left = mid
+ 1 else: right = mid - 1 return -1
Two Pointer Technique
def two_sum_sorted(arr, target): left, right = 0, len(arr) - 1 while left < right:
current = arr[left] + arr[right] if current == target: return [left, right] elif current
< target: left += 1 else: right -= 1 return []
Sliding Window (fixed size)
def max_sum_subarray(arr, k): if len(arr) < k: return -1 window_sum = sum(arr[:k])
max_sum = window_sum for i in range(len(arr) - k): window_sum = window_sum - arr[i] +
arr[i + k] max_sum = max(max_sum, window_sum) return max_sum
Frequency Counter (Anagram Check)
from collections import Counter def is_anagram(s1, s2): return Counter(s1) == Counter(s2)
Common Problem Patterns
Find Duplicates:
def find_duplicates(nums): seen = set() duplicates = set() for num in nums: if num in
seen: [Link](num) [Link](num) return list(duplicates)
Group Anagrams:
from collections import defaultdict def group_anagrams(words): groups = defaultdict(list)
for word in words: key = ''.join(sorted(word)) groups[key].append(word) return
list([Link]())
Rotate Array:
def rotate_array(arr, k): k = k % len(arr) return arr[-k:] + arr[:-k]
Check Unique Characters:
def has_unique_chars(s): return len(s) == len(set(s))
Time Complexity Quick Reference
O(1) Constant Dictionary/Set lookup
O(log n) Logarithmic Binary search
O(n) Linear Single loop through array
O(n log n) Log-linear Efficient sorting (sort())
O(n²) Quadratic Nested loops
O(2<super>n</super>)
Exponential Recursive fibonacci (avoid!)
Common Pitfalls to Avoid
• Integer division: Use // for floor division, / for float
• Modifying list while iterating over it
• Mutable default arguments: def func(arr=[]) # BAD
• Not handling None or empty input cases
• Off-by-one errors in loops and ranges
• Forgetting to return a value from function
• Using == instead of 'is' for None comparison
• Assuming string mutability (strings are immutable!)
6. Day of Assessment Strategy
Before Starting:
• Test your internet connection
• Close all unnecessary browser tabs and applications
• Have a glass of water nearby
• Ensure quiet environment for 90+ minutes
• Keep this cheat sheet open for reference
Time Management Strategy:
Step 1: Read ALL problems first (5 minutes)
Identify the easiest problem to start with
Step 2: Allocate time wisely
Component Time per Item Total
Easy coding problem 15-20 minutes ~20 min
Medium coding problem 25-30 minutes ~30 min
Multiple choice questions 1-2 minutes each 15-20 min
Buffer for review — 10 min
Problem-Solving Approach:
1. Read the problem statement TWICE carefully
2. Note constraints (input size, time limits, edge cases)
3. Think of brute force solution first
4. Write pseudocode or plan approach in comments
5. Code the solution
6. Test with provided sample input
7. Test edge cases (empty, single element, large input)
8. Optimize if time permits and if needed
If You Get Stuck:
• Don't panic - move to the next problem
• Partial solution is better than no solution
• Return later with fresh perspective
• Focus on passing as many test cases as possible
• Comment your logic to show your thinking
Before Submitting Each Solution:
✓ Test with sample inputs provided
✓ Test edge cases: empty input, single element, all same values
✓ Check for syntax errors
✓ Verify you're returning correct data type/format
✓ Ensure variable names make sense
✓ Remove debug print statements (unless needed)
Recommended Practice Resources
Primary Resources:
HackerRank (MOST IMPORTANT):
• Python Basic Certification - Take as mock test
• Python track problems - Easy and Medium
• Interview Preparation Kit
• Practice in same environment as actual test
LeetCode:
• Easy level problems (10-15 problems)
• Focus on 'Top Interview Questions' - Easy section
• Study problems tagged as 'Array', 'String', 'Hash Table'
GeeksforGeeks:
• Python quizzes for MCQ practice
• Output prediction questions
• Python programming examples
Must-Practice Problem Types:
• String manipulation (reverse, palindrome, anagram)
• Array operations (rotate, find duplicate, two sum)
• Dictionary/HashMap (frequency counter, grouping)
• Sorting with custom comparators
• List comprehensions and lambda functions
• Basic recursion (factorial, fibonacci)
• Stack/Queue problems (balanced parentheses)
• Set operations (union, intersection, difference)
Final Tips for Success
Mental Preparation:
• Get 7-8 hours of sleep the night before
• Eat a light meal 1-2 hours before the test
• Stay calm - you've prepared well
• Confidence is key - trust your preparation
• Read questions carefully - rushing leads to mistakes
Technical Preparation:
• Verify Python version on HackerRank (usually 3.x)
• Know which libraries are available (collections, itertools, etc.)
• Practice typing code quickly but accurately
• Familiarize yourself with HackerRank's code editor
• Understand input/output format requirements
During the Test:
• Start with problems you're most confident about
• Don't spend too long on any single problem
• Keep track of time - leave buffer for review
• Write clean, readable code with good variable names
• Add comments for complex logic
• Test your code before submitting
• If completely stuck, move on and come back later
Remember:
This assessment tests both your Python knowledge and problem-solving ability. Focus on writing clean, working
code rather than perfect code. Partial solutions that pass some test cases are better than no solution. Stay calm,
manage your time well, and trust your preparation.
Good luck! You've got this! ■
Practice consistently over the next 3 days, review this guide before the test, and approach each problem
methodically. Your preparation will pay off!