← IBM Interview Insights

IBM·Software Engineer·Online Assessment (OA)·Junior

JuniorPending
Jul 2026Remote

Summary

Took the IBM entry level SWE online assessment on HackerRank. Two parts: debugging an API repo and a coding problem. The whole thing ended on a sour note because of a last-minute optimization attempt that I couldn't undo before time ran out.

Questions Asked (2)

Q1

Debug a provided repository to fix errors in an API.

API & IntegrationsRoot Cause Analysis
Author's notes

Passed most test cases on this one, which felt fine at the time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by reproducing the error and examining logs to understand the failure. Then systematically trace the request flow through the API layers, isolating the faulty component. Finally, implement a fix, verify it with tests, and consider edge cases to prevent regressions.

Pro tip: Demonstrate a methodical debugging process by verbalizing your hypotheses and how you test them. Also, mention writing a regression test for the bug to show you care about long-term code health.

1. Reproduce and Understand the Error

Run the API and trigger the error to see the exact symptoms. Check logs, error messages, and stack traces to gather clues about the failure point.

2. Isolate the Faulty Component

Trace the request through the API layers (routing, controllers, services, data access) to narrow down where the error occurs. Use debugging tools or add temporary logging if needed.

3. Identify Root Cause

Inspect the suspect code and related dependencies to determine why the error happens. Consider common issues like incorrect data handling, misconfigured endpoints, or dependency mismatches.

4. Implement and Verify the Fix

Make the necessary code changes to resolve the issue. Write or run tests to confirm the fix works and doesn't break other functionality.

5. Prevent Regression

Add a regression test that specifically covers the bug scenario. Review similar code paths for potential related issues and document the fix if needed.

Key Points to Mention

  • Reproducing the error consistently before attempting a fix
  • Using logs, stack traces, and debugging tools to trace the request flow
  • Understanding the API architecture and dependencies to isolate the issue
  • Checking for common API errors such as incorrect status codes, serialization issues, or authentication problems
  • Writing tests to verify the fix and prevent future regressions
  • Communicating the debugging process clearly and methodically

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Write a function that counts the number of unexpired tokens from a given list.

Algorithms & Data Structures
Author's notes

Standard enough once you see it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the data structure of a token (e.g., object with an expiration timestamp) and the definition of 'unexpired' (e.g., expiration time > current time). Then iterate through the list, comparing each token's expiration to the current time, and count those that are still valid. Discuss edge cases like empty list, null tokens, and time zone handling.

Pro tip: Mention that you would use a single pass with O(n) time and O(1) space, and that you'd consider using a functional approach like filter and length for readability, but be prepared to discuss performance trade-offs. Also, proactively ask about the time source (e.g., system clock vs. injected clock) to show awareness of testability.

1. Clarify requirements

Ask questions to understand the token structure, how expiration is represented, and what 'unexpired' means (e.g., expiration timestamp > now). Confirm input format and expected output.

2. Choose data structures and algorithm

Decide on a simple iteration approach. If tokens are objects, access the expiration field; if timestamps, compare directly. Consider using a counter variable.

3. Handle edge cases

Discuss handling empty list, null tokens, invalid timestamps, and time zone consistency. Mention whether to ignore or throw errors for malformed tokens.

4. Implement and test

Write clean code with meaningful variable names. Walk through a small example to verify logic, and mention unit tests for boundary conditions.

5. Analyze complexity and optimize

State time and space complexity (O(n) time, O(1) space). If needed, discuss potential optimizations like early termination if list is sorted by expiration.

Key Points to Mention

  • Definition of 'unexpired': typically expiration timestamp > current time
  • Time source: use a consistent clock, consider dependency injection for testability
  • Edge cases: empty list, null tokens, tokens with missing expiration, time zone handling
  • Complexity: O(n) time and O(1) space for single pass
  • Code readability: use descriptive names, consider functional style (filter) vs imperative loop
  • Testing: unit tests for boundary conditions (expired exactly now, future, past)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.