How to Prepare for a Software Engineer Interview in 2 Weeks
How to prepare for a software engineer interview in 14 days, with daily coding and design drills, a story-bank template, timed mocks and a 3-day crash plan.
Updated
To prepare for a software engineer interview, spend two weeks rotating four things: timed coding drills built on eight core patterns while talking out loud, system design drills with a back-of-envelope estimate, six true stories rehearsed to two minutes, and three timed mock interviews at fixed points. Start on a Monday. Weekdays take about 75 minutes; the weekend days (6, 7, 13 and 14) take up to two hours. Interview in three days? Skip to the 3-day plan. For how the rounds are scored, read the software engineer interview guide; before applying, see the things to know before applying for a software engineer job.
How long does it take to prepare for a software engineer interview?#
For a working engineer who codes every day, two focused weeks is usually enough. The skill you are rebuilding is programming in 20 minutes, in front of a stranger, while narrating, and it improves fastest with short daily repetitions.
Allow three to four weeks if you have not coded under a timer for over a year, are moving from mid to senior (where system design starts deciding the outcome), are switching stacks, or have never been on call.
What to set up before day 1#
- One prep document with four headings: stories, design prompts, mistakes I keep making, questions for them. Every drill ends by adding a line to one.
- One interview language, the one you write fastest, kept for the fortnight. Python is common because counting, heaps and binary search are one import each; if you write Go daily, use Go.
- A plain editor with no autocomplete for half your drills, since many interviews use a basic shared editor.
- A timer and a recording app. You will listen back to yourself three times.
- A practice set. LeetCode and the Grind 75 list are the usual sources; filter by the pattern of the day.
Then read the job description and tag each day below "core" or "optional" for your loop. Amazon's own interview advice recommends STAR-format answers and one or two prepared stories for each of its 16 Leadership Principles, so a candidate there should weight the story days more heavily. Meta's careers guidance describes two kinds of design interview, systems design and product design, so ask your recruiter which one you will get.
The eight coding patterns to drill#
Learn to name the pattern within two minutes of reading a prompt, and say its complexity before you type. One prompt each:
- Hash maps and grouping. Given order events, return total spend per customer. O(n) time, O(k) space for k customers.
- Heaps and top-k. Return the three customers with the highest spend. A heap of size k gives O(n log k).
- Two pointers. Given two sorted lists of user IDs, return the IDs in both without extra memory. O(n + m).
- Sliding window. Find the longest run of consecutive orders whose total stays under a spend cap. O(n), because each pointer only moves forward (this works only when amounts are non-negative, which is worth saying).
- Intervals. Merge overlapping login sessions per user. Sort by start, then sweep: O(n log n).
- BFS and DFS. Count connected regions on a grid of server racks marked up or down, or find the shortest number of hops between two services. O(V + E).
- Topological sort. Given build targets and their dependencies, return a valid build order or report a cycle. Kahn's algorithm with an in-degree count is O(V + E) and detects the cycle when nodes are left over.
- Binary search on the answer. Find the smallest per-worker capacity that finishes all jobs within a deadline. The check is O(n) and the search adds a log factor over the range of capacities.
After each problem, write the tests you skipped: empty input, duplicates, one element, the largest expected input.
Week 1 of the software engineer interview study plan: fundamentals#
The aim of week 1 is fluency. By Day 7 you should be able to read a problem, ask three clarifying questions, state an approach and its complexity, and start typing within four minutes.
Day 1: cold baseline (60 min)#
Take a 30-minute timed mock before you prepare anything; it tells you where to spend the next thirteen days. Then spend 30 minutes writing down:
- How many minutes passed before you wrote your first line of code.
- Every edge case you thought of only after the interviewer asked.
- The first sentence of your "tell me about your work" answer, word for word. If it starts with a job title and a date, you will fix it on Day 5.
You can take a 30-minute Software Engineer practice interview for the baseline; the scorecard quotes what you said against each skill, which makes the weak spots hard to argue with.
Day 2: standard library, grouping and top-k (75 min)#
Spend 30 minutes writing, from memory, a four-line example of each tool interview problems lean on. In Python: Counter, defaultdict, heapq, bisect, itertools.groupby (it only groups adjacent items, so sort first), sorted with a key, and datetime with zoneinfo.
Then 45 minutes on patterns 1 and 2: "Given order events with a customer ID, an amount and an ISO 8601 timestamp, return the three customers with the highest spend in the last seven days, in UTC." Out loud, explain why heapq.nlargest(3, totals.items(), key=lambda kv: kv[1]) beats sorting: sorting is O(k log k) over all customers, while the heap keeps only three.
Day 3: messy input and two pointers (75 min)#
Practical rounds, the kind many companies now use alongside classic algorithm problems, look like backend work: duplicated events, mixed date formats, missing fields. Spend 40 minutes on a parser that never crashes on a bad row and says why each row failed:
# Python 3.11+: fromisoformat accepts a trailing "Z" (3.10+ for the | syntax)
from datetime import datetime, timezone
def parse_ts(raw: str) -> tuple[datetime | None, str | None]:
try:
dt = datetime.fromisoformat(raw.strip())
except ValueError:
return None, "unparseable"
if dt.tzinfo is None:
return None, "naive" # ambiguous: count it rather than guess
return dt.astimezone(timezone.utc), NoneSay out loud why a naive timestamp is rejected rather than assumed to be UTC: a server logging local time would silently shift events by hours, and returning the reason lets you report "412 naive rows" upstream. Test a valid offset, a naive timestamp and an empty string. Use the last 35 minutes for pattern 3: deduplicate events by ID, then intersect two sorted ID lists.
Day 4: first system design drill (75 min)#
Design one slice of a familiar product in 25 minutes, out loud: a URL shortener, a notification fan-out, an order history API. Use a fixed running order:
- Requirements and non-goals (three minutes).
- A back-of-envelope estimate (three minutes, see the worked estimate below).
- API and data model (five minutes).
- Write path, then read path (eight minutes).
- Failure modes and what you would monitor (six minutes).
Spend the other 50 minutes reading. In the first edition of Martin Kleppmann's "Designing Data-Intensive Applications", that is chapter 1 (Reliable, Scalable and Maintainable Applications) and chapter 5 (Replication); in the second edition, written with Chris Riccomini, read chapter 6 (Replication) and use the contents page to find its material on reliability and scalability. They give you vocabulary you can use precisely, such as replication lag and read-your-writes consistency.
Day 5: write the story bank (75 min)#
Write all six stories using the story-bank template below. Also rewrite your opening answer so it starts with what your system does and who depends on it, for example: "I work on the payments backend at a mid-sized subscription business. My team owns the service that retries failed card charges, about 200,000 a month, and I led the move from cron jobs to a queue."
Out loud: tell each story once, timed. Do not polish yet.
Day 6: reliability and databases (2 hours)#
Backend interviews punish candidates who treat retries as free. Explain each idea below in two sentences, then check yourself against it.
- At-least-once delivery: SQS standard queues, and Kafka consumers that commit offsets only after processing, deliver at least once, so a message can arrive more than once and consumers must tolerate duplicates.
- Idempotency keys: the client sends a unique key with each request, and the server stores it so a repeat does nothing new. Stripe's API documentation is a good public example of the pattern.
- Transactions and isolation: READ COMMITTED, PostgreSQL's default, lets each statement see newly committed rows, so two reads in one transaction can disagree (non-repeatable reads and phantoms). It also allows write skew: two transactions each check that at least one other engineer is on call, and both go off call. SERIALIZABLE spots the conflict and rolls one of them back with SQLSTATE 40001, so your code must catch that error and retry.
- Safe rollout: feature flags, canary deploys, and expand-then-contract schema changes, where you add the new column, dual-write, backfill, switch reads, and only then drop the old column, so each step can be rolled back.
Then write the SQL you would use to make an insert safe to repeat:
INSERT INTO payments (idempotency_key, order_id, amount_cents)
VALUES ($1, $2, $3)
ON CONFLICT (idempotency_key) DO NOTHING
RETURNING id;Out loud: explain what the caller should do when RETURNING gives back no row. Model answer: no row means the key already exists, so run the follow-up query below and return that original result. If order_id or amount_cents differ from the new request, return a 409 or 422, because the client reused a key for a different request.
SELECT id, order_id, amount_cents
FROM payments
WHERE idempotency_key = $1;A unique constraint beats "check, then insert" in application code because two concurrent requests can both see no row and both insert; only the index stops that race.
Day 7: the 45-minute mock (90 min)#
Take a 45-minute mock with two-part coding, a short incident and a design section, then review for 45 minutes. Compare with Day 1 on three measures: minutes to first line of code, edge cases you raised unprompted, and whether your behavioural answer had a number in it. Anything that did not improve becomes Day 11's work.
Week 2: rehearsing the full interview loop#
Week 2 builds stamina: moving from coding to design to a story without losing structure.
Day 8: intervals and sliding window, back to back (75 min)#
Two 20-minute problems with a two-minute break: pattern 5 (merge overlapping sessions per user), then pattern 4 (longest run of orders under a spend cap). Log one mistake per problem. More prompts are in the software engineer interview questions.
Day 9: code review, debugging and graphs (75 min)#
Review a 60-line function you wrote last week as if a teammate had opened the pull request. Write three comments, each with the problem, why it matters, and a fix: "This catches Exception and logs it, so a bad row and a lost database connection look the same in the logs. Can we catch ValueError here and let the rest propagate?"
Then break it: introduce an off-by-one and a time zone bug, and leave it overnight. Finish with one 20-minute problem on patterns 6 or 7: a build order with cycle detection.
Day 10: hunt yesterday's bugs, then the second design drill (75 min)#
Find yesterday's bugs in under ten minutes, narrating each hypothesis and the evidence for or against it. Then a 35-minute design with a queue and a slow dependency: sending webhooks to thousands of partner endpoints, some of which time out. Cover retries with exponential backoff and jitter, a dead-letter queue, per-endpoint rate limits, and what the on-call engineer sees on a dashboard.
Day 11: fix the weakest skill from Day 7 (75 min)#
Work on whatever did not improve between Days 1 and 7. Slow to start? Do three ten-minute clarify-and-plan drills with no code. Missed edge cases? Redo two old problems, listing every edge case before typing. Finish with pattern 8, stating the search range and check function first.
Day 12: story rehearsal and the incident story (75 min)#
Rehearse every story aloud, two minutes each, then answer two follow-ups cold: "What would you do differently?" and "How did you know it worked?"
Tell the incident story in time order: how you found out, what you checked first and why, the mitigation, the root cause, what changed. No on-call history? Use a bug you shipped and fixed. Record the set and listen for every "we" that should be "I".
Day 13: the 60-minute dress rehearsal (2 hours)#
Take a full 60-minute timed mock, then spend an hour reviewing it against four measures:
- Minutes to first line of code, compared with Days 1 and 7.
- Edge cases you raised before the interviewer did.
- Whether every behavioural answer contained a number.
- Whether your design section reached failure modes and monitoring before time ran out.
Then transcribe the 90 seconds after the coding section ends, where candidates often keep apologising for the code instead of resetting. Rewrite it, for example: "That's the solution and its tests. Happy to move on to the design question; I'll start with requirements."
Day 14: light review (60 min)#
Rewrite the single worst moment from Day 13, then stop adding material. Re-read your story bank and mistakes list, and prepare owner-minded questions such as "How often does the team deploy, and what does a rollback look like?" and "How noisy are on-call pages?" Stop by early evening.
How to build a story bank for behavioural rounds#
Strong coders lose offers here when stories are vague or blur their work with the team's. Amazon's own interview advice is to use STAR (situation, task, action, result) and focus on "I" rather than "we", which holds almost everywhere.
Six stories cover nearly every behavioural prompt you will hear:
- A project you led or shaped from a vague request.
- A disagreement with a colleague or manager about a technical decision.
- A mistake you made that reached production.
- A production incident or hard debugging session.
- A time you helped someone else get better, through review, pairing or mentoring.
- A trade-off you made under deadline pressure: what you cut and why.
Interviewing at senior or above? Swap the trade-off story for influence without authority, such as getting three teams to adopt a shared retry library, with services migrated as the result.
Write each story in this template, in your prep document:
Title: Cut checkout latency by caching tax lookups
Prompts it answers: ownership, trade-off, measurable impact
Situation: (1 sentence) context, team size, what was at stake
Task: (1 sentence) what you specifically were responsible for
Actions: (3 bullets) what YOU did, in order, with the reason for each
Result: (1 sentence) a number, and how you measured it
Learned: (1 sentence) what you do differently now
Follow-ups: the 2 questions you are most afraid of, with answers
Length: under 2 minutes spokenA sample outline, so you can see the level of detail:
- Situation: our checkout API's p95 latency had crept from 300 to 900 milliseconds over a quarter, and mobile conversion was falling.
- Task: I owned the investigation, as the engineer with the most context on the tax service.
- Actions: I added tracing and found 60 percent of the time was a third-party tax call on every page load; I cached results per postcode and basket total for 15 minutes, after finance confirmed rates change at most monthly; I shipped it behind a flag to 5 percent of traffic first.
- Result: p95 fell to 350 milliseconds within a week of full rollout.
- Learned: I now add tracing to any new external dependency on day one.
How to use 30, 45 and 60 minute mock interviews#
Three timed mocks, each with a different job, beat a pile of untimed ones.
- 30 minutes (Day 1): a diagnostic, short enough to take cold.
- 45 minutes (Day 7): a progress check. The two-part coding problem tests whether your first solution extends without a rewrite, a good proxy for clean structure.
- 60 minutes (Day 13): a dress rehearsal, long enough that fatigue shows. Camera on, phone in another room.
After each, transcribe the first 60 seconds of your coding section; it shows whether you clarified before you typed. You can practise a timed 30, 45 or 60 minute Software Engineer mock interview with an AI interviewer and get a scorecard that quotes your own words, which is what makes the review useful. There is more on how the practice interviews work.
A back-of-envelope estimate to rehearse#
Rehearse one estimate until the arithmetic is automatic: an activity feed with 10 million daily users, each creating 20 events a day.
- Writes: 10 million times 20 is 200 million events a day. A day has 86,400 seconds, call it 100,000, so that is about 2,000 to 2,300 writes a second on average.
- Peak: traffic is not flat. Assume a peak of three times average, so plan for about 7,000 writes a second.
- Storage: at roughly 1 KB per event, 200 million events is about 200 GB a day, or around 73 TB a year before replication.
- Reads: if each person opens the feed ten times a day, that is 100 million reads a day, around 1,200 a second on average and perhaps 3,500 at peak.
Then say what the numbers imply: "7,000 writes a second is comfortable for a partitioned log such as Kafka but heavy for a single PostgreSQL primary, and 73 TB a year means a retention policy or a cheaper store for events older than 90 days." The conclusion matters more than the precision.
The day before and the morning of the interview#
- Confirm the logistics in writing: time zone, video link, which editor, and whether you can choose your language. Open the tool and type a function in it.
- Re-solve one problem you have already solved, 20 minutes, for rhythm. If you can tell each story from its title alone, you are ready.
- Warm up on the morning with one easy problem out loud, then say your clarifying checklist once: input size, edge cases (empty, duplicates, invalid), output format, time or memory.
- Have a recovery line ready: "Let me write the brute-force version first so we have something correct, then I will improve it." A correct solution plus a stated optimisation usually lands better than a clever idea with no running code, because it shows you can finish.
A 3-day plan if your interview is soon#
Cut everything that does not directly raise your score and keep the out-loud practice.
Day 1 of 3: baseline and stories#
- Take a 30-minute timed mock first thing and note the two weakest skills.
- Write four stories, not six, because a project you led, a mistake, an incident and a disagreement cover the most prompts. Tell each aloud, timed to two minutes.
- Do one 20-minute coding problem, then write the tests you missed.
Day 2 of 3: coding and design under time#
- Two 20-minute coding problems back to back, narrated: one on grouping and top-k, one on intervals or sliding window.
- One 25-minute design drill using the five-step running order, including the back-of-envelope estimate.
- Re-tell the two weakest stories and answer two follow-ups on each.
Day 3 of 3: rehearsal then rest#
- Take a 45 or 60-minute mock in the morning and fix the single worst moment it shows by rewriting that answer.
- Reread the reliability basics from Day 6 of the full plan: idempotency keys, at-least-once delivery, isolation levels, safe rollouts.
- Stop by mid-afternoon, prepare your logistics and questions, and sleep.
Frequently asked questions#
How many hours a day should I study for a software engineer interview?#
About 75 minutes on weekdays and up to two hours at weekends is enough for most working engineers over two weeks. Spend at least half of every session practising out loud rather than reading or watching videos.
Should I practise LeetCode or system design first?#
Start with coding, because almost every loop has at least one coding round and it is usually a must-pass. Drill by pattern, two patterns a day, rather than by random problem. Add a system design drill from Day 4 if you are interviewing at mid-level or above, where design carries real weight. Junior candidates can give design one drill a week.
How many behavioural stories do I need for a software engineer interview?#
Six well-prepared stories cover nearly every behavioural question: a project you led, a disagreement, a mistake, an incident, helping someone improve, and a trade-off under deadline. Each should take under two minutes, describe what you personally did, and end with a measurable result. Senior candidates should swap the trade-off story for one about influence without authority.
How many mock interviews should I do before a software engineer interview?#
Three timed mocks spread over two weeks works well: a 30-minute cold baseline on Day 1, a 45-minute progress check on Day 7 and a 60-minute dress rehearsal on Day 13. Spend as long reviewing each mock as you spent taking it.
What should I do if I get stuck during a coding interview?#
Say so and narrow the problem. Restate what you know, write a brute-force solution that is correct, and test it on a small example before optimising. Narrate the hypotheses you are testing, for example: "The nested loop is O(n squared); if I store what I have seen in a set, the inner lookup becomes constant time. Let me try that."