cswork / libraryOpen practice workspace

Interview guides · Marks & Spencer

Marks & Spencer Software Engineer Interview Guide

Marks & Spencer Software Engineer interview guide: reported rounds, questions and how candidates describe the process.

The 60-second brief

At Marks & Spencer, a Software Engineer is more than just a coder; you are a key driver of one of the most significant digital transformations in British retail. As we pivot toward a "digital-first" strategy, our engineering teams are responsible for building the high-scale systems that power everything from our global e-commerce platform and mobile applications to complex supply chain logistics and personalized customer experiences. The impact of your work is immediate and visible. Whether you are optimizing the checkout flow for millions of weekly users or architecting microservices that manage real-time inventory across hundreds of stores, your contributions directly affect the M&S brand's ability to compete in a modern market.

This guide is scoped to a Software Engineer candidate at Marks & Spencer.

Focus areas

  • Coding Interviews
  • Data Structures & Algorithms
  • Java

The Marks & Spencer interview process

Marks & Spencer candidates report 5 rounds over 4-6 weeks. The stages below are what candidates describe, not a published process.

Talent Acquisition Screening

Initial screening to assess candidate qualifications and fit for the role.

What to demonstrate

  • Initial screening to assess candidate qualifications and fit for the role
  • Depth in Coding Interviews

How to prepare

  • Answer aloud and timed: "Explain the difference between an interface and an abstract class, and when you would use each."
  • Answer aloud and timed: "How do you ensure your code follows SOLID principles during a rapid development cycle?"

Technical Evaluation

Coding challenge where candidates solve problems while being observed by an engineer.

What to demonstrate

  • Coding challenge where candidates solve problems while being observed by an engineer
  • Depth in Coding Interviews

How to prepare

  • Answer aloud and timed: "Walk me through how you would implement a thread-safe singleton in your language of choice."
  • Answer aloud and timed: "What are the trade-offs between using a recursive solution versus an iterative one for this specific algorithm?"

Pair Programming

Candidates demonstrate their coding skills and developer ergonomics in a collaborative setting.

What to demonstrate

  • Candidates demonstrate their coding skills and developer ergonomics in a collaborative setting
  • Depth in Coding Interviews

How to prepare

  • Answer aloud and timed: "How would you design a rate-limiting service for our public-facing APIs?"
  • Answer aloud and timed: "Describe how you would handle data synchronization between an on-premise store system and our cloud-based e-commerce platform."

System Design Interview

Candidates propose scalable solutions to high-level problems related to retail or e-commerce.

What to demonstrate

  • Candidates propose scalable solutions to high-level problems related to retail or e-commerce
  • Depth in Coding Interviews

How to prepare

  • Answer aloud and timed: "What database technology would you choose for a high-write, low-latency logging system, and why?"
  • Answer aloud and timed: "Tell me about a time you had to deliver a project under a very tight deadline. How did you manage your priorities?"

Behavioral Interview

Discussion focused on professional history and alignment with company values.

What to demonstrate

  • Discussion focused on professional history and alignment with company values
  • Depth in Coding Interviews

How to prepare

  • Prepare three examples from your own work, each with a decision you made and an outcome you can quantify.
  • Re-read the description of the behavioral interview above and write down what you would ask to confirm before it.

Where candidates lose points

Master Your Tools

During the pair programming session, avoid using the mouse for everything. Familiarity with keyboard shortcuts and IDE refactoring tools (like IntelliJ's "Extract Method") signals that you are a seasoned professional.

Think Out Loud

Your interviewer is more interested in your thought process than the final line of code. Explain why you are choosing a specific data structure or why you are refactoring a certain block.

Prepare for Java-centricity

Even if the job description is language-agnostic, be aware that many interviewers come from a Java/Spring background. Familiarizing yourself with how Spring handles dependency injection can give you a common language with your interviewers.

Avoid "over-engineering" your solutions

During coding tests, focus on the simplest, cleanest solution that meets the requirements before trying to implement complex patterns that may not be necessary.

Questions & practice

"Explain the difference between an interface and an abstract class, and when you would use each."

Medium · Technical & Coding Questions

Approach

  1. Restate the input: its shape, its size, and what is guaranteed about it.
  2. Name the brute-force solution and its complexity before improving on it.
  3. Choose the data structure from the access pattern, not from familiarity.
  4. State the target complexity and say which constraint rules the naive version out.

Follow-up

  • How does this change if the input no longer fits in memory?
  • What is the worst case, and how likely is it on real data?

"How do you ensure your code follows SOLID principles during a rapid development cycle?"

Medium · Technical & Coding Questions

Approach

  1. Restate the input: its shape, its size, and what is guaranteed about it.
  2. Name the brute-force solution and its complexity before improving on it.
  3. Choose the data structure from the access pattern, not from familiarity.
  4. State the target complexity and say which constraint rules the naive version out.

Follow-up

  • How does this change if the input no longer fits in memory?
  • What is the worst case, and how likely is it on real data?

"Walk me through how you would implement a thread-safe singleton in your language of choice."

Medium · Technical & Coding Questions

Approach

  1. Say what the runtime actually does before reasoning about the code.
  2. Name what is shared across threads and what owns each piece of state.
  3. Identify the window where an invariant is briefly untrue.
  4. Distinguish a value from a reference to it, and say which one you handed out.

Follow-up

  • What happens if two callers reach this at the same time?
  • Where could this allocate more than you expect?

"What are the trade-offs between using a recursive solution versus an iterative one for this specific algorith

Medium · Technical & Coding Questions

"What are the trade-offs between using a recursive solution versus an iterative one for this specific algorithm?"

Approach

  1. Restate the input: its shape, its size, and what is guaranteed about it.
  2. Name the brute-force solution and its complexity before improving on it.
  3. Choose the data structure from the access pattern, not from familiarity.
  4. State the target complexity and say which constraint rules the naive version out.

Follow-up

  • How does this change if the input no longer fits in memory?
  • What is the worst case, and how likely is it on real data?

Replace offset paging on the resource feed with keyset

Easy · keyset pagination · composite index · sort order

resource holds resource_id, tenant_id, owner_user_id, title, body_ref, version, status ('draft','active','archived','deleted'), created_at, updated_at, deleted_at, with an index on (tenant_id, status, updated_at DESC, resource_id DESC). The listing endpoint returns active resources for one tenant, newest update first, 50 per page, today with LIMIT 50 OFFSET n. Tenants reach page 400 and rows are created while they read. Write the keyset query, define what the cursor carries and how it is encoded, and say which part of the index each predicate uses. Assume PostgreSQL 16.

Approach

  1. Name the two failures separately. OFFSET 20000 makes the server produce and discard 20,000 rows, so page cost grows with depth rather than with page size. Independently, any write that changes how many rows sort above the offset moves the window between two fetches, and the direction decides which anomaly you get: an insert lands at the head of updated_at DESC and pushes already-returned rows down past the boundary, so they are returned a second time; a delete above the offset, or a row whose updated_at is bumped above the cursor, pulls rows up and one is never returned at all. Nothing in the response reveals either.
  2. Write the seek: WHERE tenant_id = $1 AND status = 'active' AND (updated_at, resource_id) < ($2, $3) ORDER BY updated_at DESC, resource_id DESC LIMIT 50. The row-value comparison is one index range rather than a disjunction, and both columns are NOT NULL, which is what makes that comparison well defined.
  3. Map each predicate onto the index: tenant_id and status are equality on the leading columns, (updated_at, resource_id) is the range, and the ORDER BY matches the index order so no Sort node appears and the scan stops after 50 rows. The DESC in the definition only matters for mixed directions — a plain ascending btree on the same columns is read backwards for this query.
  4. Put both sort columns in the cursor and nothing the client can tamper with into another tenant: base64 of (updated_at, resource_id), validated server-side, with tenant_id taken from the principal.

Follow-up

  • The client asks for 'jump to page 400'. What do you offer instead, and what does the honest version cost?
  • Sort order becomes user-selectable across four columns. How many indexes is that, and which would you refuse to add?

Hold a per-tenant active cap against concurrent creates

Hard · write skew · isolation levels · constraints

A tenant on the standard plan may hold at most 50 resources with status='active'. The create handler runs SELECT count(*) FROM resource WHERE tenant_id = $1 AND status = 'active', compares to 50, then inserts. Two creates arrive 3 ms apart on different instances and the tenant lands at 51. Name the anomaly, say whether PostgreSQL 16 READ COMMITTED or REPEATABLE READ prevents it and why, then give an implementation that holds the cap at READ COMMITTED with the exact statements. Finally, say what changes when the cap is 'at most one running export per tenant' on job_run.

Approach

  1. Name it: write skew. The two transactions read an overlapping set and write disjoint rows, so there is no row-level conflict for the engine to detect and each commit is individually legal.
  2. Rule out the levels precisely. READ COMMITTED takes a fresh snapshot per statement and takes no lock on the counted rows, so both see 49. PostgreSQL's REPEATABLE READ is snapshot isolation: it removes non-repeatable reads and phantoms within the snapshot but still admits write skew, because the anomaly is not a re-read of a changed row, it is a read of a set that a concurrent transaction invalidates. Only SERIALIZABLE closes it, by tracking the read dependency and aborting one transaction with SQLSTATE 40001 — a guarantee that exists only if the application re-runs the whole transaction from the read.
  3. Convert the set predicate into a single-row conflict: keep tenant.active_resource_count and run UPDATE tenant SET active_resource_count = active_resource_count + 1 WHERE tenant_id = $1 AND active_resource_count < 50 in the same transaction as the INSERT. Zero affected rows is the cap, returned as 409. The row lock serialises the decision at any isolation level, and contention is bounded to one tenant's row — which is also the fair-scheduling unit, unlike a global counter that would convoy every tenant behind one row.
  4. State the cost you just took on: a counter is a second source of truth that can drift, so every path that changes status must adjust it inside the same transaction, and a periodic reconciliation has to exist, with resource_revision as the authority for what the count should have been.

Follow-up

  • A resource moves from archived back to active. Which statements change, and what breaks if the counter update and the status change land in different transactions?
  • The cap becomes plan-dependent and a plan can change mid-month. Where does the number 50 live, and who reads it?

"How would you design a rate-limiting service for our public-facing APIs?"

Medium · System Design Questions

Approach

  1. Fix the scope first: who calls this, how often, and what they do when it fails.
  2. Name the read and write paths separately; they rarely have the same bottleneck.
  3. Choose a partition key and say what query it makes expensive.
  4. State the consistency you need, and where you are willing to be stale.

Follow-up

  • What breaks first when traffic grows ten times?
  • How does this behave when that dependency is down for an hour?

"Describe how you would handle data synchronization between an on-premise store system and our cloud-based e-c

Medium · System Design Questions

"Describe how you would handle data synchronization between an on-premise store system and our cloud-based e-commerce platform."

Approach

  1. Fix the scope first: who calls this, how often, and what they do when it fails.
  2. Name the read and write paths separately; they rarely have the same bottleneck.
  3. Choose a partition key and say what query it makes expensive.
  4. State the consistency you need, and where you are willing to be stale.

Follow-up

  • What breaks first when traffic grows ten times?
  • How does this behave when that dependency is down for an hour?

"What database technology would you choose for a high-write, low-latency logging system, and why?"

Medium · System Design Questions

Approach

  1. Fix the scope first: who calls this, how often, and what they do when it fails.
  2. Name the read and write paths separately; they rarely have the same bottleneck.
  3. Choose a partition key and say what query it makes expensive.
  4. State the consistency you need, and where you are willing to be stale.

Follow-up

  • What breaks first when traffic grows ten times?
  • How does this behave when that dependency is down for an hour?

One log partition stops advancing while the others drain

Easy · poison message · head-of-line blocking · consumer lag

Search results for a subset of tenants are hours stale; the rest are current. The projection consumer reports lag of zero on 15 of 16 partitions and 400,000 on one. Its error rate is flat and its CPU is idle. outbox_event has no pending rows older than a second, so the relay has published everything it holds. Identify the mechanism, give the ordered checks, and state what you do in the first ten minutes versus what you change permanently.

Approach

  1. Read the lag distribution first. A slow consumer lags everywhere; zero on fifteen partitions and 400,000 on one is not throughput. Idle CPU on the stuck partition means the consumer is not advancing its offset at all, which points at one message it cannot get past rather than at a rate problem.
  2. Exonerate the producer before touching the consumer. No pending outbox rows older than a second means the relay published, so the event exists in the log. This separates never sent from sent and never applied, which are different code paths and usually different owners.
  3. Read the message at the stuck offset and the handler's log lines for its event_id. A flat error rate with no progress has two explanations and you must distinguish them: the handler is throwing and the retry loop is swallowing it, or the handler is blocking on something and never returning. Idle CPU with no error lines favours the second.
  4. Mitigate before diagnosing further. Move the offending event to a dead-letter store and commit the offset past it. Adding consumers does nothing here, because a partition is consumed by exactly one member of the group, and the blast radius is every aggregate hashed to that partition, not only the aggregate that produced the bad event.

Follow-up

  • The dead-lettered event carried aggregate_version 7 and the projection had applied 6. What must the replay do differently if 8 and 9 landed in the meantime?
  • How do you show staleness to the user while the partition is behind, given the API already returns the projection's watermark?

Suggested practice checklist

Built from the rounds and topics Marks & Spencer candidates report.

Day 1 — Map the Marks & Spencer loop

  • Write out the reported sequence: Talent Acquisition Screening, Technical Evaluation, Pair Programming, System Design Interview, Behavioral Interview.
  • For each round, write one sentence on what it is judging, from the description above, and mark the one you are least ready for.

Deliverable: A one-page map of the 5 reported rounds, with the weakest marked.

Day 2 — Work Coding Interviews

  • Spend the session on Coding Interviews, which Marks & Spencer candidates report being tested on.
  • Write one worked example in Coding Interviews and time yourself on it.

Deliverable: One timed worked example in Coding Interviews.

Day 3 — Work Data Structures & Algorithms

  • Spend the session on Data Structures & Algorithms, which Marks & Spencer candidates report being tested on.
  • Write one worked example in Data Structures & Algorithms and time yourself on it.

Deliverable: One timed worked example in Data Structures & Algorithms.

Day 4 — Work Java

  • Spend the session on Java, which Marks & Spencer candidates report being tested on.
  • Write one worked example in Java and time yourself on it.

Deliverable: One timed worked example in Java.

Day 5 — Answer out loud: Technical & Coding Questions

  • Answer aloud, timed: "Explain the difference between an interface and an abstract class, and when you would use each."
  • Answer aloud, timed: "How do you ensure your code follows SOLID principles during a rapid development cycle?"

Deliverable: Spoken answers to 2 reported Technical & Coding Questions question(s), under time.

Day 6 — Answer out loud: System Design Questions

  • Answer aloud, timed: "How would you design a rate-limiting service for our public-facing APIs?"
  • Answer aloud, timed: "Describe how you would handle data synchronization between an on-premise store system and our cloud-based e-commerce platform."

Deliverable: Spoken answers to 2 reported System Design Questions question(s), under time.

Day 7 — Answer out loud: Behavioral & Leadership Questions

  • Answer aloud, timed: "Tell me about a time you had to deliver a project under a very tight deadline. How did you manage your priorities?"
  • Answer aloud, timed: "Describe a situation where you had a technical disagreement with a senior engineer. How was it resolved?"

Deliverable: Spoken answers to 2 reported Behavioral & Leadership Questions question(s), under time.

Behavioural preparation

Behavioural rounds judge the decision you made and what it cost.

"Tell me about a time you had to deliver a project under a very tight deadline. How did you manage your priori

Medium · Behavioral & Leadership Questions

"Tell me about a time you had to deliver a project under a very tight deadline. How did you manage your priorities?"

Approach

  1. Pick a story where you made the decision, not one where you watched it.
  2. State the situation in two sentences and spend the rest on the reasoning.
  3. Give the blast radius: what could have broken, and what you measured.
  4. Name the disagreement and how you resolved it with evidence.

Follow-up

  • What would you do differently if you ran that again?
  • How did you know your change caused the improvement?

"Describe a situation where you had a technical disagreement with a senior engineer. How was it resolved?"

Medium · Behavioral & Leadership Questions

Approach

  1. Pick a story where you made the decision, not one where you watched it.
  2. State the situation in two sentences and spend the rest on the reasoning.
  3. Give the blast radius: what could have broken, and what you measured.
  4. Name the disagreement and how you resolved it with evidence.

Follow-up

  • What would you do differently if you ran that again?
  • How did you know your change caused the improvement?

"Give an example of a time you took the initiative to improve a process or codebase without being asked."

Medium · Behavioral & Leadership Questions

Approach

  1. Pick a story where you made the decision, not one where you watched it.
  2. State the situation in two sentences and spend the rest on the reasoning.
  3. Give the blast radius: what could have broken, and what you measured.
  4. Name the disagreement and how you resolved it with evidence.

Follow-up

  • What would you do differently if you ran that again?
  • How did you know your change caused the improvement?