Interview guides · Hastings Direct
Hastings Direct Software Engineer Interview Guide
Hastings Direct Software Engineer interview guide: reported rounds, questions and how candidates describe the process.
The 60-second brief
As a Software Engineer at Hastings Direct, you are at the heart of a digital transformation within the insurance industry. This role is critical to maintaining and innovating the complex technical ecosystems that support millions of customers. You will not just be writing code; you will be architecting solutions, building microservices, and implementing AI-driven features that directly influence how the company delivers insurance products and processes claims. The environment at Hastings Direct is fast-paced and technically diverse, ranging from core legacy systems to modern cloud-native architectures. You will collaborate across cross-functional teams, working closely with product managers, data scientists, and operations teams to solve real-world problems.
This guide is scoped to a Software Engineer candidate at Hastings Direct.
Focus areas
- Problem Solving / DSA
- React Props vs State
- REST APIs
The Hastings Direct interview process
Hastings Direct candidates report 6 rounds over 4-6 weeks. The stages below are what candidates describe, not a published process.
Application Review
Initial review of submitted applications to assess qualifications and fit.
What to demonstrate
- Initial review of submitted applications to assess qualifications and fit
- Depth in Problem Solving / DSA
How to prepare
- Be able to walk your CV end to end in two minutes, and say why this company specifically.
- Have your salary expectations, notice period and location constraints ready, and ask for the rest of the loop in writing.
HR Culture Check
A discussion led by HR to evaluate cultural fit within the company.
What to demonstrate
- A discussion led by HR to evaluate cultural fit within the company
- Depth in Problem Solving / DSA
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 hr culture check above and write down what you would ask to confirm before it.
Skill-based Coding Assessment
Candidates complete coding tasks to demonstrate technical skills.
What to demonstrate
- Candidates complete coding tasks to demonstrate technical skills
- Depth in Problem Solving / DSA
How to prepare
- Answer aloud and timed: What are your preferred design patterns, and why do you choose them for specific problems?
- Answer aloud and timed: How would you design a basic blogging platform or a similar data-intensive application from the ground up?
Technical Interviews
In-depth technical interviews with engineering leads to assess expertise.
What to demonstrate
- In-depth technical interviews with engineering leads to assess expertise
- Depth in Problem Solving / DSA
How to prepare
- Answer aloud and timed: Describe a challenging project you have worked on; what was your specific contribution, and what were the trade-offs you made?
- Answer aloud and timed: If you were working in a team of three and encountered a significant Git conflict, what is your step-by-step process for resolution?
Take-home Project
Some candidates may be required to complete a significant take-home project.
What to demonstrate
- Some candidates may be required to complete a significant take-home project
- Depth in Problem Solving / DSA
How to prepare
- Answer aloud and timed: How do you approach debugging a critical production issue under pressure?
- Answer aloud and timed: Tell me about yourself and your journey as a software engineer.
Final Selection Phase
Final discussions and evaluations before making a hiring decision.
What to demonstrate
- Final discussions and evaluations before making a hiring decision
- Depth in Problem Solving / DSA
How to prepare
- Answer aloud and timed: Why are you interested in joining Hastings Direct?
- Answer aloud and timed: Where do you see yourself in two years, and how does this role align with those goals?
Where candidates lose points
Structure your answers
Use the STAR method (Situation, Task, Action, Result) to keep your behavioral answers concise and impactful.
Practice active listening
If a question is unclear, ask for clarification. It shows you are thoughtful and want to provide the most relevant answer.
Prepare your portfolio
Have your GitHub or project documentation ready to explain. You will likely be asked to walk through your code.
Research the company's IT landscape
Understand the challenges of the insurance sector, such as the need for high data security and system reliability.
Questions & practice
Find overlapping job attempts and peak concurrency from lease records
Medium · sweep line · intervals · leases
A day of job_run history yields about 50,000,000 attempt records: (job_run_id, job_type, attempt, started_at, finished_at which is NULL when the worker died, lease_expires_at). Leases expire on a clock, so a job that outran its lease ran twice. Produce (a) every job_run_id whose attempts overlapped in wall-clock time and (b) the peak number of simultaneously running attempts per job_type with the minute it occurred. Target O(n log n). State how you treat a NULL finished_at and what clock skew does to your answer.
Approach
- Define the interval before sorting anything: an attempt occupies [started_at, COALESCE(finished_at, lease_expires_at)). finished_at is observed and lease_expires_at is only a promise, so every attempt without a finish contributes an estimate and the whole result is a lower bound on overlap rather than an exact count.
- For peak concurrency, sweep: emit 2n endpoints, sort by (timestamp, kind) with ends ordered before starts at equal timestamps, then walk the sequence maintaining a counter per job_type and record each type's maximum with its timestamp. O(n log n) dominated by the sort, O(n) space, or O(1) extra if the sort is external and the walk streams.
- For overlap detection, do not compare attempts pairwise. A single global sort by (job_run_id, started_at) gives both the grouping and the order; within a group, keep the maximum end seen so far and report an overlap exactly when the next start is less than that running maximum, which is one linear pass after the sort.
- Half-open intervals matter and are easy to get wrong: with closed intervals an attempt ending at the same millisecond another begins reads as concurrency two, and across 50,000,000 records that artefact swamps the real signal.
Follow-up
- A handler is not idempotent and you have found 400 overlapping jobs. Which of them actually caused damage, and what would you query to find out?
- Peak concurrency for one job_type is 4 against a configured cap of 4. Is the cap working, or is the data hiding attempts that never started?
Collapse a redelivered event batch into per-aggregate high-water marks
Easy · hashing · at-least-once · aggregation
You drain a batch of up to 5,000,000 events, each (aggregate_id BIGINT, aggregate_version INT, event_type, payload). The log guarantees order within one aggregate only; the batch merges 64 partitions, and a relay failover has redelivered a range, so an older version for an aggregate can appear after a newer one. Given a map of last_applied_version per aggregate, produce the events worth applying, at most one per (aggregate_id, version), plus the count discarded. Target O(n) time. State the memory for 2,000,000 distinct aggregates and what you do when it does not fit.
Approach
- One pass, one hash map from aggregate_id to the highest version kept, and a discard counter. An event whose version is at or below last_applied_version for its aggregate is dropped without further work, which is the whole reason the event carries its version rather than a delta. O(n) expected time, O(d) space in distinct aggregates.
- Keep the maximum, never the last occurrence. The redelivered range means the final appearance of an aggregate in the batch can be an older version than one seen earlier in the same batch, so last-wins applies stale state over newer state and the projection regresses with no error anywhere.
- Cost the memory instead of calling it large: an 8-byte key plus a 4-byte version is 12 bytes of payload, and an open-addressed table held at a 0.7 load factor costs roughly 17 bytes per entry before per-slot metadata, so 2,000,000 aggregates is tens of megabytes in a native layout and several times that in a runtime that boxes both key and value.
- If the distinct set exceeds memory, partition on hash(aggregate_id) mod P and reduce each partition independently. Every event for one aggregate hashes to the same partition, so the per-partition result is exact and the merge is concatenation rather than a second reduction.
Follow-up
- The payload is a patch rather than a snapshot, so applying only the highest version loses the intermediate changes. What changes in your reduction?
- How do you detect that version 7 arrived while version 6 was never delivered, and what should the consumer do about the gap?
Merge partitioned event streams into one ordered feed with bounded lateness
Hard · k-way merge · watermarks · out-of-order streams
The read-model service consumes 64 log partitions carrying about 4,000 events per second in total. Each partition is ordered within itself, but partitions drift by up to 30 seconds, and the activity feed must present a tenant's events in occurred_at order. Produce the merge. State its complexity, the buffer it requires in events and in bytes, what happens when one partition is idle, and what you do with an event that arrives after you have already emitted its position. Payloads average 1 KB.
Approach
- Merge with a min-heap over the 64 partition heads keyed on (occurred_at, event_id): O(log P) per event and O(n log P) overall. The tie-break on event_id is what makes the output deterministic when two partitions carry the same millisecond, which matters because the feed is paginated and a non-deterministic order reorders pages under the reader.
- Emitting the heap head is only correct once every partition has produced everything up to that timestamp, so the emit condition is a watermark: the minimum across partitions of the highest occurred_at seen, less the allowed lateness. Events are held until the watermark passes them, which is what turns individually ordered streams into a jointly ordered one.
- Size the buffer from the lateness rather than guessing: 4,000 events per second times 30 seconds is 120,000 buffered events, and at 1 KB each about 120 MB of heap. That number is the real price of the ordering guarantee and belongs in front of whoever asked for it.
- Handle the idle partition explicitly, because it fails the feed rather than corrupting it: a partition with no traffic never advances its own maximum, so the watermark freezes and output stops entirely. Either every partition emits a periodic idle marker carrying the broker's current time, or the watermark falls back to wall clock for a partition silent beyond a threshold.
Follow-up
- The lateness budget is raised to five minutes. What is the new buffer, and what besides memory changes?
- The consumer restarts. Where does it resume from, and what does the feed look like for the first 30 seconds?
Write the update path that detects a concurrent edit
Medium · optimistic concurrency · transactional outbox · audit history
resource carries version INT NOT NULL DEFAULT 1. resource_revision holds revision_id, resource_id, version, actor_user_id, change_kind, patch JSONB, request_id, created_at with UNIQUE (resource_id, version). outbox_event holds aggregate_type, aggregate_id, aggregate_version, event_type, payload, status. A PUT carries the version the client read. Write the exact statements for the single transaction that applies the edit, records the revision and enqueues 'resource.updated', and give the handler's branch on zero affected rows. Then say what PostgreSQL 16 does under READ COMMITTED when two of these updates hit one row at once.
Approach
- One transaction, three writes, no network call inside it: UPDATE resource SET title = $3, version = version + 1, updated_at = now() WHERE resource_id = $1 AND tenant_id = $4 AND version = $2; then INSERT the resource_revision row at version $2 + 1; then INSERT the outbox_event row at the same aggregate_version. The event goes to a table rather than a broker because no transaction spans both.
- Branch on the affected-row count before doing anything else. Zero has three causes — stale version, wrong tenant, row gone — so re-read once and map to 409 carrying the current version, or 404 for an id outside the caller's tenant, which also stops the endpoint confirming that another tenant's id exists.
- State the engine behaviour instead of assuming it. Under READ COMMITTED the second UPDATE blocks on the row lock, and when the first commits PostgreSQL re-evaluates the WHERE clause against the newly committed row, so the version predicate now fails and the statement reports zero rows. Under REPEATABLE READ the identical collision raises SQLSTATE 40001 instead, so the handler must fold both shapes into one conflict response.
- Keep UNIQUE (resource_id, version) even though the predicate already serialises writers. It is what makes a lost update unwritable if any other path ever reaches the revision table, and it converts a logic bug into 23505 rather than into a silently missing history row.
Follow-up
- A client sends the version it read ten minutes ago and the resource has moved three versions. What is in your 409 so it can resolve the conflict without a full re-fetch?
- Two editors, two disjoint fields, no overlap. Does your answer still refuse the second write, and should it?
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
- 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.
- 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.
- 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.
- 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?
Explain the difference between state and props in React.
Medium · Technical and Domain Knowledge
Approach
- Clarify what is being asked and what a complete answer contains.
- State your assumptions explicitly before working the problem.
- Say what you would check first and why it is the highest-information step.
- Work from the requirement backwards to the design.
Follow-up
- What assumption would you test first?
- How would you know your answer was wrong?
How do you approach building a REST API, and what are your considerations for CRUD operations?
Medium · Technical and Domain Knowledge
Approach
- Say who the caller is and what they do when the call fails halfway.
- Define the identity of a request so a retry cannot double-apply it.
- Separate accepted, pending, failed and confirmed; they are different facts.
- Design the error taxonomy before the success shape; callers branch on it.
Follow-up
- What happens if the caller retries after a timeout?
- How does a client discover it is on an old version of this contract?
Can you explain key Object-Oriented Programming (OOP) concepts and how you implement them in your daily work?
Medium · Technical and Domain Knowledge
Approach
- Clarify what is being asked and what a complete answer contains.
- State your assumptions explicitly before working the problem.
- Say what you would check first and why it is the highest-information step.
- Work from the requirement backwards to the design.
Follow-up
- What assumption would you test first?
- How would you know your answer was wrong?
What are your preferred design patterns, and why do you choose them for specific problems?
Medium · Technical and Domain Knowledge
Approach
- Clarify what is being asked and what a complete answer contains.
- State your assumptions explicitly before working the problem.
- Say what you would check first and why it is the highest-information step.
- Work from the requirement backwards to the design.
Follow-up
- What assumption would you test first?
- How would you know your answer was wrong?
How would you design a basic blogging platform or a similar data-intensive application from the ground up?
Medium · System Design and Problem Solving
Approach
- Fix the scope first: who calls this, how often, and what they do when it fails.
- Name the read and write paths separately; they rarely have the same bottleneck.
- Choose a partition key and say what query it makes expensive.
- 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 a challenging project you have worked on; what was your specific contribution, and what were the trad
Medium · System Design and Problem Solving
Describe a challenging project you have worked on; what was your specific contribution, and what were the trade-offs you made?
Approach
- Fix the scope first: who calls this, how often, and what they do when it fails.
- Name the read and write paths separately; they rarely have the same bottleneck.
- Choose a partition key and say what query it makes expensive.
- 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?
How do you approach debugging a critical production issue under pressure?
Medium · System Design and Problem Solving
Approach
- Establish what changed and when, before forming any theory.
- Pick a bisection that eliminates candidates whichever way it turns out.
- Check the instrumentation before believing the symptom.
- Separate the trigger from the cause; the deploy is rarely the bug.
Follow-up
- What would you look at first, and what would it rule out?
- How would you tell a cause from a coincidence here?
Suggested practice checklist
Built from the rounds and topics Hastings Direct candidates report.
Day 1 — Map the Hastings Direct loop
- Write out the reported sequence: Application Review, HR Culture Check, Skill-based Coding Assessment, Technical Interviews, Take-home Project, Final Selection Phase.
- 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 6 reported rounds, with the weakest marked.
Day 2 — Work Problem Solving / DSA
- Spend the session on Problem Solving / DSA, which Hastings Direct candidates report being tested on.
- Write one worked example in Problem Solving / DSA and time yourself on it.
Deliverable: One timed worked example in Problem Solving / DSA.
Day 3 — Work React Props vs State
- Spend the session on React Props vs State, which Hastings Direct candidates report being tested on.
- Write one worked example in React Props vs State and time yourself on it.
Deliverable: One timed worked example in React Props vs State.
Day 4 — Work REST APIs
- Spend the session on REST APIs, which Hastings Direct candidates report being tested on.
- Write one worked example in REST APIs and time yourself on it.
Deliverable: One timed worked example in REST APIs.
Day 5 — Answer out loud: Technical and Domain Knowledge
- Answer aloud, timed: Explain the difference between state and props in React.
- Answer aloud, timed: How do you approach building a REST API, and what are your considerations for CRUD operations?
Deliverable: Spoken answers to 2 reported Technical and Domain Knowledge question(s), under time.
Day 6 — Answer out loud: System Design and Problem Solving
- Answer aloud, timed: How would you design a basic blogging platform or a similar data-intensive application from the ground up?
- Answer aloud, timed: Describe a challenging project you have worked on; what was your specific contribution, and what were the trade-offs you made?
Deliverable: Spoken answers to 2 reported System Design and Problem Solving question(s), under time.
Day 7 — Answer out loud: Behavioral and Culture Fit
- Answer aloud, timed: Tell me about yourself and your journey as a software engineer.
- Answer aloud, timed: Why are you interested in joining Hastings Direct?
Deliverable: Spoken answers to 2 reported Behavioral and Culture Fit question(s), under time.
Behavioural preparation
Behavioural rounds judge the decision you made and what it cost.
How do you handle API errors or unexpected data responses in a frontend or backend environment?
Medium · Technical and Domain Knowledge
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?
If you were working in a team of three and encountered a significant Git conflict, what is your step-by-step p
Medium · System Design and Problem Solving
If you were working in a team of three and encountered a significant Git conflict, what is your step-by-step process for resolution?
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?
Tell me about yourself and your journey as a software engineer.
Medium · Behavioral and Culture Fit
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?
Why are you interested in joining Hastings Direct?
Medium · Behavioral and Culture Fit
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?
Where do you see yourself in two years, and how does this role align with those goals?
Medium · Behavioral and Culture Fit
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?
How do you handle collaborative environments, and are you comfortable working in a remote or hybrid setup?
Medium · Behavioral and Culture Fit
Approach
- Pick a story where you made the decision, not one where you watched it.
- State the situation in two sentences and spend the rest on the reasoning.
- Give the blast radius: what could have broken, and what you measured.
- 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?