Search Tech Journey

Find topics, journeys and posts

back to blog
algorithmsadvanced 75m read

L62 · Company-Tagged — Microsoft & Amazon

Work the frequency-ranked lists for the two companies that matter most to you, and adapt to each one's distinct interview style rather than treating all loops as identical.

🧩DSAPhase 4 · Interview simulation· Session 062 of 130 75 min

🎯 Stop grinding random problems and start working the two companies' frequency-ranked lists, adapting your delivery to each one's distinct interview culture.

Series: LeetCode — From Basics to Interview-Ready · Session 62 / 65 · Phase 4 · Interview simulation

Prerequisites

You should have finished Phases 1–3 (patterns through advanced). This is not a new-pattern session — it's a targeting session. You already own the techniques; now you point them at the specific problem distributions and interview styles of the two companies most people in this series are aiming at.

Watch first (skim before the session)

Why this session exists

By this point you've drilled patterns in isolation. Interviews don't hand you a labelled pattern — they hand you a story, and they're tagged by company because different companies pull from different corners of the problem space and grade differently. This session is about targeting: work the frequency-ranked list for your target company, and rehearse the delivery style that company rewards.

The two companies here have genuinely different cultures, and treating an Amazon loop like a Microsoft loop (or vice versa) leaves marks on the table.

Same instrument, different audition
🌍 Real world
You've learned to play the piano (the patterns). Now you're auditioning for two orchestras. One wants you to talk through your interpretation as you play and connect it to their values (Amazon). The other wants clean, correct technique and to see how you extend a piece when they add a twist (Microsoft). Same skill, different room, different scoring.
💻 Code world
# The DSA is identical. # What changes: which problems appear, and how you're graded on delivering them.

Microsoft: style and staples

Microsoft interviews tend to be conversational and extension-driven. A single problem often grows: you solve the base case, then they add a constraint ("now the input streams in", "now do it in place", "now handle duplicates"). They care about clean code, correct edge cases, and how gracefully you adapt when the problem mutates mid-interview.

Staple problems (real LeetCode, classically Microsoft-tagged):

  • LC151 · Reverse Words in a String — in-place-ish string surgery; watch multiple spaces.
  • LC54 · Spiral Matrix — careful boundary bookkeeping; the extension is "generate" (LC59).
  • LC48 · Rotate Image — in-place 90° rotation; the transpose-then-reverse trick.
  • LC236 · Lowest Common Ancestor of a Binary Tree — the recursive return-up pattern.
  • LC138 · Copy List with Random Pointer — hashmap or the interleave trick.
  • LC146 · LRU Cache — hashmap + doubly-linked list; a design classic they love.
  • LC33 · Search in Rotated Sorted Array — binary search with the sorted-half decision.
  • LC53 · Maximum Subarray — Kadane; extension to "return the subarray".

Amazon: style and staples

Amazon interviews wrap DSA in Leadership-Principles framing and value clear narration, explicit trade-offs, and edge-case discipline. The coding bar is medium-heavy; the differentiator is often how you communicate — stating assumptions, calling out complexity, and connecting your choices to customer impact.

Staple problems (real LeetCode, classically Amazon-tagged):

  • LC200 · Number of Islands — the single most-asked Amazon graph problem; DFS/BFS flood fill.
  • LC56 · Merge Intervals — sort-then-sweep; the canonical interval problem.
  • LC146 · LRU Cache — design; also huge at Amazon.
  • LC127 · Word Ladder — BFS shortest transform (Hard).
  • LC973 · K Closest Points to Origin — heap / quickselect.
  • LC1 · Two Sum — still asked as a warm-up; nail it in 60 seconds.
  • LC994 · Rotting Oranges — multi-source BFS.
  • LC207 · Course Schedule — topological sort / cycle detection.

From first principles: why company-tagged practice works

From first principles
Start with the question
Why is working a company's frequency-ranked list better than grinding random problems in the last mile?
  1. 1
    Interview problem distributions are NOT uniform — each company pulls disproportionately from certain patterns.
    forced by · Teams reuse question banks and cultural staples, so a handful of patterns account for most of what you'll actually see.
  2. 2
    Your remaining prep time is scarce and has diminishing returns on already-strong patterns.
    forced by · The marginal value of your Nth flanker-problem is tiny; the value of your first Number-of-Islands before an Amazon loop is huge.
  3. 3
    So you should weight practice by (company frequency) × (your current weakness), not by novelty.
    forced by · That maximises expected interview coverage per hour spent — an explicit expected-value calculation.
  4. 4
    Delivery style is separately gradable and company-specific, so rehearse it explicitly.
    forced by · Two candidates with identical code get different scores based on narration, trade-off articulation, and follow-up handling.
⇒ Therefore
Last-mile prep = frequency-ranked list, filtered by your weak patterns, rehearsed in the target company's delivery style.

Mental model

Mental modelTarget, don't grind
Two dartboards, one per company, with the rings weighted by how often each pattern shows up there. You throw where the points are — Amazon's bullseye is graphs + intervals + design + narration; Microsoft's is string/matrix surgery + trees + extension-handling. You don't throw at random and hope.
  • Pick the target company; pull its frequency-ranked, company-tagged list.
  • Filter to your WEAK patterns first — strong patterns have low marginal value now.
  • For Amazon: narrate brute-force → complexity → insight → optimised complexity, out loud.
  • For Microsoft: solve, then proactively invite the extension.
🔔 Fires when you see
You have a specific company loop scheduled and limited days left.

Memory hook

"Amazon: narrate and dive deep. Microsoft: solve then stretch." Two four-word cues, one per company, capturing the delivery difference. On the morning of a loop, recite the one for that company; it primes the behaviour the graders actually reward.

Common misconception
✗ What most people think
If my code is correct and optimal, delivery style doesn't matter — the algorithm is the algorithm.
✓ What is actually true
At Amazon and Microsoft, two candidates with identical correct code routinely get different scores. Narration, trade-off articulation, edge-case discipline, and follow-up handling are explicitly graded.
Why the myth is so sticky
Interview rubrics score 'communication' and 'problem-solving process' as separate axes from 'correctness'. A silent correct solution can lose to a narrated correct solution.
Prove it to yourself
After you 'finish', ask: did I state my complexity out loud, name my edge cases, and either handle or invite the follow-up? If not, you left points on the table regardless of correctness.

What interviewers actually ask (mixed mock)

Run these as a timed mock, alternating the two styles. For each, state complexity out loud and name at least one edge case before coding.

  • LC200 · Number of IslandsAmazon. DFS/BFS flood fill. Probe: grid traversal + visited handling; follow-up: count island shapes (LC694) or largest island (LC695).
  • LC56 · Merge IntervalsAmazon, Microsoft. Sort by start, sweep. Probe: the overlap condition; follow-up: insert one interval into a sorted set (LC57).
  • LC54 · Spiral MatrixMicrosoft. Boundary shrinking. Probe: off-by-one on the four edges; follow-up: generate the spiral (LC59).
  • LC146 · LRU Cacheboth. Hashmap + DLL, all ops O(1). Probe: the eviction wiring; follow-up: LFU (LC460, Hard).
  • LC33 · Search in Rotated Sorted ArrayMicrosoft. Which half is sorted. Probe: the pivot logic; follow-up: with duplicates (LC81).
  • LC973 · K Closest Points to OriginAmazon. Max-heap of size k or quickselect. Probe: why a heap beats a full sort; follow-up: quickselect for average O(n).

The escalation is always there — have the follow-up ready before they ask. That readiness is what "senior signal" looks like.

Tradeoff

The tradeoff
With limited days before a loop, how do you allocate practice time?
Breadth: cover many patterns once each
+ you gain Reduces the chance of a total blank on an unfamiliar shape.
− you pay Shallow; you may fumble the follow-up on anything.
pick when if your foundation is genuinely patchy and there are still weeks left.
Targeted depth: company list × your weak patterns
+ you gain Maximises expected interview coverage per hour; builds follow-up-ready fluency where it counts.
− you pay Leaves rare patterns thin — a small tail risk.
pick when in the last 1–2 weeks before a specific company loop (the situation this session assumes).
What a senior engineer actually does
In the last mile, targeted depth wins. Pull the company's frequency list, filter to your weak patterns, and rehearse delivery. Breadth is for earlier phases.

In practice

Frequency-ranked company lists are a real and legitimate prep tool (LeetCode's own company tags, and community-maintained frequency lists). The signal is noisy — banks rotate, and no list is a guarantee — so treat it as a weighting, not a script. The durable habit this session builds is meta: near any high-stakes evaluation, spend your last scarce hours on the intersection of "most likely to appear" and "where I'm weakest", and rehearse the delivery the evaluator rewards. That transfers well beyond coding interviews.

You are ready to move on when you can
  • Name 5+ frequency staples for each of Amazon and Microsoft without looking.
  • Articulate the delivery difference: Amazon narrate/dive-deep vs Microsoft solve-then-stretch.
  • For any staple, state brute-force complexity, the insight, optimised complexity, and one follow-up — out loud.
  • Explain why last-mile prep weights by frequency × your weakness, not novelty.
  • Run a 45-minute two-problem mock alternating the two companies' styles.
Check yourself · click to reveal
★ = stretch question

Practice queue

Run as a timed mock in this order; log each as cold / warm / hint / failed, and note whether you narrated + handled the follow-up.

  1. LC200 Number of Islands — Amazon staple.
  2. LC56 Merge Intervals — both.
  3. LC54 Spiral Matrix — Microsoft staple.
  4. LC146 LRU Cache — design, both.
  5. LC33 Search in Rotated Sorted Array — Microsoft.
  6. LC973 K Closest Points to Origin — Amazon.
Key points