LearnFrenzy
Sign in Take a free test

Salesforce AI & Agentforce interview · Set 3 of 3

Data Cloud and Apex for AI

  • 5 follow-up questions
  • 4 key points
  • Code examples
Test yourself

Unified data powers trustworthy AI

Data Cloud turns scattered records into unified, real-time profiles and searchable knowledge; Apex and Flow turn them into safe actions. Interviewers look for an end-to-end architecture view.

  • IngestionData streams, DLOs, DMOs and zero-copy.
  • UnificationIdentity resolution and insights.
  • RetrievalVector search and retrievers for agents.

AI is only as good as its data, which is why Data Cloud sits under Agentforce and Prompt Builder. Developer and architect interviews now ask how data gets into Data Cloud, how it becomes a unified customer profile, how unstructured content is made searchable for agents, and how to write Apex that AI features can rely on.

1. What is Salesforce Data Cloud?

Salesforce's data platform that brings together data from Salesforce orgs, websites, apps, data warehouses and other systems, harmonises it into a common data model, resolves identities into unified profiles, and makes that data available in real time to Agentforce, Prompt Builder, analytics, segmentation and automation — often without copying data, through zero-copy integrations with warehouses such as Snowflake and Databricks.


2. Explain data streams, DLOs and DMOs.

Data streams ingest data from a source. The raw data lands in Data Lake Objects (DLOs). You then map DLO fields to Data Model Objects (DMOs) — the harmonised, standard model (Individual, Contact Point Email, Sales Order and so on) that every feature uses. Good mapping is what makes data from different systems usable together.


3. What is identity resolution?

The process of matching records from different sources that belong to the same person — using match rules (exact or fuzzy name, email, phone) and reconciliation rules (which source wins for each field) — to build a unified individual profile. Agents can then see a customer's complete history, not fragments.


4. What are calculated and streaming insights?

Calculated insights are metrics computed over Data Cloud data, such as lifetime value or orders in the last 90 days. Streaming insights compute near real-time metrics over event data, such as page views in the last ten minutes. Both can trigger actions and enrich prompts and agents.


5. How do agents use unstructured data like PDFs and knowledge articles?

Data Cloud can ingest unstructured content, split it into chunks, create vector embeddings and build a search index (vector or hybrid). Retrievers query that index and pass the most relevant passages into prompt templates or agent actions — Salesforce's built-in implementation of retrieval-augmented generation (RAG).


6. What Apex practices matter for AI features?

Use with sharing and WITH USER_MODE so AI never sees data the user cannot; bulkify invocable methods; describe every invocable method and variable clearly; handle errors and return friendly messages instead of exceptions; keep callouts in Named Credentials; mind governor limits and use asynchronous Apex for long work; and write unit tests that mock callouts.

@IsTest
private class OrderStatusActionTest {
    @IsTest
    static void returnsFriendlyMessageForUnknownOrder() {
        OrderStatusAction.Request req = new OrderStatusAction.Request();
        req.orderNumber = 'DOES-NOT-EXIST';
        Test.startTest();
        List<OrderStatusAction.Result> res = OrderStatusAction.getStatus(new List<OrderStatusAction.Request>{ req });
        Test.stopTest();
        Assert.isTrue(res[0].message.contains('could not find'), 'Should explain the order was not found');
    }
}

7. How would you design a support agent grounded in Data Cloud?

Ingest cases, orders and knowledge articles into Data Cloud; resolve identities to unified customer profiles; index knowledge articles for retrieval; build Agentforce topics for order status, returns and FAQs; use Apex or Flow actions for transactions and a retriever for policy answers; add escalation to a human; and evaluate with a test set before going live on chat.


8. How do you keep AI features compliant with data-protection rules?

Collect and use only necessary data, respect consent captured in Data Cloud, apply field-level security and masking, set data retention policies, audit AI interactions, and give customers a clear way to reach a human. Align with regulations that apply to your users, such as India's DPDP Act or GDPR.


Remember

Key points

  • Map to DMOs

    Harmonised data is what features consume.

  • Unified profiles

    Identity resolution joins the fragments.

  • Retrievers = RAG

    Ground answers in your own documents.

  • User-mode Apex

    AI must respect the same security as users.

Interview drill

Follow-up questions

What the interviewer asks after your first answer. Turn on practice mode, answer each one aloud, then reveal.

  1. 1 What is zero-copy integration? Intermediate

    Querying data where it already lives (for example in Snowflake or Databricks) through federation instead of copying it into Data Cloud, which avoids duplication and stale copies.

  2. 2 What is a segment and an activation? Basic

    A segment is a group of unified profiles matching criteria; activation sends that segment to a target such as Marketing Cloud or an ad platform.

  3. 3 How do you query Data Cloud from Apex? Advanced

    Use the Data Cloud query APIs from Apex (for example the ConnectApi.CdpQuery classes) or SOQL on supported data model objects, and handle the results asynchronously where volume is high.

  4. 4 Why might retrieval return irrelevant passages? Intermediate

    Poor chunking, missing metadata filters, outdated content or vague queries. Improve chunking, filter by product or language, and test retrieval separately from generation.

  5. 5 What is the role of an architect in an Agentforce rollout? Advanced

    Defining the data foundation, security model, integration patterns, testing and monitoring approach, and the roadmap of use cases from low-risk to complex.

Preparing with friends?

Share this page with your study group or placement batch.

Search LearnFrenzy

Esc

Quick links