IBM's OA was unproctored. Here are a few pitfalls to watch out for:
Q1: Tree Pythagorean Triples
The problem: Given a tree and three fixed vertices x, y, z, count the vertices whose distances to those three vertices, sorted as a ≤ b ≤ c, form a Pythagorean triple: a² + b² = c², with all three distances positive integers.
My approach: Run BFS or DFS once from each of x, y, z, record the distances to every vertex, then scan the tree once. The complexity is O(N). If you write a recursive solution in Python, watch out for RecursionError.
Q2: Debugging the ShowPass ticketing system, a practical engineering task
The setup was an actual Django + Redis architecture. Don't be scared off by the dozens of files; you only need to change about 50 lines.
The three bugs:
Filters not working: The search parameters weren't chained into the QuerySet.
Pagination crashing: There was no exception fallback when page/page_size received values that weren't positive integers.
Stale data: Creating or editing an event didn't evict the Redis cache. Add cache.delete.
I'd aim to finish Q1 in 15–20 minutes and leave most of the time for searching the project's URLs to locate the code.
Hope everyone gets interviews and lands an offer!
Discussion
Loading comments…