Lowe's Coding Round Questions
Last updated 2026-11-19
Home improvement supplies unusual algorithm stories: cutting lumber to maximise revenue, choosing the largest square tile for a room, finding a route through store aisles, booking installation slots, counting filters in a catalogue. This page works through twelve such practice problems with solutions in Python, Java and SQL, together with complexity and the mistakes that lose marks.
They are practice problems in the style of coding assessments, not copies of any test. Use them with Lowe's interview questions and the DSA coding round guide.
| Languages here | Python, Java, SQL |
|---|---|
| Themes | Intervals, BFS, DP, two pointers, trees, SQL |
| Level | Easy to hard |
How to approach these problems
Translate the scenario into a known pattern in one sentence, say the brute force and its cost, then improve. State the edge cases you will cover (empty input, one element, ties) before coding, and finish by walking through a small example.
Hiring status
We hold no sourced facts about Lowe's tests, drives, openings or cutoffs, so none are stated. Use the company's own careers site for current information.
Lowe's Coding Round Questions: questions with worked answers
1 Can one installer attend every installation appointment, given start and end times?
easySort the appointments by start time and check that each begins at or after the previous one ends. O(n log n) time. Mistake: not sorting, or treating an appointment that starts exactly when the previous ends as a clash.
pythondef can_attend_all(appts): appts.sort() return all(appts[i][0] >= appts[i - 1][1] for i in range(1, len(appts))) print(can_attend_all([(9, 11), (11, 13), (14, 15)])) # True2 Minimum number of delivery bookings to cancel so the rest do not overlap.
mediumGreedy by earliest end time: keep a booking if it starts at or after the last kept end, otherwise count it as removed. The answer is the total minus the number kept. O(n log n). Mistake: sorting by start time, which can keep a long booking that blocks many short ones.
pythondef min_cancel(slots): slots.sort(key=lambda s: s[1]) kept, end = 0, float('-inf') for s, e in slots: if s >= end: kept += 1 end = e return len(slots) - kept print(min_cancel([(1, 2), (2, 3), (3, 4), (1, 3)])) # 13 Facet counts: for a list of products, count how many have each value of an attribute.
easyLoop through the products and use a Counter for the chosen attribute, skipping products that do not have it. O(n). Mistake: treating a missing attribute as a value; decide whether to bucket it as "unknown". For several attributes at once, keep one Counter per attribute in a single pass.
pythonfrom collections import Counter def facet(products, attr): return Counter(p[attr] for p in products if attr in p) items = [{"finish": "matte"}, {"finish": "gloss"}, {"finish": "matte"}, {"brand": "x"}] print(facet(items, "finish")) # Counter({'matte': 2, 'gloss': 1})4 Prefix search on a sorted catalogue of product names: return all names starting with a prefix.
mediumWith the list sorted, binary search finds the first name not less than the prefix, and the first name not less than the prefix plus a character higher than any letter; the slice between them is the answer. O(log n + m) for m matches. Mistake: scanning linearly through the whole catalogue, and forgetting to compare in a consistent case.
pythonfrom bisect import bisect_left def by_prefix(sorted_names, prefix): lo = bisect_left(sorted_names, prefix) hi = bisect_left(sorted_names, prefix + "") return sorted_names[lo:hi] names = sorted(["drill", "drill bit", "drywall", "hammer", "hose"]) print(by_prefix(names, "dri")) # ['drill', 'drill bit']5 Shortest walk through store aisles: given a grid where # is a shelf and . is open floor, find the fewest steps from the entrance to an item.
mediumBFS from the entrance over four-directional moves, marking cells visited when they are enqueued, returns the first time the target is reached. O(rows * cols). Mistake: DFS, which does not guarantee the shortest path, and marking visited on dequeue, which lets cells be queued many times.
pythonfrom collections import deque def steps(grid, start, goal): R, C = len(grid), len(grid[0]) q = deque([(start, 0)]) seen = {start} while q: (r, c), d = q.popleft() if (r, c) == goal: return d for nr, nc in ((r+1, c), (r-1, c), (r, c+1), (r, c-1)): if 0 <= nr < R and 0 <= nc < C and grid[nr][nc] != "#" and (nr, nc) not in seen: seen.add((nr, nc)) q.append(((nr, nc), d + 1)) return -1 g = ["..#.", ".##.", "...."] print(steps(g, (0, 0), (0, 3))) # 76 Rod cutting: a board of length n can be cut into whole-length pieces with given prices. Find the maximum revenue.
mediumDynamic programming: best[i] is the maximum revenue for length i, equal to the maximum over cut lengths j of price[j] + best[i - j]. O(n squared) time, O(n) space. Mistake: greedy by price per unit length, which fails on some price tables, and not allowing the uncut piece as an option.
pythondef rod_cut(price, n): best = [0] * (n + 1) for i in range(1, n + 1): best[i] = max(price[j - 1] + best[i - j] for j in range(1, i + 1)) return best[n] print(rod_cut([1, 5, 8, 9, 10, 17, 17, 20], 8)) # 227 Largest square tile that exactly covers a room of given length and width, and how many tiles are needed.
easyThe tile side must divide both dimensions, so the largest is their greatest common divisor. Tiles needed are (length / side) x (width / side). For 450 by 350, gcd is 50, so 9 x 7 = 63 tiles. gcd runs in O(log min(a, b)) with Euclid's algorithm. Mistake: using the smaller dimension or the lowest common multiple.
pythonfrom math import gcd def tiles(length, width): side = gcd(length, width) return side, (length // side) * (width // side) print(tiles(450, 350)) # (50, 63)8 Largest shelf area: given heights of vertical dividers, choose two to form the container holding the most (width times the shorter height).
mediumTwo pointers at the ends: compute the area, then move the pointer at the shorter side inward, because moving the taller side cannot increase the area. O(n) time, O(1) space. Mistake: brute force over all pairs (O(n squared)), and moving the taller pointer.
pythondef max_area(h): i, j, best = 0, len(h) - 1, 0 while i < j: best = max(best, (j - i) * min(h[i], h[j])) if h[i] < h[j]: i += 1 else: j -= 1 return best print(max_area([1, 8, 6, 2, 5, 4, 8, 3, 7])) # 499 Lowest common category: given a category tree as a binary tree and two categories, find their lowest common ancestor.
mediumRecurse: if the current node is null or one of the targets, return it; search left and right; if both sides return a node, the current node is the LCA, otherwise return the non-null side. O(n) time, O(height) space. Mistake: assuming a binary search tree and comparing values, which fails for a general tree.
javaclass Node { int val; Node left, right; Node(int v) { val = v; } } public class Lca { public static Node lca(Node root, Node p, Node q) { if (root == null || root == p || root == q) return root; Node l = lca(root.left, p, q); Node r = lca(root.right, p, q); if (l != null && r != null) return root; return l != null ? l : r; } }10 Reverse a linked list of order items iteratively.
mediumWalk the list keeping previous, current and next pointers, pointing each node at its predecessor. O(n) time, O(1) space. Mistake: losing the rest of the list by overwriting next before saving it.
javaclass ListNode { int val; ListNode next; ListNode(int v) { val = v; } } public class Reverse { public static ListNode reverse(ListNode head) { ListNode prev = null, cur = head; while (cur != null) { ListNode nxt = cur.next; cur.next = prev; prev = cur; cur = nxt; } return prev; } }11 SQL: stores whose total sales are above the average store total in their region.
mediumAggregate sales per store, then compare each store with the average of the store totals in its region using a window function over the aggregated rows. Mistake: averaging raw sales rows rather than store totals, which weights stores by transaction count.
sqlSELECT store_id, region, total FROM ( SELECT store_id, region, SUM(amount) AS total, AVG(SUM(amount)) OVER (PARTITION BY region) AS region_avg FROM sales GROUP BY store_id, region ) t WHERE total > region_avg;
Frequently asked questions
What kinds of problems suit a Lowe's-style assessment?
Intervals and greedy scheduling, hashing, binary search, BFS on grids, dynamic programming, two pointers, tree recursion and SQL aggregation.
Python or Java?
Either. Use the language you are fastest in; know the standard collections and heap or sort utilities.
Are these real Lowe's questions?
No. They are practice problems in the style of coding assessments, not copies of any test.
How do I handle a scenario I do not recognise?
Strip the story to inputs and outputs, then match it to a pattern: ranges mean sorting and sweeping, "shortest" on a grid means BFS, "maximum with choices" often means DP.
How should I practise?
Do two problems a day across different patterns, review each solution the next day and keep a one-line note per pattern.
Related guides
More in Company Interview Questions
- Lowe's Interview Questions with Answers
- LTIMindtree Coding Round Questions with Solutions
- LTIMindtree Interview Questions for Freshers
- LTTS coding round questions
- MakeMyTrip Coding Round Questions
- MakeMyTrip Interview Questions with Answers
- Mastercard coding round questions with solutions
- Mastercard interview questions with answers (software engineer)
- Media.net Coding Round Questions With Solutions
- Media.net Interview Questions and Answers
- Meesho Coding Round Questions with Solutions
- Meesho Interview Questions and Answers