ES in depth
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Layer 3 · Go deeper · 8 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How many primary shards for Bazaar’s 100 GB catalogue?

      A node is back from a 6-minute patch reboot. What must it replay?

        How much local disk do 90 days of Bazaar’s logs need?

          Build-up · 6 steps

          Follow one sale price through replication

          Mid-sale, Bazaar runs two replicas per shard. Watch one price update for P-48213 get routed, numbered, copied and acknowledged, and see why checkpoints lag.

          Step 1 of 6

          Route it to shard 0

          The indexer sends P-48213’s sale price to any node. That coordinating node computes hash(P-48213) % 4 = 0 and forwards the update to shard 0’s primary, on data-1.

          4 interview moments

          You’re the candidate

          The interviewer pushes on the hard parts. Pick an approach and see how it holds up.

          1. Deep dive 1 of 4

            Interviewer

            “Bazaar’s product cluster is growing past a handful of nodes. How do you set up the master-eligible nodes?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Bazaar’s catalogue keeps growing, and you want 6 primaries instead of 4. How do you get there?”

            Documents route by hash(_routing) % number_of_shards, and _routing defaults to the _id.

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “Sellers want “my listings” to be fast, but it searches all 4 shards. Do you route products by seller?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Bazaar’s logs arrive at about 1 TB a day and are kept for 90 days. How do you store them?”

            Your move. Pick an approach: