YourAlly

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

  1. Count Wildcard Topic Subscription Matches Locked
  2. Simulate Batch Initiators With Dependencies Locked

Sign up free to practice all 3

Related pages

IBM coding at other levels

Other companies at this level