Walmart's DSA rounds draw from trees, graphs, and string/hash patterns — and interviewers care as much about being able to justify your traversal or algorithm choice out loud as about the final code. The three problems below are real, recently reported (2025–2026) Walmart questions with full solutions.
Given the root of a binary tree, return the values of its nodes grouped level by level (breadth-first), from left to right within each level. Be ready to discuss the time and space complexity trade-offs of your approach.
Input: root = [3,9,20,null,null,15,7]
Output: [[3],[9,20],[15,7]]
Level 0 has just the root; level 1 has its two children; level 2 has the grandchildren.
Given an undirected graph as an adjacency list and a starting node, determine whether every node in the graph is reachable from the start using depth-first search. Be ready to justify your traversal choice verbally for a follow-up variant (e.g., counting connected components) without necessarily writing new code.
Input: graph = {0:[1,2], 1:[0], 2:[0,3], 3:[2]}, start = 0
Output: true
Every node is reachable from node 0 via 0→1 and 0→2→3.
Given an array of strings, group the strings that are anagrams of one another into their own sublists. The order of the groups and the order within a group do not matter.
Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["eat","tea","ate"],["tan","nat"],["bat"]]

