Where to place feature transformations: client, serving API, or upstream service?

Tests separation of concerns in ML systems. Client causes duplication and skew; serving API couples compute to requests; dedicated service adds a network hop but centralizes logic. Red flag: ignoring training-serving skew.
What's really being asked
Whether you understand the tension between data consistency, system latency, and operational maintainability when moving feature engineering from training into production serving paths. Interviewers want to see you map technical constraints to business outcomes like release velocity and model reliability.
The full answer
Four dimensions in order. First, client-side transforms, noting they create training-serving skew when client libraries drift from training code, force duplication across mobile web and backend stacks, and complicate rolling out fixes. Second, colocated serving API transforms, which eliminate network hops and reduce RPC latency but couple CPU-heavy work to the inference hot path, making autoscaling harder and increasing tail latency under load. Third, a dedicated upstream feature service, which centralizes logic, enables reuse across multiple models, simplifies versioning and auditability, but introduces a network hop and a new failure domain. Fourth, hybrid or context-aware placement, such as putting latency-sensitive lookups in the serving API while pushing heavy aggregations to the upstream service.
The mistakes people make
Treating this as a purely latency question and ignoring consistency. Proposing client-side transforms without mentioning version drift or skew. Claiming a dedicated service is always best without acknowledging the operational burden of an extra tier. Failing to discuss what happens when training code changes and serving code lags.
What usually comes next
How would you enforce that training preprocessing exactly matches serving preprocessing? What is your strategy for versioning feature schemas when multiple models consume the same service? How do you handle A-B testing two transform implementations without duplicating infrastructure? When would you push transforms into the model graph itself, for example using TensorFlow Transform?
A concrete example
Imagine a recommendation model needing a user click sequence embedding and a real-time inventory availability join. A senior candidate places the embedding lookup in a dedicated feature store service because it is shared across three models and changes weekly, while performing the lightweight inventory join inside the serving API to avoid an extra network call for a latency-sensitive checkout flow. They keep no transforms in the mobile client beyond basic input validation.
Interview question
A recommendation system shares a heavy user embedding across three models and needs a lightweight real-time inventory join for latency-sensitive requests. Where should each transform live?
- a.Run both in a dedicated upstream service to centralize logic and versioning
- b.Run both transforms in the serving API to avoid extra network calls
- c.Run the embedding lookup in a dedicated upstream service and the inventory join in the serving APICorrect
- d.Run the embedding lookup in the client and the inventory join in the serving API to reduce server compute
Why? this is the answer
Placing the shared, heavy embedding lookup in a dedicated upstream service centralizes logic and reuse, while keeping the lightweight, latency-sensitive inventory join in the serving API avoids an extra network hop. Putting both in the serving API couples CPU-heavy work to the hot path, and using the client for embeddings risks training-serving skew and version drift.
Just read this? Test yourself on what you have been reading.
Read the original → developers.google.com
- #mlops
- #feature-engineering
- #system-design
- #production-ml
- #architecture
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on mlops — each one lists the topics its interview covers.
See open roles