Autocoder

Target Interview Questions with Answers

Last updated 2026-11-19

Target is a large US retailer with a technology organisation in India, so engineering interviews are best prepared with retail systems in mind: product catalogues, inventory that must be accurate across stores and online, pricing and promotions, order management and supply chain. Questions typically cover data structures, object-oriented design, SQL and services, together with behavioural questions about collaboration.

The twelve practice questions below come with worked answers and are written in the style of those topics, not as a record of any interview. For algorithm practice see Target coding round questions, and for related enterprise retail preparation read Walmart interview questions.

Rounds (commonly reported)Online assessment, technical interviews, managerial and behavioural
TopicsDSA, OOP design, SQL, REST, messaging, concurrency
DomainRetail: catalogue, inventory, pricing, orders, supply chain

Rounds as commonly reported

We hold no sourced description of Target's selection process in India, so this is general guidance for retail-technology engineering roles. Candidates commonly describe an online assessment with coding problems and sometimes aptitude, then technical interviews on data structures, object-oriented design and SQL with a project discussion, and a managerial round on collaboration and ownership.

Retail makes consistency the theme

A shopper sees one price and one stock number, but the underlying data comes from many systems. Interviewers like answers that treat stock counts as a concurrency problem, prices as versioned data and orders as a state machine. Connect your design choices to those facts.

Hiring status

We hold no sourced hiring announcements, drive dates, openings or process description for Target, so none are stated here. Target has no page in our hiring section. Check the company's own careers site for current roles and eligibility.

Target Interview Questions with Answers: questions with worked answers

  1. 1

    Tell me about yourself and why retail technology.

    easy

    Give a brief background, one project with a concrete result, and a reason for the domain: retail systems are large, high-volume and visible to customers, with real engineering problems in inventory, pricing and fulfilment. Mention how you use online shopping and notice what works. Do not claim knowledge of the company's internal systems; speak to what you can verify and what you want to learn.

  2. 2

    Design the classes for a shopping cart with discounts.

    medium

    Entities: Product (id, price), CartItem (product, quantity), Cart (items, add, remove, total), and a Discount interface with implementations such as PercentOff, BuyXGetY and FlatOffOverAmount. Cart.total sums line totals and applies discounts through the interface, so adding a new promotion means adding a class (open/closed principle). Keep money as integers in the smallest unit or BigDecimal, never double. Decide the order of stacking discounts explicitly, since the result depends on it.

    java
    import java.util.*;
    
    interface Discount { long apply(long subtotal); }
    
    class PercentOff implements Discount {
        private final int pct;
        PercentOff(int pct) { this.pct = pct; }
        public long apply(long subtotal) { return subtotal - subtotal * pct / 100; }
    }
    
    class Cart {
        private final Map<String, long[]> items = new LinkedHashMap<>(); // id -> {price, qty}
        private final List<Discount> discounts = new ArrayList<>();
        void add(String id, long price, int qty) {
            items.merge(id, new long[]{price, qty}, (a, b) -> new long[]{a[0], a[1] + b[1]});
        }
        void addDiscount(Discount d) { discounts.add(d); }
        long total() {
            long t = 0;
            for (long[] i : items.values()) t += i[0] * i[1];
            for (Discount d : discounts) t = d.apply(t);
            return t;
        }
    }
  3. 3

    Two shoppers buy the last unit of an item at the same instant. How do you avoid overselling?

    medium

    Make the check and the decrement atomic. In a database, use a conditional update (decrement where stock is at least the requested quantity) and check the affected rows, or a row lock inside a transaction. In memory, use an AtomicInteger with a compare-and-set loop. For online and store systems sharing stock, reserve units with an expiry at checkout and confirm on payment; release on timeout. Accept that some systems deliberately allow small overselling with a later cancellation policy, and state the trade-off.

    java
    import java.util.concurrent.atomic.AtomicInteger;
    
    public class Stock {
        private final AtomicInteger units;
        Stock(int n) { units = new AtomicInteger(n); }
    
        boolean tryReserve(int qty) {
            while (true) {
                int cur = units.get();
                if (cur < qty) return false;
                if (units.compareAndSet(cur, cur - qty)) return true;
            }
        }
    }
  4. 4

    Write a query for the top three selling products in each department by units sold.

    medium

    Aggregate units per product and department, rank within the department and keep the top three. DENSE_RANK includes ties, ROW_NUMBER returns exactly three rows. Remember window results cannot be filtered in the same SELECT, so use a subquery. Mistake: LIMIT 3 gives three rows in total.

    sql
    SELECT department, product, units
    FROM (
      SELECT p.department, s.product_id AS product, SUM(s.qty) AS units,
             DENSE_RANK() OVER (PARTITION BY p.department ORDER BY SUM(s.qty) DESC) AS r
      FROM sales s
      JOIN products p ON p.id = s.product_id
      GROUP BY p.department, s.product_id
    ) t
    WHERE r <= 3;
  5. 5

    How would you design price updates so shoppers and stores never see inconsistent prices?

    medium

    Treat prices as versioned, effective-dated records: (item, location, price, valid_from, valid_to). A change is inserted, not edited in place, and takes effect at a defined time, so stores and online read the same effective value. Publish changes as events to a topic and have each channel update its cache; include the version in the cart so the price at checkout is validated and, if changed, the shopper is told. Audit every change. Handle time zones by storing UTC.

  6. 6

    Explain REST API design for an order service, including pagination and error handling.

    medium

    Resources: POST /orders to create (201 with Location), GET /orders/{id}, GET /orders?customerId=...&page=...&size=... for lists. Use cursor-based pagination for large changing lists, because offset pagination skips or repeats items when data changes. Return meaningful status codes (400 validation, 404 not found, 409 conflict, 429 rate limited) with a structured JSON error body, and support an idempotency key for creating orders so retries are safe. Version the API.

  7. 7

    When would you use a message queue in a retail system, and what are the pitfalls?

    medium

    Use it to decouple steps that need not finish in the same request: placing an order publishes an event, and inventory, payment confirmation, email and analytics consume it independently. Benefits: absorbing traffic spikes (a sale), retrying failed steps and adding consumers without changing the producer. Pitfalls: duplicates (at-least-once delivery), reordering, poison messages, and eventual consistency that customers can see. Make consumers idempotent, use a dead-letter queue and monitor lag.

  8. 8

    Explain the difference between optimistic and pessimistic locking.

    medium

    Pessimistic locking takes a lock when reading (SELECT ... FOR UPDATE) so others wait; it is safe under high contention but reduces concurrency and risks deadlock. Optimistic locking lets everyone read, then verifies at write time that nothing changed, using a version column or timestamp, and retries on conflict; it performs well when conflicts are rare. For hot items during a sale, contention is high, so conditional atomic updates or queues are better than long-held locks.

  9. 9

    How would you cache product details, and how do you keep them fresh?

    medium

    Cache by product id in a distributed cache with a TTL, using cache-aside: read the cache first and load from the database on a miss. Keep rarely changing fields (title, images) with long TTLs and fast-changing ones (price, stock) separate with short TTLs or event-driven invalidation. Prevent stampedes on popular items with request coalescing. Never serve a cached price at payment; revalidate at checkout.

  10. 10

    Estimate and design for a seasonal sale where traffic is ten times normal.

    hard

    Start with capacity planning: load test the critical path (browse, add to cart, checkout) to find the bottleneck before the event. Scale stateless services horizontally, pre-warm caches, put static content on a CDN and protect downstream systems with rate limits and queues. Degrade gracefully: turn off non-essential features such as recommendations before checkout fails. Use a virtual waiting room if needed, and rehearse rollback. Monitor error rate, latency percentiles and stock accuracy during the event.

  11. 11

    Tell me about a time you worked with a difficult teammate or stakeholder.

    medium

    Describe the situation without blame: what was the friction (changing requirements, unclear ownership). Show what you did: you listened for their underlying concern, agreed a shared goal, set a regular check-in and documented decisions. End with the outcome and what you learnt about communication. The interviewer wants evidence of empathy and a problem-solving mindset.

  12. 12

    Describe a time you made a mistake at work or in a project and how you handled it.

    medium

    Choose a real, moderate mistake, such as a deployment that broke a feature. Explain how you noticed, told the team quickly, fixed or rolled back and then prevented a repeat with a test or checklist. Own it without excuses, and keep the focus on what you changed. Honesty and learning are what is being assessed.

Frequently asked questions

What topics should I prepare for Target?

Data structures and algorithms, object-oriented design, SQL, REST and microservice basics, concurrency and caching, plus behavioural stories. Frame designs around inventory, pricing and orders.

Is there an online assessment?

Candidates commonly report coding assessments for such roles, but we hold no sourced description of Target's current process. Confirm with your recruiter.

Do they ask low-level design?

Object-oriented design questions, such as a cart or inventory service, are a sensible area to prepare. Practise writing small, clean classes.

Where do I find current openings?

On the company's own careers site. We hold no sourced hiring dates for Target.

Are these real Target questions?

No, they are practice questions in the style of retail-tech interviews, not a record of any interview.

Related guides

More in Company Interview Questions

See all in this section