InterviewLegend

Greenfield Coding: Payloads, Jobs & Extending Code

Alex Chen40 min readGuide updated
In this lesson
  • Turn a query that returns everything into one that filters, sorts and limits
  • Extend a class you were handed without breaking the calls it already serves
  • Parse a JSON payload and answer update and delete calls with clear response payloads
  • Write a cron-style job runner that handles missed runs on purpose

A backend engineer who interviewed in Mexico City in June 2025, and got an offer, sat two coding sessions plus a legacy-code maintenance interview, with a profile call, a manager behavioral and a system design around them. The coding topics they listed were Python data structures, PEP8 conventions, standard library functions and object-oriented design. That list tells you what a Zillow backend coding round rewards. Code that reads like a teammate wrote it, built from dict, list, json and sorted, organized into classes you can defend.

Greenfield Coding: Files, Records & Templates covers the half of the greenfield round where you read data and produce output. This lesson is the other half. Each problem here works inside or around structure that already exists: a query you change, a class you extend, a payload you receive and a job that runs on a clock. Each one comes from a single report, so practice the shape and expect the details to differ.

The Zillow angle
Talk about your structure while you write it. Zillow's own prep page says greenfield coding "mimics real world problems you might face on the job vs. leetcode or algorithmic questions." A December 2024 candidate had to explain their class choices out loud, and a working answer with no reasoning attached leaves points on the table.

How the Zillow greenfield coding round works

Zillow's interview prep page for software engineers lists four pieces: a STAR behavioral, system design, greenfield coding and refactoring. A March 2026 Mexico City senior candidate calls the screen live coding on "a regular production problem", and says the onsite Greenfield round repeats that format with someone from the team. Interviewers have leeway, and a few 2023 and 2024 candidates still drew classic algorithm problems, so the practical format is the default rather than a promise.

The prompts are short and open on purpose. Something like "parse this payload and add update and delete" leaves the data shape, the error cases and the class layout to you. A September 2024 principal candidate put it plainly about a similar service problem: what mattered was asking relevant questions and explaining how you were designing it. Settle the inputs and the error cases out loud, write the plain version, then run it against a case you chose.

All four problems below reward the same habit. Keep data in plain dicts and lists, put each rule in one small method, and decide what happens on the bad input before you code the good path. When the interviewer adds a requirement, that layout takes it as a few new lines.

Older problems (2024-2025)

Each of the next four comes from one candidate account between March 2024 and April 2025, newest first. None of them gave the exact wording. Every version here is something like the reported task, with a concrete spec added so you can test it.

Change a query so it filters database results

In April 2025 a Mexico City full-stack candidate took two online rounds on CodeSignal. The backend task, in their words, was "about manipulating a query to filter a database", and a backend interviewer then reviewed how they had solved it. The version below hands you a query that returns every listing and asks you to make it honour a set of filters.

1

Filter Listings With a Query

EasySometimes asked
Problem
You're given filter_listings(listings, query). Today it returns the id of every listing in table order. Each listing is a dict with id, city, price, beds and status. Every row has an id and a price, but the other fields can be missing. Change it so it returns only the ids that match query.

query is a dict whose keys are all optional. city matches regardless of case, and status must match exactly. min_price, max_price and min_beds are inclusive bounds. A row missing a field that the query filters on doesn't match. Keys you don't recognise are ignored.

Return matching ids ordered by price, lowest first, with ties broken by id. If sort is "price_desc", order by price highest first, ties still by id. If limit is present, return at most that many ids.
Inputlistings = [{"id": "z1", "city": "Seattle", "price": 650000, "beds": 2, "status": "active"}, {"id": "z2", "city": "seattle", "price": 480000, "beds": 3, "status": "pending"}, {"id": "z4", "city": "Seattle", "price": 480000, "beds": 4, "status": "active"}]query = {"city": "SEATTLE", "status": "active", "max_price": 700000}Output["z4", "z1"]

z2 is pending, so the status filter drops it. The other two are active Seattle listings under 700,000, cheapest first.

How this uses the pattern

Build a list of small check functions, one per query key that is present, and keep a row only when every check passes. Sort by id first and then by price, so the stable sort leaves ties in id order.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Filter Listings With a Query

Loading...
Click "Run" to execute your code
The Zillow angle
The reported task was a query change on CodeSignal, and the code you write here is the in-memory version of a WHERE clause plus ORDER BY and LIMIT. A reviewer checks that an absent filter means no filter, so an empty query still returns everything. They also check that a missing field fails the check instead of crashing on a KeyError. Collecting one check per present key keeps both rules in one place, and adding a new filter later is one more line.
Take it further
Push the filter into SQL. On a real table you would build the WHERE clause from the same query dict, one condition per present key, and pass the values as parameters so a city name can never inject SQL. Be ready to say which column you would index first and why: city plus price fits these filters, since most searches pin a city and then range over price.

Extend an existing codebase and explain your class choices

A December 2024 senior candidate in Mexico had a Zoom coding round where "a code is presented, and you must modify and add functionality to fulfill requirements", then explain "your class choices and preferred methods to achieve this." The code they were given wasn't described. The version below hands you a small class that stores one price per listing and asks you to add price history without breaking the two methods it already has.

2

Extend a Listing Book With Price History

MediumSometimes asked
Problem
ListingBook already exists. add(listing_id, price) stores a listing and ignores an id it has seen before. get(listing_id) returns the current price, or -1 for an unknown id. Keep both working exactly as they do now.

Add three methods. reprice(listing_id, price) sets a new current price and returns True, or returns False for an unknown id. history(listing_id) returns every price the listing has had, oldest first, or an empty list for an unknown id.

drops(percent) returns the ids, sorted, of listings whose current price sits at least percent percent below the highest price they have ever had. A listing at its peak never counts. Prices and percents are whole numbers.
  1. ListingBook()
  2. add("a1", 500000)
  3. reprice("a1", 450000)→ true
  4. get("a1")→ 450000
  5. history("a1")→ [500000,450000]

get keeps working and now returns the latest price. history keeps both.

How this uses the pattern

Give each listing its own small object that holds its price list and its peak. ListingBook keeps a dict from id to that object, and get reads the last price in the list.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Extend a Listing Book With Price History

Loading...
Click "Run" to execute your code
The Zillow angle
The reported round asked for the explanation alongside the code. A strong answer says why the change goes where it does. Replacing the single price with a Listing object that owns its history keeps ListingBook a thin index, so get and add barely change. Tracking the peak on every reprice means drops never rescans a history. Say what you left alone too. Subclassing ListingBook would leave two classes that both store prices, and adding a second dict for history next to the price dict means two places that must agree.
Take it further
Ask which callers depend on get. In a real codebase the safe move is to keep its signature and its -1 for unknown ids, even if you would design it differently today, and to say so. Then mention what you would add with more time: a timestamp on each price so drops can look at a window, such as the last 30 days, instead of all time.

Parse a JSON payload, then write update and delete methods

A Kansas City software development engineer who got an offer in May 2024 had four interviews, and says each engineer wrote their own coding problem. One of them was to "create a process to extract data from a received JSON payload. Create an update and delete method, then send data payloads back." The version below keeps that order: receive, then update and delete, each answering with a small response payload.

3

Listing Service With JSON Payloads

MediumSometimes asked
Problem
Build a ListingService. receive(payload) takes a JSON string holding an object with a listings array. Store each entry that has an id, keeping only the fields id, address, price and status, and replace any listing already stored under that id. Return how many entries were stored. If the payload isn't valid JSON or has no listings list, store nothing and return 0.

get(listing_id) returns the stored listing as a dict, or None. update(listing_id, changes) applies a dict of changes and returns a response dict. On success, ok is true and listing holds the full updated listing. For an unknown id, ok is false and error is "not found", and that check comes before any other.

If any key in changes isn't address, price or status, nothing changes and ok is false. Its error is "unknown field" plus the first such key in sorted order. delete(listing_id) removes the listing and returns ok true with its id, or ok false with the "not found" error when there's nothing to remove.
  1. ListingService()
  2. receive('{"listings": [{"id": "z1", "address": "12 Pine St", "price": 450000, "status": "active"}, {"address": "no id here", "price": 1}]}')→ 1
  3. update("z1", {"price": 435000})→ {"ok":true,"listing":{"id":"z1","address":"12 Pine St","price":435000,"status":"active"}}
  4. update("z9", {"price": 1})→ {"ok":false,"error":"not found"}

The entry without an id is skipped. The update answers with the whole listing so the caller doesn't need a second read.

How this uses the pattern

Parse with json.loads inside a try, check the shape before you trust it, and keep listings in a dict from id to a dict of allowed fields. Validate every key of an update before you write any of them.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Listing Service With JSON Payloads

Loading...
Click "Run" to execute your code
The Zillow angle
The reported prompt names three verbs and leaves the rest open, and each engineer wrote their own problem, so the design calls are yours to make and to say out loud. The ones worth naming early are what happens to bad JSON, to an entry without an id, to fields you don't store, and to an update on an id that isn't there. Returning a response dict for every outcome, instead of raising, matches "send data payloads back". It also gives the caller one shape to check.
Take it further
Partial failure in one payload. If one entry in a received payload is malformed, should the good entries still be stored? This version stores the good ones and skips the bad. Be ready to argue the other side, rejecting the whole payload so the sender can fix and resend it. Then say how you would report the skipped entries, such as a list of their positions in the response.

A small cron-style job runner for reporting

A March 2024 backend candidate in Mexico listed their loop as HR, technical, refactoring, behavioral, system design and "another code interview". In one coding round they "had to write code for a pseudo cron job used for reporting", and called it easy and low stress. The version below is something like that: report jobs that run on a fixed interval, driven by a clock you advance yourself.

4

Cron-Style Report Runner

EasyRarely asked
Problem
Build a ReportScheduler. Time is a whole number of minutes. schedule(name, every, start) registers a report that first runs at minute start and then every every minutes. Scheduling a name that already exists replaces its timing but keeps its run count.

tick(now) runs every report that is due at or before now and returns their names, ordered by due time and then by name. A report that missed several runs, because no tick came for a while, runs once and moves its next run to the first slot after now on its original grid.

cancel(name) removes a report and returns True, or False if there was nothing to cancel. A cancelled report keeps its run count. runs(name) returns how many times a report has run, 0 for an unknown name.
  1. ReportScheduler()
  2. schedule("daily_sales", 60, 0)
  3. tick(0)→ ["daily_sales"]
  4. tick(30)→ []
  5. tick(60)→ ["daily_sales"]
  6. runs("daily_sales")→ 2

It runs at minute 0, isn't due at 30, and runs again at 60.

How this uses the pattern

Keep a dict from name to [next_run, every]. On each tick, collect the due reports as (next_run, name) pairs, sort them, and move each next_run forward past now in one step.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Cron-Style Report Runner

Loading...
Click "Run" to execute your code
The Zillow angle
A reporting job is everyday backend work, which fits the practical format Zillow describes. The candidate called it easy, so the bar is clean code and clear decisions over cleverness. The decision that matters most is missed runs. If the process was down for an hour, should an hourly sales report run once or run several times to catch up? Say which you chose and why. Running once and staying on the original grid is a common default for reports, since a backlog of identical reports helps nobody.
Take it further
Many jobs and a real clock. With thousands of reports, scanning every job on every tick gets slow. Keep a min-heap of (next_run, name) so a tick pops only the due ones, and handle cancel by marking the name and skipping stale heap entries as they come up. Then talk about running the report outside the scheduler, so a slow report can't delay the next tick.

What earns points

These four share a grading pattern. The happy path is short in every one of them, so the score comes from the decisions around it. What does a missing field do to a filter? Do old callers of the class still work, what does a bad payload return, and how does a late job catch up? Name each decision before you code it, and pick one. An interviewer can disagree with a choice you explained. A choice you never noticed reads as a gap.

Run your own cases before the interviewer does. In a 2022 Zillow screen, candidate-written tests took 10 of the 50 minutes, and a 2023 intern was asked how they would test their code. After each method, call it on one normal input and one bad one, out loud, and fix what breaks.

Common questions

Does Zillow ask LeetCode questions in the coding interview?

Mostly not anymore. The format turned practical around mid-2023, and Zillow's prep page describes greenfield coding as real-world problems instead of LeetCode. Interviewers still have leeway, and a few 2023 and 2024 candidates got classic algorithm problems, so spend a little time on those too. The classic problems lessons cover the ones that have come up.

What language should I use for a Zillow backend interview?

General rounds let you pick. Python is common in Mexico backend loops, where a June 2025 candidate was asked about PEP8, the standard library and object-oriented design, and a November 2026 Mexico City backend posting names Python in its title. Use the language you write fastest, and write it the way its style guide says. Plan on no AI help unless the recruiter tells you otherwise.

How should I practice these four?

Build each from the starter with a timer running, saying your design choices out loud as you go. Then reread the "Take it further" note and talk through it without writing code: SQL for the filter, a time window for price drops, partial failure for payloads and a heap for the scheduler. Finish with the refactoring round, which turns up in loop reports from 2023 through 2026.

Key Takeaways

  • ✓Zillow greenfield problems are small backend tasks, so the score sits in the decisions around the happy path.
  • ✓When you extend existing code, keep old behaviour working and explain where your new class lives and why.
  • ✓Answer bad payloads and unknown ids with a clear response dict, and validate an update before writing any of it.
  • ✓For scheduled jobs, decide how missed runs behave and keep the schedule on its original grid.
Zillow interview guide

Know what Zillow asks before you walk in.

28 coding · 4 system design · 22 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Greenfield Coding: Files, Records & TemplatesHad your Zillow interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.