← Cognitiv Interview Insights

Cognitiv·Machine Learning Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026Remote

Summary

System design round at Cognitiv for an MLE role. The whole thing was focused on a feature store for ads/recommendation ranking, which sounds scoped until you realize they want you to cover online serving, offline training, streaming ingestion, backfills, and monitoring all in one go.

Questions Asked (5)

Q1

Design a real-time feature store for ML systems used in ads or recommendation ranking, supporting both low-latency online inference and offline training with point-in-time correctness.

System DesignData ModelingTechnical Trade-offs
Author's notes

This is the kind of question where you think you have a plan and then five minutes in you realize you've been drawing boxes without actually answering anything.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: scale, latency, consistency, and feature types. Then propose a dual-store architecture with a low-latency online store (e.g., Redis, DynamoDB) and an offline store (e.g., BigQuery, Parquet) for training, ensuring point-in-time correctness via time-travel or snapshotting. Finally, discuss trade-offs around consistency, cost, and complexity, and how to handle feature freshness and backfills.

Pro tip: Emphasize the importance of a feature registry and versioning to prevent training-serving skew, and mention how you'd handle late-arriving data and backfills without affecting online latency.

1. Clarify Requirements and Constraints

Ask about scale (QPS, feature count), latency SLAs (e.g., <10ms), consistency needs, and data sources. Understand the ML lifecycle: training frequency, real-time updates, and point-in-time correctness requirements.

2. Design the Data Model and Storage Layers

Propose a dual-store architecture: an online store optimized for low-latency reads (e.g., Redis, DynamoDB) and an offline store for batch training (e.g., data lake with Parquet). Define how features are keyed (entity ID + timestamp) and stored (time-series or snapshot).

3. Ensure Point-in-Time Correctness

Explain how to retrieve feature values as of a given timestamp for training, using techniques like time-travel tables, versioned feature values, or event sourcing. Discuss how to avoid data leakage by joining labels with features at the correct time.

4. Handle Data Ingestion and Synchronization

Describe the pipeline for streaming and batch data: how features are computed (e.g., Flink, Spark), written to both stores, and kept consistent. Address challenges like late data, backfills, and ensuring online/offline parity.

5. Discuss Trade-offs and Operational Concerns

Compare consistency models (strong vs. eventual), storage costs, and complexity. Cover monitoring, feature versioning, and how to handle failures and scaling. Mention how to evolve the system over time.

Key Points to Mention

  • Dual-store architecture: online (low-latency) and offline (batch) stores with a unified feature registry.
  • Point-in-time correctness: using timestamped feature values and time-travel queries to prevent label leakage.
  • Training-serving skew: ensuring features are computed identically in both online and offline paths, often via a shared transformation library.
  • Data ingestion: streaming (e.g., Kafka, Flink) and batch (e.g., Spark) pipelines, with backfill strategies.
  • Feature versioning and registry: to manage schema evolution and reproducibility.
  • Trade-offs: latency vs. consistency, cost of storage, and complexity of maintaining two stores.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

What APIs and abstractions should a feature store expose to its consumers?

API & IntegrationsSystem Design
Author's notes

Went with a get_features(entity_id, feature_names, timestamp) style API for online and a generate_training_dataset(entity_ids, label_timestamps, feature_names) for offline.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the consumers of the feature store (e.g., training pipelines, online serving, monitoring) and their needs. Then propose a layered API design: low-level storage abstractions, high-level feature retrieval APIs for offline and online, and metadata/management APIs. Emphasize consistency, performance, and usability across batch and real-time use cases.

Pro tip: Highlight the importance of a unified feature definition that works for both training and serving to prevent training-serving skew, and mention how abstractions like feature views and entities simplify consumer code.

1. Identify consumers and their requirements

List the main consumers: data scientists for training, ML engineers for serving, and platform teams for monitoring. Note their needs: point-in-time correctness, low-latency retrieval, and feature discovery.

2. Define core abstractions

Propose abstractions like Feature, Entity, FeatureView, and FeatureService to organize features and enable reuse. These abstractions should be consistent across offline and online stores.

3. Design offline APIs for training

Include APIs for historical feature retrieval with point-in-time correctness, such as get_historical_features(entity_df, features) that returns a training dataset. Support batch scoring and data exploration.

4. Design online APIs for serving

Provide low-latency APIs like get_online_features(entity_keys, features) for real-time inference. Ensure high availability, caching, and support for both single and batch requests.

5. Include metadata and management APIs

Add APIs for feature registration, discovery, versioning, and monitoring (e.g., list_features, get_feature_metadata). These enable governance and operational visibility.

Key Points to Mention

  • Point-in-time correctness for offline feature retrieval to avoid data leakage
  • Low-latency online serving with high throughput and availability
  • Unified feature definitions to prevent training-serving skew
  • Feature discovery and metadata management for collaboration
  • Support for both batch and real-time use cases
  • Extensibility for custom transformations and integrations with existing ML pipelines

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How would you keep online and offline feature pipelines consistent with each other?

System DesignTechnical Trade-offs
Author's notes

The classic train-serve skew problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that consistency between online and offline feature pipelines is critical to avoid training-serving skew. Then describe a unified feature engineering approach, such as a feature store, and discuss trade-offs between batch and streaming processing. Finally, highlight monitoring and validation techniques to ensure ongoing consistency.

Pro tip: Emphasize the importance of logging online features and periodically replaying them to recompute offline features, then comparing distributions to detect drift. This shows you understand production challenges beyond just architecture.

1. Define a single source of truth

Propose using a feature store or a shared feature definition repository to ensure both online and offline pipelines use identical transformation logic.

2. Unify transformation logic

Describe how to implement transformations once (e.g., using a DSL or library) and apply them in both batch and streaming contexts, avoiding code duplication.

3. Address temporal consistency

Explain how to handle time-sensitive features, such as using point-in-time correct joins for offline training and ensuring online features reflect the latest values.

4. Implement monitoring and validation

Outline a system to log online features, periodically recompute offline features, and compare them to detect inconsistencies or drift.

5. Discuss trade-offs and scalability

Acknowledge trade-offs between latency, cost, and consistency, and suggest strategies like lambda architecture or incremental processing.

Key Points to Mention

  • Feature store (e.g., Feast, Tecton) as a central component
  • Training-serving skew and its impact on model performance
  • Point-in-time correctness for offline feature generation
  • Streaming vs. batch processing and lambda architecture
  • Monitoring and alerting for feature drift and consistency
  • Backfilling and versioning of features

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How do you handle fresh streaming features, backfills for historical data, and late-arriving events?

System DesignData Modeling
Author's notes

Streaming features I had covered.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the streaming system, then describe a unified architecture that handles all three scenarios using a streaming-first approach with batch reprocessing capabilities. Emphasize how you ensure data consistency, exactly-once semantics, and timely model updates.

Pro tip: Highlight the importance of idempotent writes and event-time processing with watermarks to handle late data, and mention how you balance latency and accuracy by using a lambda or kappa architecture.

1. Clarify Requirements and Constraints

Ask about data volume, latency requirements, accuracy needs, and existing infrastructure to tailor your answer appropriately.

2. Design a Unified Streaming Architecture

Propose a streaming-first architecture (e.g., Kappa) that processes events in real-time, with the ability to replay historical data for backfills.

3. Handle Late-Arriving Events

Use event-time processing with watermarks and allowed lateness, and update results via idempotent writes to handle out-of-order data.

4. Implement Backfills for Historical Data

Leverage the same streaming pipeline to reprocess historical data by replaying from the source, ensuring consistency with real-time processing.

5. Ensure Data Consistency and Model Freshness

Employ exactly-once semantics, versioned models, and monitoring to maintain consistency and enable timely model updates.

Key Points to Mention

  • Event-time vs processing-time and watermarks for handling late data
  • Idempotent writes and exactly-once processing for consistency
  • Kappa vs Lambda architecture trade-offs
  • Backfill strategies: replaying from source vs batch reprocessing
  • Model versioning and online learning for fresh features
  • Monitoring and alerting for data quality and latency

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you scale the feature store and monitor data quality and reliability?

System DesignProduct Analytics & Metrics
Author's notes

Scaling I handled fine, partitioning by entity, tiered storage, horizontal scaling on the serving layer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements, then propose a scalable architecture for the feature store (e.g., using a distributed database like Cassandra or BigQuery) and a monitoring system for data quality (e.g., with Great Expectations) and reliability (e.g., with Prometheus and Grafana). Emphasize trade-offs, automation, and alignment with ML workflows.

Pro tip: Highlight the importance of defining SLAs for data freshness and quality, and automating alerts to catch issues before they impact models. Mention that monitoring should cover both data and model performance to close the loop.

1. Clarify Requirements

Ask about data volume, velocity, variety, and latency requirements. Understand the current pain points and future growth projections.

2. Design Scalable Feature Store

Propose a distributed architecture with separate storage for online (low-latency) and offline (batch) serving. Use technologies like Redis, Cassandra, or cloud-native solutions (BigQuery, DynamoDB). Ensure horizontal scalability and data partitioning.

3. Implement Data Quality Monitoring

Define data quality dimensions (completeness, accuracy, consistency, timeliness). Use tools like Great Expectations or Deequ to validate data at ingestion and before serving. Set up automated alerts for violations.

4. Ensure Reliability and Observability

Monitor system health (latency, throughput, error rates) with Prometheus/Grafana. Implement data lineage and versioning. Use canary deployments and rollback strategies for feature updates.

5. Iterate and Automate

Establish feedback loops from model performance to data quality. Automate retraining and feature backfills. Continuously refine based on monitoring insights.

Key Points to Mention

  • Separation of online and offline feature stores for different latency and throughput needs
  • Use of distributed databases and caching for scalability
  • Data quality dimensions and validation frameworks (e.g., Great Expectations)
  • Monitoring tools for reliability (Prometheus, Grafana) and alerting
  • Data versioning and lineage for reproducibility
  • Automation of data quality checks and model retraining pipelines

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.