IBM Senior staff coding interview questions
These are the 3 coding questions YourAlly has tagged for IBM at Senior staff. On the YourAlly ladder this is Senior staff, the same level as Google L7, Meta E7 and Amazon L8.
A coding round at a large tech company usually runs 45 to 60 minutes with one or two problems. You write code that runs, test it on your own examples and state its time and space cost. At this level coding is often a smaller part of the loop, but the bar for clarity and speed stays high.
Practice a mock IBM Senior staff coding loopPractice IBM coding questions
Find the First Deadlock in a Lock TraceFree to read
A database grants exclusive locks. Given a trace of [op, txn, resource] events where op is acquire or release, simulate the lock manager: a blocked acquire waits in FIFO order, and a release hands the lock to the next waiter. Return the index of the first event that creates a deadlock cycle in the wait-for graph, or -1 if none occurs.
Input: events = [[acquire,T1,A],[acquire,T2,B],[acquire,T1,B],[acquire,T2,A]] Output: 3
What a strong answer covers
- Correct FIFO handoff on release
- Out-degree at most one, so a chain walk replaces general cycle detection
- Only blocking acquires checked
- Non-holder release and re-acquire treated as no-ops
- Complexity stated as O(E * L)
2 more coding questions
- Count Wildcard Topic Subscription Matches Locked
- Simulate Batch Initiators With Dependencies Locked
Related pages
IBM coding at other levels
Other companies at this level
- Adobe Senior staff 4 questions
- Airbnb Senior staff 4 questions
- Amazon L8 6 questions
- Anthropic Senior staff 5 questions
- Apple Senior staff 7 questions
- Cisco Senior staff 3 questions