← XPeng Interview Insights

XPeng·Software Engineer·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

XPeng data engineer interview that was basically a deep dive into storage formats and distributed processing trade-offs, framed around autonomous driving infrastructure. No behavioral stuff, just pure technical back-and-forth on Spark, Parquet, Iceberg, Hive, and when to reach for MongoDB.

Questions Asked (5)

Q1

In PySpark, what is the difference between row-wise and column-wise operations, and when would you use each?

Technical Trade-offsSystem Design
Author's notes

I talked through UDFs vs native column expressions and mentioned that row-wise ops are more flexible but kill parallelism if you're not careful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining row-wise and column-wise operations in PySpark, emphasizing that row-wise operations process each row independently (e.g., using UDFs or map), while column-wise operations apply transformations across entire columns (e.g., using built-in functions or select). Then, discuss the trade-offs in terms of performance, scalability, and use cases, and provide examples of when to use each, such as row-wise for complex per-row logic and column-wise for aggregations or vectorized operations.

Pro tip: Mention that column-wise operations are generally preferred in PySpark because they leverage Catalyst optimizer and Tungsten execution engine for better performance, while row-wise operations like Python UDFs can be slower due to serialization overhead and should be used sparingly.

1. Define row-wise operations

Explain that row-wise operations process data one row at a time, often using Python UDFs, map, or foreach, and are useful for complex per-row logic that cannot be easily expressed with built-in functions.

2. Define column-wise operations

Explain that column-wise operations apply transformations to entire columns using built-in functions (e.g., select, withColumn, agg), enabling vectorized execution and optimization by Catalyst.

3. Compare performance and scalability

Highlight that column-wise operations are typically faster and more scalable due to optimizations, while row-wise operations can cause performance bottlenecks due to Python serialization and lack of optimization.

4. Discuss use cases

Provide scenarios: use row-wise for custom business logic per row (e.g., complex string parsing), and column-wise for aggregations, filtering, joins, and any operation expressible with built-in functions.

5. Summarize trade-offs

Conclude that while row-wise offers flexibility, column-wise is preferred for performance and should be used whenever possible, resorting to row-wise only when necessary.

Key Points to Mention

  • Row-wise operations process each row independently, often using Python UDFs or map, which can be slow due to serialization.
  • Column-wise operations apply to entire columns using built-in functions, leveraging Catalyst optimizer and Tungsten for performance.
  • Column-wise operations are preferred for aggregations, filtering, and transformations expressible with built-in functions.
  • Row-wise operations are useful for complex per-row logic not easily done with built-in functions, but should be minimized.
  • Performance trade-offs: row-wise can cause bottlenecks, while column-wise enables vectorized execution.
  • Examples: row-wise - parsing a complex string per row; column-wise - calculating average salary per department.

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

Q2

What is Parquet and why does it show up so often in analytical data pipelines?

Data ModelingTechnical Trade-offs
Author's notes

Columnar storage, predicate pushdown, compression.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining Parquet as a columnar storage format optimized for analytics, then explain its key features (columnar layout, compression, encoding, schema evolution) and how they enable efficient querying and storage. Finally, connect these benefits to why it's ubiquitous in analytical pipelines, especially for large-scale data processing.

Pro tip: Mention that Parquet's columnar nature allows for vectorized execution and predicate pushdown, which are crucial for modern query engines like Spark and Presto. Also, note that while Parquet is excellent for analytics, it's not ideal for transactional workloads, showing you understand trade-offs.

1. Define Parquet

State that Parquet is an open-source columnar storage format designed for efficient data storage and retrieval in analytical workloads.

2. Explain key features

Describe columnar storage, compression (e.g., Snappy, Gzip), encoding (dictionary, run-length), and schema evolution support.

3. Connect to analytical pipelines

Explain how these features enable faster queries, reduced I/O, and better compression, making Parquet ideal for big data processing frameworks like Spark, Hive, and Presto.

4. Discuss trade-offs

Acknowledge that Parquet is not suitable for transactional workloads due to lack of row-level updates, and mention alternatives like Avro or ORC for specific use cases.

Key Points to Mention

  • Columnar storage layout
  • Compression and encoding techniques
  • Schema evolution and nested data support
  • Predicate pushdown and vectorized execution
  • Integration with big data ecosystems (Spark, Hive, Presto)
  • Trade-offs vs. row-based formats (e.g., Avro, CSV)

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

Q3

When would you pick MongoDB or another NoSQL solution over a lakehouse table format like Iceberg?

Technical Trade-offsData ModelingSystem Design
Author's notes

This tripped me up a bit because I kept wanting to say 'just use Iceberg for everything' which is obviously wrong.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the choice depends on access patterns, data characteristics, and system requirements rather than technology preference. Compare NoSQL databases like MongoDB with lakehouse formats like Iceberg across dimensions such as latency, consistency, schema flexibility, and cost. Conclude with a decision framework that ties back to concrete use cases.

Pro tip: Emphasize that Iceberg is optimized for analytical scans over large datasets, while MongoDB excels at operational, low-latency, document-oriented workloads—so the decision often comes down to OLTP vs. OLAP and whether you need point reads/writes or full-table scans.

1. Clarify requirements

Identify the workload type (OLTP vs. OLAP), latency needs, data volume, and consistency requirements. This sets the context for the comparison.

2. Compare data models

Discuss how MongoDB's flexible document model suits nested, evolving data, while Iceberg's tabular format with schema evolution is better for structured, analytical data.

3. Evaluate performance and scalability

Highlight that MongoDB provides low-latency point reads/writes and horizontal scaling, whereas Iceberg is optimized for high-throughput scans and petabyte-scale analytics.

4. Consider ecosystem and operations

Mention integration with application code, transactions, and operational tooling for MongoDB, versus integration with Spark, Flink, and data lakes for Iceberg.

5. Decide with trade-offs

Summarize when to choose each: MongoDB for operational apps with flexible schemas and low latency; Iceberg for analytical workloads on data lakes with ACID guarantees.

Key Points to Mention

  • OLTP vs. OLAP workload characteristics
  • Latency and throughput requirements
  • Schema flexibility and evolution
  • Data volume and scalability patterns
  • Consistency and ACID transaction needs
  • Cost and operational complexity

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

Q4

When would Iceberg be the better choice over MongoDB or a traditional Hive table?

Technical Trade-offsData Modeling
Author's notes

Felt more comfortable here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the key differences between Iceberg, MongoDB, and Hive in terms of data model, consistency, and performance. Then, focus on scenarios where Iceberg's strengths—such as ACID transactions, schema evolution, and time travel on large-scale analytical datasets—make it the superior choice. Conclude by acknowledging that the decision depends on specific requirements like workload type, data volume, and query patterns.

Pro tip: Emphasize that Iceberg is not a replacement for databases or data warehouses but a table format that brings reliability and performance to data lakes. Mentioning real-world use cases, like handling petabyte-scale data with concurrent writes, shows practical insight.

1. Define the contenders

Briefly describe Iceberg as an open table format for huge analytic datasets, MongoDB as a document-oriented NoSQL database, and Hive as a SQL-on-Hadoop data warehouse solution.

2. Compare key characteristics

Highlight differences in data model (structured vs. semi-structured), consistency (ACID vs. eventual), and performance (OLAP vs. OLTP).

3. Identify Iceberg's strengths

Discuss Iceberg's features: ACID transactions, schema evolution, hidden partitioning, time travel, and efficient metadata handling for large-scale analytics.

4. Match to use cases

Explain when Iceberg excels: large-scale analytical workloads, data lakes with frequent schema changes, need for snapshot isolation, and interoperability with multiple compute engines.

5. Acknowledge trade-offs

Note that MongoDB is better for flexible, document-based, low-latency operational workloads, and Hive may suffice for simpler, batch-oriented processing without ACID needs.

Key Points to Mention

  • ACID transactions and snapshot isolation in Iceberg vs. Hive's lack of transactions and MongoDB's document-level atomicity.
  • Schema evolution and partition evolution capabilities in Iceberg, which are limited in Hive and handled differently in MongoDB.
  • Performance for large-scale analytical queries: Iceberg's metadata management and pruning vs. Hive's full table scans and MongoDB's indexing for point queries.
  • Time travel and rollback features in Iceberg, useful for auditing and reproducing experiments.
  • Interoperability: Iceberg works with multiple compute engines (Spark, Flink, Trino) and storage systems, while MongoDB and Hive are more tightly coupled.
  • Data volume and workload: Iceberg for petabyte-scale analytics, MongoDB for operational apps with flexible schemas, Hive for batch ETL on Hadoop.

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

Q5

Why would a company migrate from Hive tables to Iceberg, and what concrete improvements does Iceberg actually deliver?

Technical Trade-offsData ModelingSystem Design
Author's notes

Spent a while on this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the limitations of Hive tables in modern data platforms, then explain how Iceberg addresses each limitation with concrete technical features. Structure your answer around specific pain points (e.g., partition evolution, ACID, performance) and quantify improvements where possible.

Pro tip: Mention that Iceberg is not just a file format but a table format with a metadata layer, and highlight hidden partitioning and snapshot isolation as key differentiators. Also, relate it to real-world scenarios like concurrent writes and schema evolution without full rewrites.

1. Identify Hive limitations

Discuss Hive's shortcomings: inefficient partition management, lack of ACID transactions, schema evolution issues, and poor performance on large datasets due to directory-based listing.

2. Introduce Iceberg's architecture

Explain Iceberg's table format with metadata files, manifest lists, and manifests, which enable snapshot isolation, hidden partitioning, and efficient planning.

3. Map improvements to business value

Connect Iceberg features to concrete benefits: faster queries, concurrent writes, schema evolution without rewriting data, and time travel for auditing.

4. Provide examples or metrics

If possible, cite examples from experience or industry benchmarks showing performance gains, reduced storage costs, or simplified data pipelines.

5. Acknowledge trade-offs

Briefly mention potential challenges like migration effort, learning curve, or ecosystem maturity to show balanced thinking.

Key Points to Mention

  • ACID transactions and snapshot isolation for concurrent reads/writes
  • Hidden partitioning and partition evolution without data rewrite
  • Schema evolution (add, drop, rename columns) with no full table rewrite
  • Efficient metadata management for faster query planning (no directory listing)
  • Time travel and rollback capabilities for data versioning
  • Engine compatibility (Spark, Flink, Trino) and open source governance

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