FDE Times dataFDE jobs open 928▲21 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 85Companies hiring 200Remote-friendly 24%Median US pay $200kTop hirer Databricks 107
中文VI

The newspaper of the Forward Deployed Engineer

Guides

At Palantir's FDSE onsite, the bug may be a single flipped minus sign

The re-engineering and learning rounds score a systematic method rather than speed, so a small laptop drill beats grinding through practice problems.

ShareLinkedInFacebookX

In brief

  • The re-engineering round is usually a 200–1,000-line codebase that gives wrong results. The bugs are in the logic, not the syntax, and the interviewer watches whether you debug systematically.
  • Strong candidates start from the wrong output and trace back to the input. Guessing a spot, patching it and rerunning is the approach that tends to fail people.
  • In the learning round, read the documentation carefully, say what you understand and ask high-level questions. Long silences are easily read as being stuck.
Dot chart for the ledger.py exercise. For customer A, the correct result is 70 but the code prints 130. The gap of 60 equals twice the refund of 30, showing the refund's sign is flipped. For customer B, the correct result is 50 but the code prints 180. The gap of 130 equals A's balance, showing the total variable is not reset when the customer changes.
Working backwards from wrong output: the size of each gap points to each bug before any guessing. Source: the ledger.py exercise built for this article.

You are handed a codebase of 200 to 1,000 lines that you have never read. It is producing wrong results, and you have 60 minutes in CodePair to fix it. The bug may be nothing more than a minus sign that has turned into a plus.

This is the re-engineering exercise in Palantir’s onsite for Forward Deployed Software Engineers. The onsite picks up to four rounds from five types: Decomposition, Re-engineering, Coding, Learning and System Design. This guide covers two of them, re-engineering and learning.

Both are worth serious practice because they sit very close to the real job. Re-engineering means working with an existing system: understanding it, critiquing it, then extending or fixing it. That is a fairly faithful simulation of what an FDE does with a client’s legacy systems.

The learning round gives you an unfamiliar tool or API and asks you to use it straight away. That, too, is a familiar situation when you have to work with whatever tools the client already runs.

Graded on process

The Aced/Exponent guide is explicit that interviewers focus on whether your debugging process is systematic, rather than on how quickly you spot the first bug. According to TechPrep, the round also measures how long it takes you to get your bearings in a messy repository and start doing useful work.

Grinding through lots of problems will therefore not be enough. You need to practice a procedure until it becomes a reflex. The steps below show how to build a small set of drills on your laptop to do that.

What you need: Python 3, an editor, a timer and some way to record yourself. A friend willing to play interviewer is even better.

Step 1: Plant bugs in a piece of code

The bugs in Palantir’s problems are logic bugs: a flipped sign, a wrong assumption about sort order, or a variable that is not reset between loop iterations. The code below was written for practice and is not a real interview problem. It deliberately contains two of those three kinds of bug.

# ledger.py — a home-made drill with bugs planted in it
def net_by_customer(txns):
    result = {}
    total = 0
    current = None
    for cust, kind, amount in sorted(txns):
        if cust != current:
            if current is not None:
                result[current] = total
            current = cust
        if kind == "refund":
            total += amount
        else:
            total += amount
    result[current] = total
    return result

txns = [("A", "sale", 100), ("A", "refund", 30), ("B", "sale", 50)]
print(net_by_customer(txns))

Run python3 ledger.py. The correct result is 70 for A and 50 for B. What it actually prints is {'A': 130, 'B': 180}. Check: if you see exactly those two numbers, the drill is ready.

Step 2: Work backward from the wrong output to the input

Strong candidates follow the data from the output back to the input; guess-and-try is the approach that gets people rejected. Start with the most obviously wrong number.

B comes out at 180, yet customer B has exactly one transaction, worth 50. The extra 130 must come from somewhere else, and 130 happens to be A’s value. Tracing upward, you find that total carries A’s whole balance over to B because it is never reset to 0 when the customer changes.

Next, A. It comes out at 130 instead of 70, off by 60, which is twice the 30 refund. A discrepancy of exactly double one value is a classic sign of a flipped sign: the code adds 30 where it should subtract it. You now have two hypotheses, both derived from the numbers rather than from a hunch.

Check: after fixing each bug, rerun and see which number has come right. Change only one thing at a time, so you know for certain which change produced which result.

Step 3: Read the whole block before you fix anything

Aced/Exponent advises reading the entire block from top to bottom before settling on a fix, because the most visible problem is not necessarily the real one. In ledger.py, many people see sorted(txns) and immediately suspect the sorting. In fact, sorting by customer is exactly what the loop needs to group records correctly.

To practice the sort-order class of bug on its own, add a function that treats txns[0] as a customer’s first transaction, then feed it data that is not in chronological order. Then ask yourself: what does this code assume the input looks like, and who guarantees that assumption holds?

Step 4: Say each hypothesis out loud

As you work, speak in a fixed pattern: “Where the output is wrong. Why I suspect it. How I will check.” Record the full 60 minutes. When you play it back, count how many times you changed code without having stated a hypothesis. Each one is a guess.

The learning round: read the docs more carefully than you think

The learning round gives you a concept or a small, unfamiliar API and asks you to build something with it. The most common reason people fail it, according to Leonstaff, is skimming the documentation and then guessing how the API behaves.

How to practice: pick a module from your language’s standard library that you have never touched. Give yourself 20 minutes just to read the documentation, then write a small script with a clear purpose. Before each function call, say aloud what you expect it to return, then run it to check.

Predict first, run second: a try with groupby

Here is a sample session with Python’s itertools.groupby, assuming you have never used it. The self-imposed task: count the transactions for each customer.

from itertools import groupby
custs = ["A", "B", "A"]
print([(k, len(list(g))) for k, g in groupby(custs)])

A skimmer sees only the name “group by” and will predict SQL-style output: [('A', 2), ('B', 1)]. Run it and you get [('A', 1), ('B', 1), ('A', 1)]. The prediction was wrong, and that is precisely the moment your mental model needs correcting.

Go back to the documentation and you will find that groupby only groups consecutive elements with the same key, so the input has to be sorted first. Change it to groupby(sorted(custs)) and you get [('A', 2), ('B', 1)]. This is also why sorted(txns) in ledger.py is not a bug.

Check after the session: you have written down at least one place where your prediction diverged from the documentation, and you can explain why. In the interview room, a single sentence such as “I assumed it grouped everything; it turns out it only groups adjacent items” shows the interviewer how you learn.

Ask few questions, at the right level

Describe how you currently understand the problem, so the interviewer can correct your mental model before you commit to an approach. Asking too many detailed questions, though, can make you look as if you need hand-holding.

Compare two questions. “Does this function return a list or a dict?” is something you could look up yourself. “My understanding is that this API processes in batches; if that’s wrong, I’ll change the design” shows the interviewer the level at which you are thinking.

Long silences are easily read as being stuck, even when you are actually thinking. If you need quiet to read, say so first: “Give me two minutes to read the authentication section.”

Common mistakes

The first is fixing the first thing that looks wrong and rerunning to see what happens. The second is changing several things at once, so that even when the result comes out right you cannot explain why.

The third, in the learning round, is filling gaps in the documentation from memory of some similar-looking library, which is exactly the SQL trap with groupby.

Where the skill pays off on a client site

Say you have just arrived at a client and they report that a summary table’s numbers are off. The pipeline was written by someone else years ago, and you have no one to ask yet. The method is the same as with ledger.py: take one specific wrong record, measure the discrepancy, trace back through each transformation step, and explain your hypothesis to the client before you change anything.

On your CV, do not just write “debugged legacy systems.” Use a structure: what the wrong output looked like, how you isolated it, and what you fixed. When reading job descriptions, phrases such as “existing systems” or “unfamiliar tools” signal that the role needs exactly the two skills these drills train.

Palantir’s interviewers do not score how fast you catch the first bug; they score how you go looking for it. That systematic way of hunting bugs is also what you need to bring when you stand in front of a client’s systems.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
5 sources
Read next on the roadmap · Stage 7: LeadershipThe FDE's second contract is hiding in the project just shippedFirecrawl measures its FDEs by adoption and expansion, not tickets closed, and the openings sit in usage logs and customers' own workarounds.