Company Interview Questions · Product & Retail Tech
Walmart Global Tech: Data Scientist (2025)
Walmart Global Tech: Data Scientist Interview Experiences (2025). Rounds, real reported questions and model answers, compiled from public candidate reports (sources at the end). Practice mode hides every answer: say your answer first, press Show answer, then rate yourself. Use 🔁 Review again to build your revision list and 🎲 Random question for a quick drill.
About this interview
Compiled from public candidate reports for Walmart Global Tech Data Scientist roles: Data Scientist 3 in Bengaluru (February 2025), Bengaluru (August 2025, offer), Sunnyvale (April 2025, offer) and Bentonville (July 2025, offer). The questions are paraphrased, and the model answers are written by EasyLearnSpace.
| Roles | Data Scientist 2 / 3 |
| Rounds | Bengaluru DS3: technical/coding 60 min → technical/coding 90 min → hiring manager 30 min → HR. Others: online assessment (HackerRank), project deep dive, coding, ML breadth/depth, case study, HM |
| Timeline | 3 days (referral) to about 2 months |
| Reported outcomes | 3 offers; 1 not selected (DS3, rated "difficult") |
| Topics | GenAI + classical ML + DL; LeetCode easy–medium Python & SQL; KNN from scratch |
01Rounds at a glance
- Coding: easy array problems, medium SQL, KNN from scratch.
- ML theory: when a neural network behaves like a linear model, regularisation, PCA vs LDA, TF-IDF, overfitting.
- GenAI: BERT vs Transformer decoder vs GPT-3; evaluating LLMs without ground truth.
- Case study: an open-ended retail problem. Clarify the data, propose a baseline, then optimise.
02Questions and model answers
Q1
When does a complex neural network behave like a linear model?
- No non-linear activations (or identity or linear activations): stacking linear layers gives W₂(W₁x) = Wx, which is still linear.
- Activations operating in their linear region: small pre-activations with tanh or sigmoid near 0, or ReLU units that are all active (always positive), behave linearly.
- Very wide networks at initialisation (NTK regime): with a small learning rate, training behaves like a linear model in the parameters.
- Heavy regularisation pushes weights towards 0, which keeps activations near their linear zone.
- Takeaway: non-linearity comes from the activations; without it, depth adds nothing.
Q2
How does regularisation help linear regression? Compare L1 and L2.
- Purpose: it adds a penalty on the size of the weights to reduce variance and overfitting, especially when features are many or correlated.
- L2 (Ridge), λ‖w‖²: shrinks all weights smoothly, handles multicollinearity, and has a closed form (XᵀX + λI)⁻¹Xᵀy.
- L1 (Lasso), λ‖w‖₁: pushes some weights to exactly 0, which performs feature selection.
- Elastic Net: a mix of both, good when there are groups of correlated features.
- Tune λ with cross-validation and always standardise features first.
Q3
How do BERT (encoder), a Transformer decoder and GPT-3 work? What are their inputs and outputs?
- BERT (encoder-only, bidirectional):
- Input:
[CLS] tokens [SEP]with segment and position embeddings. - Trained by masked language modelling (plus NSP originally).
- Output: contextual embeddings for every token.
[CLS]is used for classification, and token vectors for NER or QA spans. - It does not generate free text.
- Original Transformer decoder (in encoder-decoder models such as T5 or translation): uses masked self-attention over the output so far plus cross-attention to the encoder output, and generates the target sequence token by token.
- GPT-3 (decoder-only, causal):
- Input: a prompt. A causal mask means each token sees only earlier tokens.
- Trained on next-token prediction.
- Output: a probability distribution over the next token, sampled repeatedly (autoregressively).
- Supports in-context learning (few-shot) and has 175B parameters.
Q4
How do you evaluate LLM outputs when there is no ground truth?
- LLM-as-judge with a clear rubric (relevance, correctness, completeness, tone, scored 1–5) or pairwise comparison between two systems. Calibrate the judge on 50 to 100 human-labelled items.
- Reference-free metrics:
- Faithfulness or groundedness to the provided context (RAGAS).
- Self-consistency across samples.
- Uncertainty via log-probs.
- Behavioural checks: format and JSON validity, policy and toxicity classifiers, length.
- Human and online signals:
- Expert review of a sample.
- Thumbs up/down.
- Edit distance (how much users change drafts).
- Task success and escalation rate.
- A/B tests.
Q5
Explain PCA and LDA. How do they differ?
- PCA (unsupervised):
- Finds orthogonal directions of maximum variance: eigenvectors of the covariance matrix, or the SVD of the centred X.
- Keep the top components that explain, say, 95% of the variance.
- Uses: compression, denoising, visualisation.
- LDA (supervised):
- Finds directions that maximise between-class separation relative to within-class scatter.
- At most (C − 1) components.
- Uses: dimensionality reduction before classification.
- Key difference: PCA ignores labels, so it may keep directions that are useless for classification; LDA uses labels but assumes Gaussian classes with shared covariance.
Q6
Explain TF-IDF, then use it to find the document most similar to a query.
- TF is how often a term appears in a document. IDF = log(N / (1 + df)) down-weights common words. TF × IDF highlights words that are distinctive for a document.
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
docs = ["refund for damaged item", "track my order", "return policy for shoes"]
vec = TfidfVectorizer(ngram_range=(1, 2), stop_words="english")
X = vec.fit_transform(docs)
q = vec.transform(["how to return shoes"])
best = cosine_similarity(q, X).argmax()
print(docs[best]) # return policy for shoes
- Limitations: no semantics (synonyms are missed) and sparse, high-dimensional vectors. Dense embeddings or hybrid search fix this.
Q7
Implement KNN classification from scratch.
import numpy as np
from collections import Counter
def knn_predict(X_train, y_train, X_test, k=5):
preds = []
for x in X_test:
d = np.sqrt(((X_train - x) ** 2).sum(axis=1))
idx = np.argpartition(d, k)[:k]
preds.append(Counter(y_train[idx]).most_common(1)[0][0])
return np.array(preds)
- Prediction is O(n·d) per query, so use KD-trees, ball trees or ANN at scale. Scale features first. Choose k by cross-validation (odd k for binary problems). Distance-weighted voting is a common follow-up.
Q8
SQL: find the top 3 products by revenue in each category for the last 30 days.
WITH rev AS (
SELECT p.category, p.product_id, SUM(o.qty * o.price) AS revenue
FROM orders o JOIN products p ON p.product_id = o.product_id
WHERE o.order_date >= CURRENT_DATE - INTERVAL '30' DAY
GROUP BY p.category, p.product_id
)
SELECT * FROM (
SELECT rev.*, ROW_NUMBER() OVER (PARTITION BY category ORDER BY revenue DESC) AS rn
FROM rev
) t WHERE rn <= 3;
- Mention
ROW_NUMBERvsRANKfor ties, and an index on (order_date, product_id).
Q9
Case study: store sales of a product dropped 15% last month. How would you investigate and model it?
- Clarify the data: which stores, whether the drop is real (data pipeline issues, a holiday calendar shift), and the comparison with last year.
- Decompose: traffic × conversion × basket size; by region, store and channel (online vs store).
- Hypotheses: stock-outs, price change or competitor promotion, a product-page or listing change, seasonality, weather.
- Quantify: a difference-in-differences against control stores, and an inventory join to detect lost sales.
- Model: a demand forecast (LightGBM with lag, price, promotion and holiday features) to estimate the expected baseline, then attribute the gap to drivers.
- Recommend actions with the expected impact, and monitor.
03How to prepare for Walmart Global Tech
- Expect a mix: classical ML maths, DL/GenAI concepts and coding. Don't skip PCA, LDA or regularisation.
- Practise implementing KNN, linear and logistic regression from scratch and medium SQL.
- Prepare a retail case-study framework (decompose → hypotheses → data → model → action).
Sources
- Glassdoor: Walmart Global Tech DS3, Bengaluru (Feb 2025)
- Glassdoor: Walmart Global Tech Data Scientist reviews (Sunnyvale, Bengaluru, Bentonville, 2025)
Created by Ajeetkumar