Walmart interview questions & answers

20 real Walmart interview questions with full model answers — Behavioral, System design, Technical, Coding. Drawn from the same verified bank ChannelPulse drills from (375 Walmart questions in total).

BehavioralEasyWalmartSoftware EngineerRound 3 (Manager)

1. What was the last feedback you received from your manager?

Model answer

  1. Situation — In my last role, I was working on a service that supplied product availability to an online shopping experience. During a delivery, my manager told me that my technical work was strong, but I sometimes waited too long to share risks while trying to resolve them independently. That mattered because inventory behavior crossed service boundaries, and late surprises could affect both checkout and partner teams.
  2. Task — I wanted to keep ownership of difficult engineering problems while giving my manager and partner teams enough context to make timely decisions. The challenge was to communicate uncertainty without creating unnecessary escalation or noise.
  3. Action
  • I asked my manager for a recent example. They pointed to an integration issue where I had spent several days investigating a mismatch before telling the checkout team that our delivery estimate might slip.
  • I acknowledged the impact and asked what signal would have been useful earlier. We agreed that I should share a risk as soon as it could affect a dependency or committed date, along with what I knew, what I did not know, and when I would update people.
  • I started sending concise written updates twice a week during that project, and immediately when a risk changed. For example: “The inventory response is correct in our service, but the downstream cache may be stale; I’m testing invalidation now, and I’ll confirm the impact by 2 p.m.”
  • I also brought the checkout engineer into a short investigation session rather than continuing to debug the cross-service behavior alone. That helped us distinguish a cache issue from an inventory calculation issue sooner.
  • I asked my manager to tell me if the updates became too frequent, so I could balance early visibility with focused execution.
  1. Result — We identified the dependency issue earlier, agreed on a safe rollout, and avoided a last-minute change for the checkout team. My manager later said my updates made risks easier to act on without reducing my ownership. I learned that communicating early is part of solving the problem—not a handoff—and I now make the impact and next checkpoint explicit.
BehavioralMediumWalmartDirector of Machine Learning

2. How do you collaborate with stakeholders and other organizations?

Model answer

Situation — In a cross-functional ML program, product wanted to improve a customer outcome quickly, while engineering prioritized platform stability and legal and operations teams needed stronger controls before launch. Each group had a reasonable view of the risk, but there was no shared definition of success or clear path for resolving trade-offs. My role was to align the organizations and deliver a decision they could all support.

Task — I needed to turn the competing requests into a coherent plan, make ownership explicit, and keep the work moving without bypassing legitimate review or creating a model that operations could not support.

Action

  • I met stakeholders individually first, listening for their underlying goals and constraints rather than treating their first proposed solution as fixed. I summarized the common objective and the unresolved decisions in neutral language.
  • I brought the group together around a one-page brief: user problem, target outcome, launch constraints, assumptions, decision owners, and measures of success. I distinguished decisions the team could make from risks that required legal or executive approval.
  • I translated technical trade-offs into stakeholder consequences. For example, I explained the value of a more cautious threshold in terms of customer impact, review volume, and operational capacity—not just model precision and recall.
  • I proposed a staged release with a limited cohort, human review for uncertain cases, monitoring, and explicit pause criteria. This gave product a way to learn while giving operations and legal meaningful controls.
  • I maintained a decision log and a regular review cadence. When a new concern emerged, I assessed whether it changed a success metric, a guardrail, or the launch scope, then brought the right decision-makers together rather than letting the issue spread informally.

Result — The teams agreed on a staged plan, launched within the agreed risk boundaries, and used the resulting evidence to decide whether to expand. We measured [business outcome], [model-quality measure], and [operational guardrail], and avoided treating launch as the only definition of success. I learned that collaboration is strongest when stakeholders can see how their concerns shape the plan and who has authority to make each decision.

What interviewers listen for

  • Empathy for different incentives, paired with clear accountability.
  • The ability to translate ML trade-offs into product and operational consequences.
  • A specific mechanism for resolving disagreement and measuring the result.
BehavioralMediumWalmartProduct Manager

3. Can you describe a complex project you led?

Model answer

Situation

At a growing marketplace, sellers managed inventory in one system while buyers saw availability from a separate catalog service. Updates could take several minutes to appear, causing avoidable cancellations and support contacts. I led a cross-functional effort spanning product, two engineering teams, data, operations, and seller support; the project mattered both to customer trust and to peak-season readiness.

Task

I was accountable for defining the outcome and coordinating delivery of a more dependable inventory-update experience. We needed to reduce stale listings without attempting a risky, all-at-once replacement of the legacy systems.

Action

  • I translated the complaint into measurable requirements: reduce the 95th-percentile time from seller update to buyer-visible availability, lower cancellation rate attributable to stale stock, and preserve catalog uptime.
  • I mapped the current data flow with engineers and operations, identifying where updates were queued, retried, or manually corrected. This exposed different definitions of “available” across teams, so I facilitated agreement on a shared event contract before feature planning.
  • I broke the work into milestones: instrumentation and baseline, event-driven updates for a narrow seller cohort, reconciliation tooling, then staged expansion. This let us test the architecture and operational process before broad adoption.
  • I made trade-offs explicit. We prioritized idempotent event handling and reconciliation over a seller-facing dashboard redesign, because correctness was the primary risk. I also secured a limited operations rotation for launch rather than assuming the new flow would eliminate exceptions immediately.
  • I ran a weekly dependency review, kept a decision log, and escalated one schema change early when it threatened the rollout date. We agreed on a backward-compatible version instead of forcing both services to deploy together.
  • I set rollout gates with engineering and operations: latency, duplicate-event rate, cancellation trend, and support volume had to remain within agreed limits before increasing traffic.

Result

The staged launch brought inventory-update latency from minutes to under 30 seconds at the 95th percentile for the enabled cohort, and stale-stock cancellations fell 18% over the following eight weeks. The service remained within its availability target, and the shared event contract reduced ambiguity for later integrations. I learned that complex delivery depends as much on agreeing on semantics and operational ownership as on choosing the architecture.

BehavioralMediumWalmartEngineering Manager

4. Tell me about a time senior leadership strongly opposed one of your technical decisions.

The full question

Tell me about a time senior leadership strongly opposed one of your technical decisions. How did you handle it?

Model answer

Situation

At a previous company, I recommended replacing a synchronous dependency in a customer-facing workflow with an asynchronous design. The existing path was contributing to latency spikes and coupling our release schedule to another team. A senior executive strongly preferred a smaller synchronous change because it appeared lower-risk and fit an upcoming business date.

Task

I needed to make a sound technical recommendation while respecting the executive’s business constraints. My responsibility was not to win an architectural argument; it was to make the risk, cost, and options clear enough for us to choose deliberately.

Action

  • I started by asking what the executive was optimizing for: the date, customer experience, operational risk, or longer-term flexibility. That clarified that the date was tied to a customer commitment, while reliability remained a hard requirement.
  • I worked with the engineers to quantify the current failure mode using latency percentiles, timeout rates, and incidents. We documented the asynchronous option’s costs too: queue operations, eventual consistency, retries, and additional monitoring.
  • I presented three choices with explicit consequences: keep the existing design and accept the measured risk; make a narrow synchronous fix with a limited scope; or build the asynchronous path in stages. I recommended the staged option, but made clear what we could deliver safely by the date.
  • When the executive challenged the recommendation, I listened rather than escalating the disagreement. I proposed a short technical spike and a load test against agreed acceptance criteria, so the decision could be based on evidence rather than authority or preference.
  • We aligned on shipping the narrow mitigation first, with a feature flag and rollback plan, then completing the asynchronous work behind the same interface. I kept the executive and partner teams updated as the evidence and forecast changed.

Result

The mitigation met the customer date, and the staged redesign later reduced tail latency and removed the most frequent timeout failure. The approach also preserved a productive relationship with leadership because we made the trade-offs explicit and committed to measurable decision criteria. I learned to challenge strongly while staying curious about the business constraint behind the disagreement.

What interviewers listen for

  • Respectful disagreement grounded in customer and operational evidence.
  • Clear options, trade-offs, and decision ownership—not “I convinced them.”
  • A safe path to validate, deliver, and roll back.
CodingEasyWalmartSoftware Engineer

5. Roman to Integer (LeetCode)

Model answer

The task

Convert a string of Roman numeral symbols into its integer value. Roman numerals use a small set of symbols, with some smaller values placed before larger ones to indicate subtraction.

Key idea

Scan the string from left to right, comparing each symbol’s value with the next one. If the current value is smaller, subtract it; otherwise, add it. This handles subtractive pairs without needing to process them separately.

Approach

  1. Store the integer value for each Roman numeral symbol in a lookup table.
  2. Initialize a running total to zero.
  3. For each symbol, compare its value with the following symbol’s value, if one exists.
  4. Subtract the current value when it is smaller than the next value; otherwise, add it.
  5. Return the total. This assumes the input is a valid Roman numeral.
class Solution:
    def romanToInt(self, s: str) -> int:
        values = {
            "I": 1,
            "V": 5,
            "X": 10,
            "L": 50,
            "C": 100,
            "D": 500,
            "M": 1000,
        }

        total = 0

        for i, symbol in enumerate(s):
            current = values[symbol]

            # A smaller value before a larger value is subtracted.
            if i + 1 < len(s) and current < values[s[i + 1]]:
                total -= current
            else:
                total += current

        return total

Complexity: Time: O(n), where n is the string length, since each symbol is visited once.

Complexity: Space: O(1), because the lookup table has a fixed number of entries.

Common follow-ups

  • How would you handle invalid Roman numeral strings? Validate symbol order and repetition rules before or during conversion.
  • How would you convert an integer to a Roman numeral? Greedily subtract from a descending list of allowed values, including subtractive pairs.
  • Can the conversion be done scanning right to left? Yes; subtract a value if it is smaller than the largest value already seen to its right, otherwise add it.
CodingEasyWalmartSoftware Engineer

6. Minimum Absolute Difference (LeetCode)

Model answer

The task

Given an integer array, return every pair of values whose absolute difference is as small as possible. Each pair should list its smaller value first.

Key idea

Sort the values. The smallest difference must occur between two neighbors in sorted order: any non-neighboring pair has at least one intervening value and cannot have a smaller gap. A single scan can find the minimum gap and collect all pairs that achieve it.

Approach

  1. Sort the array in ascending order.
  2. Scan adjacent values to find the smallest difference.
  3. Scan adjacent values again, adding each pair whose difference equals that minimum.
  4. Return the collected pairs; the sorted scan produces them in ascending order.
from typing import List

class Solution:
    def minimumAbsDifference(self, arr: List[int]) -> List[List[int]]:
        values = sorted(arr)

        # Find the smallest gap between neighboring values.
        min_gap = min(
            values[i] - values[i - 1]
            for i in range(1, len(values))
        )

        # Collect every neighboring pair with that gap.
        pairs = []
        for i in range(1, len(values)):
            if values[i] - values[i - 1] == min_gap:
                pairs.append([values[i - 1], values[i]])

        return pairs

Complexity:

  • Time: O(n log n), dominated by sorting; the scans take O(n).
  • Space: O(n), for the sorted copy and the returned pairs.

Common follow-ups

  • Can this be done without sorting? Not generally in linear time for arbitrary integers; sorting gives the required order efficiently.
  • What if the input may be modified? Sort arr in place to avoid creating a separate sorted copy.
  • What if values can repeat? Adjacent equal values have gap zero; collect every adjacent pair attaining the minimum.
  • Why are non-neighboring pairs unnecessary? In sorted order, a value between two elements makes their difference at least as large as one of the neighboring gaps.
CodingEasyWalmartSoftware Engineer

7. Maximum Distance Between Unequal Words in Array I (LeetCode)

Model answer

The task

Given an array of words, find the largest index difference between two positions that contain different words. If no such pair exists, return 0.

Key idea

A maximum-distance pair must include either the first or the last array position. Check how far each endpoint can reach a word different from its own; the greater distance is the answer.

Approach

  1. Save the first and last words.
  2. If they differ, the maximum possible distance is the full array length minus one.
  3. Otherwise, scan from the left for the first word different from the first word.
  4. Scan from the right for the last word different from the last word.
  5. Return the larger distance found, or 0 if all words are equal.
from typing import List

class Solution:
    def maxDistance(self, words: List[str]) -> int:
        n = len(words)
        first_word = words[0]
        last_word = words[-1]

        # The endpoints already form a pair at the greatest possible distance.
        if first_word != last_word:
            return n - 1

        best = 0

        # Find the farthest valid pair anchored at the first position.
        for i in range(n - 1, -1, -1):
            if words[i] != first_word:
                best = max(best, i)
                break

        # Find the farthest valid pair anchored at the last position.
        for i in range(n):
            if words[i] != last_word:
                best = max(best, n - 1 - i)
                break

        return best

Complexity:

  • Time: O(n), from scanning the array at most twice.
  • Space: O(1), using only a few variables.

Common follow-ups

  • What if all words are equal? Return 0 because there is no valid pair.
  • Can the array be scanned only once? Yes; track the first and last positions whose words differ from the endpoint word.
  • What if the distance is weighted by position gaps? Use prefix sums or the appropriate cumulative position weights when evaluating endpoint-anchored pairs.
CodingEasyWalmartSoftware Engineer

8. Degree of an Array (LeetCode)

Model answer

The task

Given an integer array, find the length of its shortest contiguous subarray whose elements have the same degree as the full array. The degree is the highest frequency of any value in the array.

Key idea

For each value, record its frequency and the indices of its first and last occurrences. A value’s shortest covering subarray spans those two indices; among values with maximum frequency, return the smallest such span.

Approach

  1. Scan the array once, recording each value’s count, first index, and last index.
  2. Track the largest count seen, which is the array’s degree.
  3. For every value with that count, calculate last - first + 1.
  4. Return the minimum calculated length.
from typing import List

class Solution:
    def findShortestSubArray(self, nums: List[int]) -> int:
        counts = {}
        first = {}
        last = {}

        for i, value in enumerate(nums):
            if value not in counts:
                counts[value] = 0
                first[value] = i

            counts[value] += 1
            last[value] = i

        degree = max(counts.values())
        shortest = len(nums)

        for value, count in counts.items():
            if count == degree:
                span = last[value] - first[value] + 1
                shortest = min(shortest, span)

        return shortest

Complexity:

  • Time: O(n), for scanning the array and checking the distinct values.
  • Space: O(k), where k is the number of distinct values stored in the dictionaries.

Common follow-ups

  • How would you return the actual subarray as well as its length? Keep the start and end indices of the best span.
  • What if the array is empty? Define the expected behavior, such as returning 0, and handle it before calling max.
  • Can the result be found in one pass? Yes; update each value’s span and count while tracking the best span for the current degree.
Product & growthMediumWalmartSoftware EngineerManager round

9. How would you promote unsold products?

Model answer

Clarify & scope

I’d treat “unsold” as products with inventory that is at risk of remaining unsold before a relevant deadline, such as a seasonal transition, freshness window, or markdown date. The goal is to sell that inventory while protecting margin and keeping the shopping experience useful. I’d first confirm which categories and channels are in scope: Walmart stores, Walmart.com, or both.

User segments & pain points

I’d focus on value-conscious customers who are open to alternatives but may not know a product is discounted or available nearby. Their pain points are finding relevant deals, trusting the price, and knowing whether an item is actually in stock for pickup or delivery.

Goals & success metrics

My North Star would be incremental units of at-risk inventory sold before its deadline. I’d also track sell-through rate, gross margin after promotion, inventory age, and customer conversion. Guardrails would include returns, substitutions, out-of-stock cancellations, customer complaints, and whether the promotion merely shifts purchases from full-price products.

Solutions

  • Show relevant markdowns in search, category pages, and deal surfaces, using current inventory and local availability.
  • Offer targeted discounts or bundles where they are likely to change a purchase decision; avoid discounting products that are already selling well.
  • For perishable or time-sensitive goods, prioritize timely markdowns and clearly communicate pickup or delivery availability.

Recommendation: Start with a localized, inventory-aware promotion that ranks eligible products by urgency, expected demand, and margin impact. Make the discount and availability clear, and recommend reasonable substitutes when the promoted item is unavailable.

Prioritization & trade-offs

I’d prioritize categories with meaningful at-risk inventory and enough margin to test promotions. A simple impact-effort assessment favors targeted, rule-based offers as an MVP over a complex personalized pricing system. The trade-off is that broader discounts are easier to launch but can erode margin and train customers to wait for sales.

MVP, measurement & rollout

I’d pilot in a few categories and markets, with a randomized holdout to measure incremental sell-through rather than crediting sales that would have happened anyway. I’d monitor results by store, channel, category, and inventory age, then expand only if the pilot improves sell-through within margin and customer-experience guardrails. I’d also make offer eligibility and expiration auditable so pricing remains consistent and trustworthy.

Product & growthMediumWalmartGroup Product ManagerHiring manager

10. Merchants are unhappy with their current payout process.

The full question

Merchants are unhappy with their current payout process. What would you do?

Model answer

Clarify & scope

I’d first clarify what merchants mean by “unhappy”: late or unpredictable funds, confusing fees, failed payouts, limited payout controls, or poor support. I’d segment by business size, geography, payout method, and risk profile, then focus on the segment with the greatest pain and business exposure. I’d also map the full payout journey—from transaction capture through settlement, reconciliation, and funds arrival—because a complaint about “payouts” may originate upstream.

User segments & pain points

For example, a small merchant managing cash flow daily may value predictable arrival and clear status more than advanced scheduling. A large merchant may prioritize reconciliation, bulk controls, and API reliability. I’d validate these needs with support-ticket analysis, payout telemetry, and interviews, and distinguish product problems from bank or regulatory constraints.

Goals & success metrics

My North Star would be the share of eligible payouts received on time and without merchant intervention. Supporting metrics: median and p95 time to funds, payout failure and retry rates, reconciliation completion, support contacts per 1,000 payouts, and merchant satisfaction. Guardrails would include fraud and loss rates, compliance exceptions, and payout operating cost.

Solutions

I’d compare: (1) clearer status, arrival estimates, and proactive exception alerts; (2) more payout choices, such as schedule and destination, where legally and operationally feasible; and (3) better reconciliation tools and self-service recovery for failed payouts.

Recommendation: Start with reliable visibility and exception handling, alongside fixing the highest-volume root causes of delay or failure. This addresses trust without prematurely adding costly payout rails or complex controls. Then test scheduling and destination flexibility with segments that demonstrate demand.

Prioritization & trade-offs

I’d rank opportunities by merchant impact, frequency, confidence, implementation effort, and risk. A faster payout option may be valuable but adds liquidity, fraud, partner, and compliance costs; I’d model those explicitly rather than treating speed as universally better.

MVP, measurement & rollout

Instrument payout states and reasons first, then pilot status improvements and alerts with a representative merchant cohort. Compare against a holdout, monitor leading indicators daily and guardrails continuously, and expand only if on-time receipt and support burden improve without unacceptable risk. I’d also publish clear eligibility and timing expectations so the product makes promises operations can meet.

Product & growthMediumWalmartProduct Manager

11. How do you prioritize features on a product roadmap?

Model answer

Clarify & scope

I treat a roadmap as a set of choices about customer and business outcomes—not a list of requested features. First I clarify the company strategy, target customer, planning horizon, and constraints such as capacity, regulatory obligations, or critical reliability work. I also distinguish committed work from options we are still validating.

User segments & pain points

I identify the highest-priority customer segments and their most important unmet needs. I combine customer interviews, support themes, product analytics, sales feedback, and market research, while checking whether the loudest request represents a broad problem or a few influential accounts.

Goals & success metrics

I connect each candidate initiative to an outcome, such as activation, retention, revenue, or reduced operating cost. I define a North Star or outcome metric and guardrails—for example, activation lift while maintaining support-contact rate, reliability, and accessibility. I ask how we will know the problem is solved before debating a particular feature.

Solutions

I compare a few approaches, including a smaller experiment or a process change. For a checkout drop-off, options might be simplifying the form, adding a guest path, or improving payment-error recovery. I estimate impact, confidence, effort, dependencies, and reversibility; I also call out whether the work creates strategic leverage or removes a meaningful risk.

Recommendation: I use a lightweight score—such as impact × confidence divided by effort—to structure discussion, not to automate the decision. I then explain the rationale, assumptions, and what we are choosing not to do.

Prioritization & trade-offs

I prioritize across the portfolio, not just within a feature list. A balanced roadmap might reserve capacity for customer outcomes, platform health, and discovery, with the exact allocation based on the business stage and risks. I account for opportunity cost, sequencing, engineering capacity, and the cost of delay. Legal deadlines and severe reliability issues may outrank growth experiments; low-confidence, high-effort ideas usually need discovery first.

MVP, measurement & rollout

I define the smallest valuable release, milestones, owners, dependencies, and decision points. I validate risky assumptions with prototypes or experiments, then ship gradually with instrumentation and a rollback plan. After launch, I compare results with the baseline and guardrails, share what we learned, and revisit the roadmap if evidence changes. The leadership test is whether stakeholders understand both the decision and its trade-offs—not whether every request made the plan.

Product & growthMediumWalmartProduct Manager

12. How would you improve search?

Model answer

Clarify & scope

I’d first clarify what “improve search” means for this product: more relevant results, faster discovery, more purchases, or better support for a particular category. For an e-commerce search experience, I’d assume the goal is to help customers find an appropriate, available product quickly—not simply maximize clicks.

User segments & pain points

I’d segment by intent and search behavior. A shopper searching an exact brand and model needs precise matching; someone searching “easy weeknight dinner” needs discovery and useful filters. I’d initially focus on high-intent shoppers whose searches produce no results, irrelevant results, or repeated query reformulations. I’d also investigate accessibility and mobile users, where typing and scanning results can be harder.

Goals & success metrics

My North Star would be successful search sessions: sessions in which a shopper finds a suitable item and completes a meaningful downstream action, such as adding it to cart or purchasing. I’d pair that with:

  • Relevance: click-through and add-to-cart rate by query type; reformulation and zero-result rates.
  • Customer experience: time to first useful result, search abandonment, and customer feedback.
  • Business and guardrails: conversion and revenue per search, alongside cancellation/return rates, availability, latency, and exposure across brands or sellers.

I would not optimize click-through alone: a misleading result can earn a click but harm trust or increase returns.

Solutions

I’d compare three options: improve query understanding (synonyms, spelling, intent); improve ranking (relevance, availability, price, ratings, and delivery promise); and improve result exploration (filters, facets, and clearer product attributes). Recommendation: start with the largest evidenced failure mode. If zero-result and reformulation rates are high, address query understanding first; if customers see results but don’t engage, test ranking and result presentation.

flowchart LR
  A[Customer query] --> B[Understand intent]
  B --> C[Retrieve candidates]
  C --> D[Rank relevant available items]
  D --> E[Show results and filters]
  E --> F[Measure useful outcomes]
  F --> B
Diagram

Prioritization & trade-offs

I’d use impact, confidence, effort, and risk to sequence work, while separating quick fixes—such as common synonym coverage—from model or indexing changes. More personalization may improve relevance but can reduce transparency, introduce bias, or make results inconsistent; I’d test it against a strong non-personalized baseline.

MVP, measurement & rollout

I’d review query-level data and customer research, ship one targeted change behind an experiment, and compare results by category, device, and intent. Roll out gradually only if successful searches improve without worsening latency, availability visibility, returns, or customer trust. I’d partner with engineering, design, data science, merchandising, and operations because search quality depends on catalog data as well as ranking.

System designMediumWalmartStaff EngineerRound 2 - Technical

13. Design a rate limiter that limits HTTP connections from a domain to a specific threshold over the last five minutes.

Model answer

1. Requirements & scale

  • Limit connection attempts for each normalized domain to a configured threshold N in any rolling five-minute window. Clarify whether the limit counts attempts or only admitted connections; I will count admitted connection attempts.
  • Reject excess attempts quickly and consistently across all service instances. Support changing thresholds and provide a Retry-After hint.
  • Target p99 limiter latency below 5 ms at the edge and high availability. A rolling log provides exact window semantics; a sliding counter is a cheaper approximation if small boundary errors are acceptable.

Back-of-the-envelope: Assume 100,000 active domains, N = 300, and 30,000 checks/s peak. At most 30 million admitted events are retained. At roughly 50 bytes per event before index overhead, that is 1.5 GB raw; plan several times that for sorted-set overhead and replication. Actual sizing must use measured domain distribution and request volume.

2. High-level architecture

flowchart TD
  subgraph Client
    C[HTTP Client]
  end
  subgraph Edge CDN
    E[Domain Normalizer]
  end
  subgraph Load Balancer
    L[Ingress Balancer]
  end
  subgraph API Services
    A[Connection Gateway]
    R[Limiter Service]
  end
  subgraph Cache
    K[Threshold Cache]
  end
  subgraph Datastores
    D[Redis Cluster]
    S[Config Database]
  end
  subgraph Message Queue
    Q[Audit Queue]
  end
  subgraph Workers
    W[Metrics Worker]
  end
  C -->|connection attempt| E
  E -->|canonical domain| L
  L -->|route| A
  A -->|check domain limit| R
  R -->|threshold lookup| K
  K -->|miss| S
  R -->|atomic rolling window update| D
  R -->|allow or reject| A
  A -->|decision event| Q
  Q -->|asynchronous metrics| W
Diagram

3. API design

  • POST /v1/limits/check: internal gateway call with domain, request_id, and optional limit_key; returns allowed, remaining, and retry_after_ms.
  • PUT /v1/limits/{domain}: authorized configuration update for threshold and policy.
  • GET /v1/limits/{domain}: operational read of policy and current usage, preferably from a diagnostic path rather than the hot path.

4. Data model & storage

  • Redis sorted set per normalized domain: key rl:{domain}, score is event time in milliseconds, member is a unique request ID. Hash-tagging keeps one domain's key on one Redis shard.
  • SQL configuration table stores domain, threshold, window duration, policy version, and update time. Cache policy reads locally with a short TTL and push invalidations.
  • Do not persist every decision synchronously. Emit sampled or batched audit events to the queue.

5. Deep dive

For each request, run one atomic Redis Lua operation: remove events with timestamp at or before now - 300000; read the remaining cardinality; if it is below N, add this request with a unique member and allow it; otherwise reject without adding it. Return the oldest retained timestamp so the gateway can calculate a retry hint. Use Redis server time, or tightly synchronized clocks with a documented skew allowance, so different application hosts cannot disagree about the window.

The operation must be atomic: separate prune, count, and insert commands can race and admit more than the limit. Make retries idempotent by using a stable request ID and checking whether that member already exists. Set key expiry after the latest event plus the window to reclaim inactive domains. Protect Redis with connection pooling, bounded script execution, and per-domain limits on pathological key cardinality.

If Redis is unavailable, choose policy explicitly. For abuse-sensitive endpoints, fail closed; for availability-critical traffic, use a conservative local emergency limiter and mark decisions as degraded. Local fallback cannot preserve a globally exact limit, so alert on its use.

6. Scale, bottlenecks & trade-offs

  • Shard by domain; replicate Redis for availability. A single very hot domain remains a hot key, so isolate it, apply edge-level protection, or use a dedicated limiter partition.
  • Exact sliding logs have cost proportional to admitted events. A sliding-window counter uses two buckets and is much cheaper, but can exceed the true rolling limit near bucket boundaries.
  • The decision path is synchronous because admission depends on it; metrics and audit are asynchronous. Keep config reads off the hot path.
  • Monitor allow/reject rate, Redis p50/p99 latency, script errors, active key count, event cardinality, clock skew, and fallback rate. Alert on sudden domain concentration and policy-cache staleness.
  • Treat the domain identity as security-sensitive: derive it from trusted routing or validated host metadata, not an arbitrary client header. Document whether subdomains share a parent-domain quota.
System designMediumWalmartSenior Engineering Manager

14. How would you design a URL-shortening system like bit.ly, and what database and architecture would you use?

Model answer

1. Requirements & scale

Functional requirements

  • Create a short URL for a long URL, optionally with a custom alias or expiration.
  • Redirect a short URL quickly and reliably; support disable/delete and basic analytics.
  • Prevent abuse, validate destinations, and provide a way to report malicious links.

Non-functional requirements

  • Redirects are read-heavy, globally available, and low latency; target p99 under 100 ms at the edge.
  • Short codes must be unique. Creation should be durable, and redirect reads may be eventually consistent across regions.
  • Protect against enumeration, phishing, spam, and traffic spikes.

Back-of-the-envelope: Assume 100 million new links/month and a 100:1 read/write ratio. That is about 40 writes/s and 4,000 redirects/s on average; design for roughly 10× peak, or 400 writes/s and 40,000 reads/s. At five years of retention, 6 billion links × roughly 500 bytes per row is 3 TB raw. Indexes and replication could bring this to 6–10 TB. A 1 KB redirect response at peak is about 40 MB/s before caching.

2. High-level architecture

flowchart TD
  subgraph Client
    U[Browser or App]
  end
  subgraph EdgeCDN["Edge/CDN"]
    E["CDN and WAF"]
  end
  subgraph LoadBalancer["Load Balancer"]
    L["Global Load Balancer"]
  end
  subgraph APIServices["API / Services"]
    R["Redirect Service"]
    C["Create API"]
    A["Abuse Checks"]
  end
  subgraph Cache
    K["Redis Cache"]
  end
  subgraph Datastores["Datastores"]
    D["Distributed KV Store"]
    P["SQL Metadata DB"]
  end
  subgraph MessageQueue["Message Queue"]
    Q["Analytics Events"]
  end
  subgraph Workers
    W["Analytics and Safety Workers"]
  end
  U -->|"short URL"| E
  E -->|"cache miss"| L
  L -->|"GET code"| R
  R -->|"lookup"| K
  K -->|"miss"| D
  R -->|"redirect event"| Q
  U -->|"create request"| E
  E -->|"POST create"| L
  L --> C
  C --> A
  C -->|"write mapping"| D
  C -->|"owner and policy"| P
  Q --> W
Diagram

3. API design

  • POST /v1/links — create a link; accepts url, optional customAlias, expiresAt, and an idempotency key.
  • GET /{code} — resolve and issue a 301 or 302 redirect. Use 302 when destinations may change or click attribution matters.
  • GET /v1/links/{code}/analytics — return aggregated counts for an authorized owner.
  • DELETE /v1/links/{code} — disable a link, with ownership and audit checks.

4. Data model & storage

  • A distributed key-value store (for example, DynamoDB or Cassandra) is the redirect source of truth: code -> destination, status, createdAt, expiresAt, ownerId.
  • Partition by code; use a hash-based distribution to avoid hot partitions. Keep owner and policy metadata in SQL if relational queries and transactions are useful.
  • Redis caches popular mappings with a TTL bounded by link expiration. The cache is an optimization, not the authority.
  • Send click events to a queue and aggregate asynchronously into an analytics store. Do not synchronously write every click to the link database.

5. Deep dive

Generate codes using a centrally allocated, collision-free numeric ID encoded as Base62, or use a sufficiently large random code and retry on uniqueness conflicts. Base62 IDs are compact and straightforward, but sequential IDs are enumerable; random IDs reduce enumeration but require collision handling. A practical choice is a random 8–10-character code, a uniqueness constraint at creation, and rate limits. At 62⁸ possibilities, the space is about 2.18×10¹⁴; still, collision checks are mandatory.

For a create request, validate the URL scheme, normalize it, check policy and malware reputation, then write the mapping durably before returning the short URL. For a redirect, check the edge and Redis caches, then read the key-value store on a miss. Cache negative lookups briefly to reduce repeated probing. Publish analytics asynchronously; if the queue is unavailable, redirects should still succeed.

6. Scale, bottlenecks & trade-offs

Replicate read data across regions and route users to a nearby region. Use a globally unique code namespace so creation does not require a cross-region lock. Accept eventual propagation for new links, while ensuring a successful create is durable in its home region. Cache invalidation matters for deletion: use short TTLs, an invalidation event, and a safety check for disabled links where risk justifies the added read.

The primary trade-off is availability versus immediate global consistency. Redirects should generally remain available during a regional failure, while a brief delay in observing a new link is acceptable. Protect hot links with CDN caching, and protect the service with per-IP and per-account rate limits, bot detection, destination scanning, and abuse reporting. Measure redirect success, p50/p99 latency, cache hit rate, creation failures, abuse rates, and queue lag. Avoid storing personally identifiable click data longer than needed.

System designMediumWalmartEngineering ManagerTechnical round

15. How would you design the system for your existing application?

Model answer

1. Requirements & scale

I would first clarify what “our existing application” does, its users, current architecture, and the main pain point. Since those details are not specified, I’ll assume a multi-tenant web application where users manage business records, collaborate, and receive notifications. I would adapt the boundaries and storage choices once I understood the actual product.

  • Functional: authenticate users; enforce tenant and role permissions; create, read, update, and search records; maintain an audit trail; notify users of important changes.
  • Non-functional: 99.9% availability, p95 reads below 300 ms and writes below 500 ms, tenant isolation, encryption, recoverability, and safe deployments.
  • Assumed scale: 1 million monthly active users, 100,000 peak concurrent users, 10 million records, and 5,000 read requests/s with 500 write requests/s.
  • At 2 KB per record, primary record data is about 20 GB before indexes and replicas. At 10 events per write, the event stream peaks around 5,000 events/s. With an average 5 KB response, 5,000 reads/s is about 25 MB/s before compression and cache hits.

2. High-level architecture

flowchart TD
  subgraph Client
    A["Web and Mobile"]
  end
  subgraph Edge_CDN["Edge and CDN"]
    B["CDN and WAF"]
  end
  subgraph Load_Balancer["Load Balancer"]
    C["Regional Load Balancer"]
  end
  subgraph API_Services["API and Services"]
    D["API Gateway"]
    E["Identity and Tenant Service"]
    F["Record Service"]
    G["Notification Service"]
  end
  subgraph Cache["Cache"]
    H["Redis Cache"]
  end
  subgraph Datastores["Datastores"]
    I["SQL Primary and Replicas"]
    J["Search Index"]
    K["Object Storage"]
  end
  subgraph Message_Queue["Message Queue"]
    L["Durable Event Stream"]
  end
  subgraph Workers["Workers"]
    M["Index and Notification Workers"]
  end
  A -->|"HTTPS requests"| B
  B -->|"protected traffic"| C
  C -->|"API calls"| D
  D -->|"auth and tenant checks"| E
  D -->|"record operations"| F
  F -->|"cache lookup"| H
  F -->|"transactional reads and writes"| I
  F -->|"committed change events"| L
  F -->|"file metadata"| K
  D -->|"search query"| J
  L -->|"asynchronous events"| M
  M -->|"index updates"| J
  M -->|"notifications"| G
Diagram

3. API design

  • POST /v1/sessions — authenticate and issue tokens.
  • GET /v1/records/{id} — fetch a record, subject to tenant authorization.
  • POST /v1/records — create a record; accept an idempotency key.
  • PATCH /v1/records/{id} — update selected fields with version checking.
  • GET /v1/search?q=... — search within the caller’s authorized tenant scope.
  • POST /v1/files/presign — obtain a short-lived upload URL.

4. Data model & storage

  • Use a relational database for tenants, memberships, permissions, record metadata, and audit entries. It provides transactions and constraints for core business data.
  • Put tenant_id on every tenant-owned row and use it in indexes and authorization checks. Partition large tables by tenant or time only when measured access patterns justify it.
  • Store large files in object storage; keep file references and ownership metadata in SQL.
  • Use a search index for text queries and Redis for short-lived, invalidatable hot reads. Neither cache nor search index is the source of truth.

5. Deep dive

The key design choice is keeping durable writes correct while allowing search and notifications to be asynchronous. In a single SQL transaction, the Record Service writes the record and an outbox event. A publisher sends outbox rows to the durable stream; workers update the search index and send notifications. This avoids the dual-write failure where the database commits but event publication is lost. Consumers are idempotent because delivery may be repeated.

sequenceDiagram
  participant U as User
  participant A as API
  participant S as Record Service
  participant D as SQL Database
  participant Q as Event Stream
  participant W as Worker
  participant X as Search Index
  U->>A: Create record with idempotency key
  A->>S: Validate identity and tenant access
  S->>D: Commit record and outbox event
  D-->>S: Transaction committed
  S-->>A: Return record identifier
  A-->>U: Success response
  D->>Q: Publish outbox event
  Q->>W: Deliver event at least once
  W->>X: Upsert search document
Diagram

I would define explicit ownership boundaries, SLOs, and on-call responsibilities before launch. I’d migrate incrementally: instrument the current system, establish baselines, move one workload or tenant cohort at a time, and maintain a rollback path.

6. Scale, bottlenecks & trade-offs

  • Scale stateless API services horizontally; use connection pooling and rate limits to protect SQL from bursts.
  • Read replicas can serve eligible reads, but stale reads are a trade-off. Route read-after-write requests to the primary or use a version token.
  • Cache only data with a clear invalidation strategy; tenant-scoped cache keys prevent cross-tenant leaks.
  • Partition SQL only after identifying a real bottleneck. Premature sharding complicates transactions, migrations, and operations.
  • Replicate across availability zones and test backups with restore exercises. Multi-region writes add conflict and consistency complexity; start with a clear regional write owner unless product requirements demand otherwise.
  • Track availability, p95/p99 latency, error rate, database saturation, queue lag, search freshness, cache hit rate, and tenant-level fairness. Alert on user impact, not just infrastructure symptoms.
System designMediumWalmartSenior Engineering ManagerRound 1 - High level design

16. How would you design an Instagram-like application focused on uploading pictures and text?

Model answer

1. Requirements & scale

Functional requirements

  • Users can create accounts, upload a picture with a caption, view a chronological feed, and delete their own posts.
  • The system supports private accounts and follows; users only see content they are authorized to view.
  • Uploads may be large and should tolerate flaky mobile networks.

Non-functional requirements

  • Read availability and durability matter more than perfectly fresh feeds; target 99.95% availability.
  • Feed reads should have p95 latency below 300 ms, excluding image download time.
  • Keep original images durable, serve resized variants efficiently, and enforce privacy at every read path.

Back-of-the-envelope estimates

  • Assume 100M monthly active users, 20M daily active users, and one post per active user per day: 20M uploads/day, or about 230 uploads/second average. At a 10x peak, design for 2,300 uploads/second.
  • At 2 MB per original, that is about 40 TB/day before derivatives. With 3x image variants and metadata overhead, budget roughly 150 TB/day; lifecycle older media to lower-cost storage.
  • If each daily user views 20 feeds of 20 posts, that is 8B feed-item impressions/day, or about 93K items/second average. Caching and pagination are essential.

2. High-level architecture

Clients upload directly to object storage using short-lived signed URLs. Services validate metadata, create durable post records, and publish events for image processing and feed distribution. The feed service checks visibility and returns post metadata plus CDN URLs.

flowchart TD
  subgraph Client
    A[Mobile App]
  end
  subgraph Edge
    B[CDN]
  end
  subgraph Load Balancer
    C[API Gateway]
  end
  subgraph API Services
    D[Post Service]
    E[Feed Service]
    F[Identity Service]
  end
  subgraph Cache
    G[Redis]
  end
  subgraph Datastores
    H[Post SQL]
    I[Social Graph]
    J[Object Storage]
  end
  subgraph Message Queue
    K[Event Queue]
  end
  subgraph Workers
    L[Image Workers]
    M[Feed Workers]
  end
  A -->|API calls| C
  A -->|image upload and download| B
  B -->|media| J
  C -->|authenticated requests| D
  C -->|feed reads| E
  C -->|tokens| F
  D -->|post metadata| H
  D -->|follow checks| I
  D -->|upload event| K
  K -->|image jobs| L
  L -->|variants| J
  K -->|post events| M
  M -->|feed entries| G
  E -->|feed cache| G
  E -->|post lookup| H
  E -->|visibility| I
Diagram

3. API design

  • POST /v1/uploads — request a signed upload URL and upload ID.
  • POST /v1/posts — finalize an upload and create a post with caption and visibility.
  • GET /v1/feed?cursor=...&limit=20 — return an authorized, paginated feed.
  • DELETE /v1/posts/{postId} — delete a post and enqueue media cleanup.
  • POST /v1/follows — follow an account, subject to privacy rules.

4. Data model & storage

  • Post SQL: posts(post_id, author_id, caption, media_key, visibility, created_at, status). Partition by time or hash of post_id; index (author_id, created_at).
  • Social graph: directed follower/following edges partitioned by user_id, supporting fan-out and privacy checks.
  • Feed cache: per-user ordered post IDs with cursor and expiry. Treat it as rebuildable, not the source of truth.
  • Object storage: immutable original and derivative objects keyed by post ID and variant; CDN caches public or authorized media according to policy.

5. Deep dive

The upload is a two-phase workflow: reserve an upload, transfer bytes directly to storage, then finalize. This keeps large payloads off application servers. The finalize endpoint verifies ownership of the upload ID, object existence, size, type, and checksum before making a post visible. An idempotency key prevents retries from creating duplicate posts.

sequenceDiagram
  participant App
  participant API
  participant Store
  participant Queue
  participant Worker
  App->>API: Request signed upload
  API-->>App: Signed URL and upload ID
  App->>Store: Upload image directly
  App->>API: Finalize post with idempotency key
  API->>Store: Verify object and metadata
  API->>Queue: Publish post created event
  API-->>App: Post ID and processing status
  Queue->>Worker: Generate image variants
  Worker->>Store: Save variants
Diagram

For feeds, use a hybrid fan-out strategy. For ordinary accounts, post events append IDs to followers’ feeds asynchronously. For very high-follower accounts, avoid writing millions of feed rows per post; merge their recent posts at read time. Use cursors rather than offsets, and recheck visibility when serving cached IDs. Eventual consistency is acceptable for feed appearance, but authorization and deletion checks must be current.

6. Scale, bottlenecks & trade-offs

  • Partition post and graph data, replicate across availability zones, and serve image variants through a CDN. Monitor upload success, feed p95 latency, queue lag, image-processing time, storage cost per active user, and authorization failures.
  • Queue consumers must be idempotent; use retries with backoff and a dead-letter queue. If image processing is delayed, show a processing state rather than exposing an incomplete post.
  • SQL gives reliable post creation and ownership constraints; a graph or wide-column store may scale follower traversal better. Choose based on measured graph access patterns, not fashion.
  • Prefer asynchronous feed fan-out for latency, accepting temporary staleness. Keep the post record authoritative and rebuild derived feeds after failures.
  • Protect against hot celebrities, abusive uploads, and CDN cache leakage. Apply rate limits, content validation, signed private-media delivery, retention policies, and deletion propagation. Roll out fan-out and storage changes behind flags with shadow reads and gradual traffic shifts.
TechnicalEasyWalmartSoftware EngineerRound 1

17. What is the difference between wait() and sleep() in Java, including wait(seconds), and when are they used?

Model answer

  1. wait() is for coordination; sleep() is for delay. - Object.wait() is called on a monitor while the current thread owns that monitor, normally inside a synchronized block or method. - Thread.sleep() is a static method that pauses the current thread for a duration. It does not need a monitor.
  2. Lock behavior is the key difference. - wait() releases the monitor while the thread is waiting. Before it returns, the thread must reacquire that monitor. - sleep() retains any monitors the thread already owns. This can prevent another thread from entering synchronized code protected by those monitors.
  3. Timeout units and overloads. - Java has no wait(seconds) overload. wait(long timeout) takes milliseconds; wait(0) means wait indefinitely. wait(long millis, int nanos) adds a nanosecond adjustment. - Thread.sleep(long millis) also takes milliseconds; there is an overload with nanoseconds. Convert seconds explicitly, for example Thread.sleep(seconds * 1000L). - A timed wait may end because it was notified, interrupted, or timed out. A timeout does not guarantee the condition is true.
  4. Use wait() with a condition loop. A notification is a signal to re-check shared state, not proof that the condition is satisfied. Spurious wakeups are also possible.
synchronized (lock) {
    while (!conditionIsReady()) {
        lock.wait();
    }
    // Use the shared state while holding the lock.
}

Use notify() or notifyAll() after updating the condition while holding the same monitor. Prefer notifyAll() when multiple conditions or kinds of waiters share that monitor.

sequenceDiagram
    participant A as Waiting thread
    participant M as Monitor
    participant B as Signaling thread
    A->>M: Enter synchronized block
    A->>M: wait releases monitor
    B->>M: Acquire monitor and update condition
    B->>M: notifyAll
    B->>M: Exit synchronized block
    M-->>A: Reacquire monitor; wait returns
    A->>A: Check condition again
Diagram

Use sleep() for a deliberate delay, such as a simple retry backoff—not to coordinate access to shared state. Both methods can throw InterruptedException; handle it deliberately, commonly by restoring the interrupt status with Thread.currentThread().interrupt() if the method cannot propagate the exception.

TechnicalEasyWalmartProduct Manager

18. What programming experience do you have?

Model answer

  1. Be specific about your hands-on level - I’d name the languages and tools I have actually used, how recently I used them, and whether my experience is professional, academic, or personal. For example: “I’m strongest in [language], which I used recently for [project]; I also have working familiarity with [tool or language].”
  2. Give one concrete example - I’d describe a small project or analysis: the problem, what I personally implemented, and how I tested it. For instance, I might explain how I used scripts to clean event data, validate metrics, or prototype a workflow—only if that reflects my real experience. - I’d mention the technical concepts I can reason about, such as APIs, data structures, SQL, testing, or debugging, and distinguish those from areas where I rely on engineering partners.
  3. Connect it to product work - As a PM, I use technical fluency to ask better questions, spot integration and data risks, evaluate trade-offs, and communicate clearly with engineers. I don’t present myself as a substitute for a software engineer; I make sure I understand enough to frame problems and make informed product decisions.
  4. Be candid about limits and learning - I’d close with what I’m currently improving and how I learn—for example, building a small prototype or reviewing code with an engineer. A strong answer is accurate about depth, not a list of languages intended to impress.

What interviewers listen for: honest calibration, practical evidence, technical curiosity, and the ability to partner effectively with engineering.

TechnicalEasyWalmartSoftware EngineerRound 3 (Java)

19. What is the difference between an abstract class and an interface?

Model answer

Abstract class vs. interface

  1. Purpose - An abstract class provides a shared base for related classes: common state, constructors, and implementation, plus abstract methods subclasses must define. - An interface defines a capability or contract that classes can implement, including classes from otherwise unrelated hierarchies.
  2. State and construction - An abstract class can have instance fields, constructors, and methods with different access modifiers. - An interface has no instance constructors or per-object instance state. Its fields are implicitly public static final.
  3. Inheritance - A class can extend only one class, abstract or concrete. - A class can implement multiple interfaces. Interfaces can also extend multiple interfaces.
  4. Methods and compatibility - Abstract classes can declare abstract and concrete methods. - Interfaces can declare abstract methods and, in modern Java, default, static, and private helper methods. Default methods allow APIs to add behavior while maintaining compatibility with existing implementers.
  5. When I’d choose each - I’d use an abstract class when subclasses share meaningful state or implementation and belong to one common hierarchy. - I’d use an interface when I want a flexible contract, especially one that multiple unrelated types can implement. For example, Runnable describes work that can be executed without requiring a particular class hierarchy.
TechnicalEasyWalmartSoftware EngineerRound 3 (Java)

20. What is the Serializable interface?

Model answer

Serializable is a marker interface in Java: it declares no methods, but tells Java’s serialization mechanism that instances of the class may be converted to a byte stream and later reconstructed.

import java.io.Serializable;

public class ProductSnapshot implements Serializable {
    private static final long serialVersionUID = 1L;

    private final String productId;
    private transient String requestOnlyToken;

    public ProductSnapshot(String productId) {
        this.productId = productId;
    }
}
  • serialVersionUID identifies the class version for compatibility checks during deserialization. Defining it explicitly avoids relying on a generated value that can change after class modifications.
  • A transient field is excluded from default serialization. Static fields are not serialized as instance state.
  • By default, serializable object graphs include the reachable non-transient, non-static fields, so referenced objects must also be serializable or serialization can fail.
  • Deserializing untrusted data can be dangerous. For new persistence or service-to-service data exchange, I’d generally prefer an explicit, versioned format such as JSON or Protocol Buffers, with validation and clear compatibility rules.

I’d use Java serialization mainly when integrating with an existing system that requires it, rather than as a default data-storage or API format.

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions