IBM Principal coding interview questions
These are the 3 coding questions YourAlly has tagged for IBM at Principal. Principal is the common India title for this level. YourAlly treats it as Staff (E6), the same level as Google L6, Meta E6 and Amazon L7.
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 interviewers also expect clean code quickly and edge cases you raise before they do.
Practice a mock IBM Principal coding loopPractice IBM coding questions
Simulate Batch Initiators With DependenciesFree to read
A batch system runs jobs on a fixed number of initiators. A job can start once all its prerequisite jobs have finished. At time 0 and every time jobs finish, each free initiator takes the ready job with the smallest name. Given jobs, durations, dependency pairs [a, b] meaning a waits for b, and the initiator count, return the time the last job finishes, or -1 if some job can never run.
Input: jobs = [extract,sort,report,backup], durations = [3,2,4,5], deps = [[sort,extract],[report,sort]], initiators = 2 Output: 9
What a strong answer covers
- Event-driven simulation, not minute-by-minute
- Two heaps: ready by name, running by finish time
- Simultaneous finishes released before assignment
- Cycle reported as -1
- O((V + E) log V) time with 64-bit finish times
2 more coding questions
- Count Wildcard Topic Subscription Matches Locked
- Find the First Deadlock in a Lock Trace Locked
Related pages
More IBM Principal rounds
- Behavioral 3 questions
IBM coding at other levels
- SDE-3 6 questions
- Senior Principal 3 questions
Other companies at this level
- Adobe Principal 4 questions
- Amazon Principal 6 questions
- Apple Principal 7 questions
- Cisco Principal 3 questions
- Google Principal 14 questions
- Intel Principal 3 questions