Courseiva
Advanced Data Manipulation →mediumMultiple Choice

UiPath-ADPv1 Advanced Data Manipulation Practice Question

A developer needs to aggregate the total sales amount per region from a DataTable named dt_Sales, which has columns Region and Amount. The result must be a new DataTable with columns Region and TotalAmount, and the workflow must minimize memory usage and execution time. Which approach is the most efficient?

⚠ Common exam trap

The trap here is assuming that looping with Filter DataTable or manual updates is acceptable for aggregation, but these methods scale poorly and are not optimized for grouping operations.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use the 'Group By' LINQ query to group rows by Region, compute the sum of Amount for each group, and then use 'CopyToDataTable' to create the result DataTable.

The correct answer uses LINQ Group By to aggregate data in one pass, which is both time and memory efficient. CopyToDataTable then creates the required DataTable. This avoids iterative filtering or manual updates, making it ideal for large datasets and ensuring minimal resource consumption.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Use the 'Group By' LINQ query to group rows by Region, compute the sum of Amount for each group, and then use 'CopyToDataTable' to create the result DataTable.

    Why this is correct

    LINQ Group By performs aggregation in a single pass over the data, and CopyToDataTable efficiently materializes the results. This avoids repeated filtering and manual loops, reducing both execution time and memory overhead. It directly produces the required columns and handles large datasets well within a single activity.

  • ✗

    Use the 'Aggregate' activity within a 'For Each Row' loop to compute the sum for each region, storing results in a Dictionary, then convert the Dictionary to a DataTable.

    Why it's wrong here

    The Aggregate activity is designed for a single collection, not for grouping. Using it inside a loop per row would recompute sums repeatedly, causing unnecessary overhead. Converting a Dictionary to a DataTable adds extra steps and memory, making this less efficient than a single LINQ query.

  • ✗

    Use 'Build Data Table' to create an empty result table, then use 'For Each Row' to manually update the total for each region by searching the result table.

    Why it's wrong here

    Manually searching the result table for each row introduces nested loops, leading to poor performance on large data. It also requires custom logic to handle new regions, which is error-prone. This approach lacks the efficiency and simplicity of a declarative LINQ grouping.

  • ✗

    Use a 'For Each Row' activity to iterate through dt_Sales, and for each unique Region, use 'Filter DataTable' to sum the Amount values.

    Why it's wrong here

    Filtering the entire DataTable for each unique region results in O(n²) complexity, which is extremely slow for large datasets. It also creates multiple intermediate DataTables, increasing memory usage. This approach is inefficient and does not leverage built-in aggregation capabilities.

About these practice questions

This UiPath-ADPv1 question is part of Courseiva's 276-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official UiPath exam blueprint

This UiPath-ADPv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADPv1 exam.