← Walmart Interview Insights

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

JuniorPrefer not to say
Apr 2026Remote

Summary

Took an online assessment for a 2027 internship and got absolutely cooked by two algorithmic problems. Not super confident with DSA to begin with, so this was a rough one.

Questions Asked (2)

Q1

Solve a problem requiring partition dynamic programming.

Algorithms & Data Structures
Author's notes

This one broke me a little.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem and identifying the optimal substructure and overlapping subproblems that suggest a partition DP approach. Define the DP state clearly, derive the recurrence relation, and then discuss implementation details including time and space complexity. Walk through a small example to validate the recurrence before coding.

Pro tip: Explicitly discuss how you would optimize space complexity (e.g., using a 1D array instead of 2D) and mention common pitfalls like integer overflow or incorrect base cases. This shows depth beyond just getting a working solution.

1. Clarify the problem and constraints

Ask clarifying questions to understand the exact partitioning requirement, input size, and expected output. Confirm edge cases such as empty input or single element.

2. Identify optimal substructure and state

Determine how the problem can be broken into smaller subproblems and define the DP state (e.g., dp[i] = optimal value for first i elements). Explain why the state captures all necessary information.

3. Derive the recurrence relation

Formulate how the DP state transitions from smaller states, considering all possible partition points. Write the recurrence clearly and justify its correctness.

4. Implement and analyze complexity

Describe the bottom-up or top-down implementation, including initialization and iteration order. State the time and space complexity, and discuss potential optimizations.

5. Validate with examples and edge cases

Trace through a small example to verify the recurrence and base cases. Test edge cases like minimal input, large values, and negative numbers if applicable.

Key Points to Mention

  • Definition of the DP state and why it's sufficient
  • Recurrence relation with clear explanation of partition choices
  • Base cases and initialization (e.g., dp[0] = 0)
  • Time and space complexity analysis (e.g., O(n^2) time, O(n) space)
  • Space optimization techniques (e.g., rolling array)
  • Handling of edge cases and potential integer overflow

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

Q2

Solve a problem combining Dijkstra's algorithm, DFS, and backtracking.

Algorithms & Data Structures
Author's notes

Three concepts in one question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem statement and constraints to identify the exact role of each algorithm. Then, break down the solution into phases: use Dijkstra to compute shortest distances, DFS to explore paths or components, and backtracking to search for valid solutions under constraints. Finally, discuss time/space complexity and potential optimizations.

Pro tip: Demonstrate structured problem-solving by explicitly stating assumptions and walking through a small example before coding. Mention that you would test edge cases like disconnected graphs or negative weights (if applicable) to show thoroughness.

1. Clarify the Problem

Ask questions to understand the graph structure, constraints, and what the combined algorithms should achieve. Confirm input/output formats and edge cases.

2. Outline the Algorithmic Components

Explain how Dijkstra's algorithm will be used (e.g., to find shortest paths from a source), how DFS will traverse or explore (e.g., to find connected components or paths), and how backtracking will search for valid solutions (e.g., to enumerate paths under constraints).

3. Integrate the Components

Describe the order of operations: run Dijkstra first to get distances, then use DFS to explore possible paths, and apply backtracking to prune invalid paths or build solutions incrementally.

4. Analyze Complexity and Optimize

Discuss the time and space complexity of each part and the combined solution. Suggest optimizations like using a priority queue for Dijkstra, memoization for backtracking, or pruning strategies.

5. Test with Examples

Walk through a small example to validate the approach, and mention edge cases such as disconnected graphs, cycles, or large inputs.

Key Points to Mention

  • Dijkstra's algorithm for shortest path in weighted graphs with non-negative weights
  • DFS for graph traversal, cycle detection, or path exploration
  • Backtracking for combinatorial search and pruning invalid solutions
  • Time and space complexity analysis (e.g., O(E log V) for Dijkstra, O(V+E) for DFS, exponential for backtracking)
  • Handling edge cases: disconnected graphs, negative weights (if applicable), large graphs
  • Potential optimizations: priority queue, memoization, pruning, bidirectional search

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