cswork / libraryOpen practice workspace

Interview guides · Keystone

Keystone Software Engineer Interview Guide

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

The 60-second brief

A Software Engineer at Keystone operates at the unique intersection of advanced software engineering, data science, and strategic business consulting. Unlike traditional technology firms where engineers might focus on a single product feature or microservice, engineers at Keystone tackle highly complex, transformative problems. You will design and build scalable data pipelines, develop proprietary platforms, and analyze massive, unstructured datasets to solve critical challenges for some of the world’s largest technology companies and legal minds. In this role, your work directly impacts landmark legal cases, high-stakes intellectual property disputes, and massive digital transformation initiatives.

This guide is scoped to a Software Engineer candidate at Keystone.

Focus areas

  • Pandas
  • Case Study Problem Solving
  • Reasoning and Thought Process

The Keystone interview process

Keystone candidates report 4 rounds over 3-5 weeks. The stages below are what candidates describe, not a published process.

Initial Screening

A preliminary assessment to establish a baseline of your problem-solving capabilities.

What to demonstrate

  • A preliminary assessment to establish a baseline of your problem-solving capabilities
  • Depth in Pandas

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.

Technical Evaluation

In-depth technical assessment including code repository analysis or live coding session.

What to demonstrate

  • In-depth technical assessment including code repository analysis or live coding session
  • Depth in Pandas

How to prepare

  • Answer aloud and timed: Write a function to merge two large datasets on a non-unique key and optimize the memory footprint of the resulting DataFrame.
  • Answer aloud and timed: How would you identify and resolve a bottleneck in a data pipeline that relies heavily on complex data transformations?

Case Study Rounds

Engagement in case study discussions to evaluate analytical reasoning.

What to demonstrate

  • Engagement in case study discussions to evaluate analytical reasoning
  • Depth in Pandas

How to prepare

  • Answer aloud and timed: How would you design a methodology to measure the market impact of a major platform's algorithm change on small businesses?
  • Answer aloud and timed: Imagine a client wants to audit a competitor's proprietary recommendation engine. How would you structure a technical approach to analyze their public-facing data?

Deep-Dive Discussions

In-depth discussions with senior leadership and Partners to assess cultural alignment.

What to demonstrate

  • In-depth discussions with senior leadership and Partners to assess cultural alignment
  • Depth in Pandas

How to prepare

  • Answer aloud and timed: Walk us through how you would estimate the infrastructure costs and scaling challenges of migrating a legacy on-premise data platform to the cloud.
  • Answer aloud and timed: How would you evaluate whether a dataset is biased or unrepresentative before using it to train a predictive model for a client?

Where candidates lose points

Master the Pandas library

You should be able to perform complex data aggregations, merges, and transformations in Pandas quickly and without relying constantly on documentation. This is a frequent focal point of the technical rounds.

Structure your thoughts aloud

During the case study and system design rounds, the interviewers care immensely about your thought process. Talk through your assumptions, call out potential edge cases, and explain the trade-offs of your decisions in real time.

Be ready to discuss past projects in depth

When walking through your prior code or repositories, be prepared to defend your architectural choices. Explain what went well, what failed, and what you would do differently if you had to scale the system.

When discussing past projects, focus heavily on the 'why' behind your technical decisions, not just the 'what'

Showing that you understand business and performance constraints is highly valued at Keystone.

Questions & practice

Write a function to merge two large datasets on a non-unique key and optimize the memory footprint of the resu

Medium · Data Manipulation & Analysis

Write a function to merge two large datasets on a non-unique key and optimize the memory footprint of the resulting DataFrame.

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?

Diff a projection against the primary without per-row point reads

Hard · reconciliation · range hashing · throttling

The listing projection has drifted and some rows show a stale version. The primary holds 40,000,000 resource rows across 12,000 tenants while serving 1,200 writes and 14,000 reads per second. The obvious repair, reading each resource row and comparing its version against the projection, is correct and would eventually finish. Explain precisely why it is unacceptable here, then give a diff that finds the differing rows, state its complexity, and make it safe to run against a live primary. Replication lag is usually under 100 ms and is not bounded.

Approach

  1. Quantify the naive cost rather than calling it slow: 40,000,000 point reads at even 0.5 ms each is over five hours serialised, and the only lever is concurrency, which is exactly what you cannot spend. The primary's pool is sized for the write path, and 40,000,000 random reads evict the buffer cache that sustains the 85 percent cache hit rate, so the audit degrades the system it is auditing.
  2. Replace random access with one ordered pass per side. Both sides can be read in (tenant_id, resource_id) order, which is a sequential scan on each and a merge join in O(n) time and O(1) memory. For a dense diff that is the whole answer, and it reads the primary once instead of 40,000,000 times.
  3. For the expected sparse case, compare range hashes instead of rows: partition the key space, compute per range an order-independent aggregate over hash(resource_id, version), compare aggregates, and descend only into ranges that differ. With d differing rows and branching factor B, at most d ranges mismatch per level, so the drill-down examines O(d log_B(n/d)) ranges and reads full rows only in mismatching leaves.
  4. Aggregate with a sum modulo 2^64 or a multiset hash, never XOR. XOR is order-independent but self-cancelling, so two rows wrong in the same way, or a row duplicated on one side, leave the range aggregate matching and the range is declared clean.

Follow-up

  • The diff reports 900 stale rows. How do you decide between patching those rows and rebuilding the projection from resource_revision?
  • Same job, but the projection lives in a search index that cannot be scanned in key order. What changes?

Identify the heaviest tenants in a five-minute window under memory pressure

Medium · top-k · heavy hitters · streaming

The edge service handles about 3,000 requests per second across roughly 50,000 tenants, peaking near 9,000. Expose the 50 heaviest tenants by request count over the trailing five minutes so limits can be tightened before one tenant's backfill starves the fleet. You may not retain five minutes of raw records. Give the exact solution and its memory, then the bounded-memory approximation with its error stated as a formula, and say which you would ship and at what tenant cardinality that choice changes.

Approach

  1. Do the exact version first, because it is affordable at this cardinality: a ring of 300 one-second counters per tenant, advanced lazily, is 1,200 bytes of counters per tenant and roughly 60 to 90 MB for 50,000 tenants with overhead. Carry a running total and subtract the bucket you overwrite so a window read is O(1) rather than 300 adds.
  2. Extract the top 50 with a size-k min-heap over the tenant sums: O(d log k) for d tenants, against O(d log d) to sort them all. Maintaining the heap continuously instead of on query requires a tenant-to-heap-index map, because incrementing a count already inside the heap means sifting from a known position, and without that map you rebuild the heap on every request.
  3. State the approximation precisely rather than gesturing at sketches. Misra-Gries with m counters retains every item whose true count exceeds N/(m+1), and each retained count underestimates the truth by at most N/(m+1). With m = 1,000 and N = 900,000 requests in the window the error is roughly 900 requests, which is fine for spotting a tenant sending 50,000 and useless for ranking two tenants 200 apart.
  4. Say what breaks when the window slides: Misra-Gries and Space-Saving are insert-only and cannot be decremented as records age out. The workable construction is one summary per sub-window, say ten seconds, with 30 summaries merged at query time, and the merged error is the sum of the per-summary errors, so the bound degrades linearly in the number of sub-windows.

Follow-up

  • The heaviest tenant is heavy because of one export job rather than user traffic. Should the limiter treat those as the same tenant?
  • Two tenants sit tied at the boundary of the top 50. Does your answer flap, and does the flapping matter?

Denormalise tenant onto revisions and backfill it live

Hard · denormalisation · online migration · backfill

resource_revision (revision_id, resource_id, version, actor_user_id, change_kind, patch, request_id, created_at) has 400M rows and no tenant column; tenant_id lives only on resource. Two reads need it: a tenant-scoped audit feed ordered by created_at DESC, and an offboarding purge. Both join back to resource today. Justify adding tenant_id to resource_revision against those two reads, name the anomaly the copy introduces and the constraint that prevents it, then give the ordered migration for a live table taking 1.2k writes/second — the lock each step takes, how the backfill is batched, and where each step stops being reversible. PostgreSQL 16.

Approach

  1. Justify from the access path rather than from taste. Without the column, the audit feed either scans resource_revision by created_at and discards other tenants' rows, or resolves the tenant's resource_ids first and probes with them — both proportional to the tenant's whole history rather than to one page. With (tenant_id, created_at DESC, revision_id DESC) it is a seek that stops at 50 rows, and the purge becomes a ranged delete instead of a join.
  2. Name the cost exactly: a second copy of a fact can disagree with the first. Make the disagreement unwritable rather than documented — add UNIQUE (resource_id, tenant_id) on resource so it can serve as a foreign-key target, then FOREIGN KEY (resource_id, tenant_id) REFERENCES resource (resource_id, tenant_id) on the revision table. A revision can then only ever carry its parent's tenant.
  3. Step one, expand: ALTER TABLE resource_revision ADD COLUMN tenant_id BIGINT NULL, with no default, so it is a catalogue change and no rewrite. It still needs ACCESS EXCLUSIVE for an instant, and that instant queues behind the longest open transaction on the table while every later query queues behind it — set lock_timeout to 2s and retry rather than wait.
  4. Step two, dual-write: deploy the writer that populates tenant_id on every new revision while reads still use the join. Reversible by redeploying the previous build, because nothing reads the column yet.

Follow-up

  • The backfill is half finished and a rollback is required. What state is the table in, and what does the previous build do with a half-populated column?
  • How do you verify the backfill actually finished, given rows are still being inserted while it runs?

Keep soft-deleted accounts from blocking re-registration

Easy · soft delete · unique constraints · engine differences

app_user holds user_id, tenant_id, email CITEXT, password_hash (NULL for SSO principals), email_verified_at, auth_version, status ('invited','active','suspended','deactivated'), created_at, updated_at, deleted_at. Two live accounts for one address inside a tenant must be impossible, but an address freed by a soft delete must be reusable, and the same tenant may delete and re-register it repeatedly. Write the uniqueness DDL for PostgreSQL 16, then the equivalent for MySQL 8 where partial indexes do not exist, and say what each permits once three deleted rows already hold that address.

Approach

  1. Start from what is actually unique: not (tenant_id, email), but (tenant_id, email) among live rows. PostgreSQL says that directly — CREATE UNIQUE INDEX app_user_live_email ON app_user (tenant_id, email) WHERE deleted_at IS NULL. A full constraint over the same two columns burns the address permanently the first time someone deletes an account.
  2. Keep case-insensitivity in the type or the index, never in the application: CITEXT as given, or UNIQUE (tenant_id, lower(email)) as an expression index where the extension is unavailable. A case-sensitive unique column is exactly how two accounts for one human appear.
  3. For MySQL 8 the predicate has to move inside the key: add a discriminator column that is a constant 0 while the row is live and is set to user_id on delete, with UNIQUE (tenant_id, email, deleted_marker). Live rows share the constant and still collide; deleted rows differ from each other and stop colliding.
  4. State the NULL variant and its dependency: leaving the marker NULL for deleted rows also works, because a unique index treats NULLs as distinct — true in MySQL, and true in PostgreSQL only under the default NULLS DISTINCT, which PostgreSQL 15 lets you reverse. Check the polarity against the three existing deleted rows: constant-on-live is what preserves the collision you want, and reversing it silently admits duplicate live accounts.

Follow-up

  • A deleted account re-registers with the same address the next day. Do the old resource rows follow the new user_id, and how does the API keep the two principals apart?
  • How do you honour an erasure request while resource_revision.actor_user_id still references this table?

Explain the difference between vectorization and using apply in Pandas, and when you would choose one over t

Medium · Data Manipulation & Analysis

Explain the difference between vectorization and using apply in Pandas, and when you would choose one over the other.

Approach

  1. Clarify what is being asked and what a complete answer contains.
  2. State your assumptions explicitly before working the problem.
  3. Say what you would check first and why it is the highest-information step.
  4. 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 identify and resolve a bottleneck in a data pipeline that relies heavily on complex data transfo

Medium · Data Manipulation & Analysis

How would you identify and resolve a bottleneck in a data pipeline that relies heavily on complex data transformations?

Approach

  1. Clarify what is being asked and what a complete answer contains.
  2. State your assumptions explicitly before working the problem.
  3. Say what you would check first and why it is the highest-information step.
  4. 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 methodology to measure the market impact of a major platform's algorithm change on smal

Medium · Case Studies & Analytical Thinking

How would you design a methodology to measure the market impact of a major platform's algorithm change on small businesses?

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?

Imagine a client wants to audit a competitor's proprietary recommendation engine. How would you structure a te

Medium · Case Studies & Analytical Thinking

Imagine a client wants to audit a competitor's proprietary recommendation engine. How would you structure a technical approach to analyze their public-facing data?

Approach

  1. Clarify what is being asked and what a complete answer contains.
  2. State your assumptions explicitly before working the problem.
  3. Say what you would check first and why it is the highest-information step.
  4. Work from the requirement backwards to the design.

Follow-up

  • What assumption would you test first?
  • How would you know your answer was wrong?

Walk us through how you would estimate the infrastructure costs and scaling challenges of migrating a legacy o

Medium · Case Studies & Analytical Thinking

Walk us through how you would estimate the infrastructure costs and scaling challenges of migrating a legacy on-premise data platform to the cloud.

Approach

  1. Clarify what is being asked and what a complete answer contains.
  2. State your assumptions explicitly before working the problem.
  3. Say what you would check first and why it is the highest-information step.
  4. 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 evaluate whether a dataset is biased or unrepresentative before using it to train a predictive m

Medium · Case Studies & Analytical Thinking

How would you evaluate whether a dataset is biased or unrepresentative before using it to train a predictive model for a client?

Approach

  1. Clarify what is being asked and what a complete answer contains.
  2. State your assumptions explicitly before working the problem.
  3. Say what you would check first and why it is the highest-information step.
  4. Work from the requirement backwards to the design.

Follow-up

  • What assumption would you test first?
  • How would you know your answer was wrong?

Walk me through a complex codebase or repository you have built. What were the key architectural trade-offs yo

Medium · Code Repository & Systems Architecture

Walk me through a complex codebase or repository you have built. What were the key architectural trade-offs you made?

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?

How would you design a scalable system to ingest, process, and store terabytes of daily event logs from multip

Medium · Code Repository & Systems Architecture

How would you design a scalable system to ingest, process, and store terabytes of daily event logs from multiple external APIs?

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 strategies do you use to ensure your code is modular, testable, and easily understood by cross-functional

Medium · Code Repository & Systems Architecture

What strategies do you use to ensure your code is modular, testable, and easily understood by cross-functional team members?

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 Keystone candidates report.

Day 1 — Map the Keystone loop

  • Write out the reported sequence: Initial Screening, Technical Evaluation, Case Study Rounds, Deep-Dive Discussions.
  • 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 4 reported rounds, with the weakest marked.

Day 2 — Work Pandas

  • Spend the session on Pandas, which Keystone candidates report being tested on.
  • Write one worked example in Pandas and time yourself on it.

Deliverable: One timed worked example in Pandas.

Day 3 — Work Case Study Problem Solving

  • Spend the session on Case Study Problem Solving, which Keystone candidates report being tested on.
  • Write one worked example in Case Study Problem Solving and time yourself on it.

Deliverable: One timed worked example in Case Study Problem Solving.

Day 4 — Work Reasoning and Thought Process

  • Spend the session on Reasoning and Thought Process, which Keystone candidates report being tested on.
  • Write one worked example in Reasoning and Thought Process and time yourself on it.

Deliverable: One timed worked example in Reasoning and Thought Process.

Day 5 — Answer out loud: Data Manipulation & Analysis

  • Answer aloud, timed: Explain the difference between vectorization and using apply in Pandas, and when you would choose one over the other.
  • Answer aloud, timed: How do you handle missing or malformed data in a large Pandas DataFrame without sacrificing performance?

Deliverable: Spoken answers to 2 reported Data Manipulation & Analysis question(s), under time.

Day 6 — Answer out loud: Case Studies & Analytical Thinking

  • Answer aloud, timed: How would you design a methodology to measure the market impact of a major platform's algorithm change on small businesses?
  • Answer aloud, timed: Imagine a client wants to audit a competitor's proprietary recommendation engine. How would you structure a technical approach to analyze their public-facing data?

Deliverable: Spoken answers to 2 reported Case Studies & Analytical Thinking question(s), under time.

Day 7 — Answer out loud: Code Repository & Systems Architecture

  • Answer aloud, timed: Walk me through a complex codebase or repository you have built. What were the key architectural trade-offs you made?
  • Answer aloud, timed: How would you design a scalable system to ingest, process, and store terabytes of daily event logs from multiple external APIs?

Deliverable: Spoken answers to 2 reported Code Repository & Systems Architecture question(s), under time.

Behavioural preparation

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

How do you handle missing or malformed data in a large Pandas DataFrame without sacrificing performance?

Medium · Data Manipulation & Analysis

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?

How do you handle version control, dependency management, and CI/CD pipelines when working on multi-disciplina

Medium · Code Repository & Systems Architecture

How do you handle version control, dependency management, and CI/CD pipelines when working on multi-disciplinary data projects?

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?

Reverse your own decision and price the reversal

Medium · reversibility · measurement · migrations

Describe a technical decision you made and later reversed. Pick one that cost something: a service you split and merged back, a cache you added and removed, an index you created that pushed the planner onto a worse plan, a projection you rebuilt from scratch. State what you believed when you decided, the measurement that changed your mind, how long the wrong version ran in production, and what the reversal cost in migrations, dual writes, and a deprecation window for callers you did not own.

Approach

  1. State the original rationale without irony, in the version you would still defend given what was known then. If it is not defensible, the story is about carelessness rather than judgement, and a different example serves you better.
  2. Give the measurement that moved with a before and after: the p99 that did not improve, the cache hit rate that sat at 40%, the plan that flipped to a sequential scan once the table passed a size you can name.
  3. Cost the reversal in steps, not adjectives: expand-and-contract deploys, the dual-write window, the callers who had to be notified, the rows already written in the wrong shape that had to be backfilled or abandoned.
  4. Distinguish reversal from rewrite by naming what you kept. Most good reversals preserve the schema or the interface and undo one decision inside it, which is also why they were affordable.

Follow-up

  • What in that decision was irreversible, and did you know it was irreversible when you made it?
  • How did you tell the people who had already built on top of the original decision?