I just completed the 26NG OA for IBM on HackerRank, and overall the experience can be summarized in two words: stable and standard. The format was very typical — two coding questions with sufficient time provided. The problems were not tricky, mainly focused on common data structure and algorithm applications. However, getting AC in one go still requires solid fundamentals and careful boundary handling.
26NG IBM OA Question 1
Problem: For each query, compute the total number of possible square subgrids in a grid.
Key Idea:
- The number of squares with side length a is: (r - a + 1) * (c - a + 1)
- a ranges from 1 to min(r, c)
- Instead of brute force enumeration, simplify using summation formulas
- The final result can be computed in O(1)
This is a pure math simplification problem. No need to enumerate each square size explicitly. Just be careful with integer overflow — use long instead of int if constraints are large.
26NG IBM OA Question 2
Problem: Given a binary string (containing only '0' and '1'), determine whether it can become a palindrome and compute the minimum number of swaps required.
Step 1 — Feasibility Check:
- Let n be the string length
- Let count1 be the number of '1's
- If n is even → count1 must be even
- If n is odd → count1 must be odd
If the parity condition fails, forming a palindrome is impossible.
Step 2 — Minimum Swaps:
- Traverse the first half of the string
- Compare s[i] with s[n - 1 - i]
- Count mismatched pairs
- Answer = mismatched_pairs / 2
The implementation is short and clean. The key is validating feasibility before calculating swaps.
Overall Takeaways
The IBM 26NG OA is not extremely difficult, but stable execution matters. Many candidates don’t fail because they don’t know the solution — they fail because of:
- Boundary condition mistakes
- Small implementation bugs
- Wasting time debugging during the test
- Careless overflow issues
If you’re preparing for IBM or other major tech company OAs like Amazon, Meta, or TikTok on platforms such as HackerRank or CodeSignal, getting familiar with real question patterns and pacing is critical.
If you want structured preparation support, real problem simulations, or interview assistance, you can check here: Interview Assistance
Top comments (0)