LearnFrenzy
Sign in Take a free test

Interview 28 min read

Agentforce Interview Questions for Python Developers (Part 2): Agentforce, Azure AI and Scenario-Based Q&A

Agentforce interview questions for Python developers (2–4 years): Apex actions, Agentforce Python SDK, Agent API, Azure AI and real scenarios, with code.

Agentforce Interview Questions for Python Developers (Part 2): Agentforce, Azure AI and Scenario-Based Q&A
On this page 11 sections
  1. What You’ll Learn
  2. Agentforce for Python Developers: Interview Roadmap
  3. Section 4: Salesforce Agentforce Interview Questions for Developers (Q20–Q34)
  4. Quick Revision: Q20–Q34
  5. Section 5: Azure AI Interview Questions: Python on Azure (Q35–Q39)
  6. Quick Revision: Q35–Q39
  7. Section 6: AI Agent Scenario-Based Questions and Problem-Solving (Q40–Q45)
  8. Quick Revision: The Whole Guide in One Table
  9. Tips to Crack Your AI Agent Developer Interview
  10. Final Thoughts
  11. Conclusion

This is Part 2 of our AI Agent Developer interview series for Python developers with 2–4 years of experience. Part 1 covered core Python, FastAPI and Generative AI. Here we move to the platform side of the job: Salesforce Agentforce, the official Agentforce Python SDK, the Agent API, Python on Azure, and the scenario-based questions that decide most interviews.

Companies increasingly want their AI agents to work directly with customer data in Salesforce, while heavy processing runs in Python services on Azure. That combination is exactly what these Agentforce interview questions test: can you design the agent, write the Apex actions, connect a Python service securely, automate deployment and keep it all running in production?

What You’ll Learn

  • Agentforce architecture: agents, topics, instructions, actions and the Atlas Reasoning Engine
  • Apex invocable actions and calling a Python service on Azure from Agentforce
  • Grounding with Data Cloud and the Einstein Trust Layer
  • The Agentforce Python SDK: authentication, creating and deploying agents, CI/CD and sending messages
  • The Agent API from Python, and testing and securing agents before go-live
  • Azure AI interview questions and AI agent scenario-based questions

Agentforce for Python Developers: Interview Roadmap

SectionQuestionsWhat the interviewer is checking
Part 1 · Sections 1–3: Python, FastAPI, Generative AIQ1–Q19Python and AI foundations
Section 4: Salesforce Agentforce for developersQ20–Q34Agentforce architecture, Apex actions, Python SDK, Agent API
Section 5: Python on AzureQ35–Q39Cloud deployment, security, monitoring
Section 6: Scenario-based and problem-solvingQ40–Q45Debugging, trade-offs, real-world judgement

Interview Preparation Tip: Agentforce questions are rarely about definitions alone. Be ready to explain why an agent picked a topic, how an action stays secure and how you would test it. Several answers here build on Part 1 (for example tool calling in Q14 and RAG in Q15), so keep Part 1 open too.

Section 4: Salesforce Agentforce Interview Questions for Developers (Q20–Q34)

Salesforce Agentforce is now a common requirement in job descriptions, even for Python roles, because companies want their AI agents to work directly with customer data in Salesforce. This part covers what developers are asked: architecture, Apex actions, integration with Python services, the Agentforce Python SDK and the Agent API. For admin-focused questions, see our Top 30 Salesforce Agentforce Interview Questions and the Agentforce Prompt Builder interview questions.

Q20 What is Salesforce Agentforce, and what are its main building blocks?

Short answer: Agentforce is Salesforce’s platform for building autonomous AI agents that understand requests, reason over Salesforce data and take actions. An agent is built from topics, instructions and actions, it is grounded in CRM and Data Cloud data, and it runs on top of the Einstein Trust Layer.

Building blockWhat it isPython developer’s view
AgentThe AI assistant: for customers (external) or employees (internal)The whole application
TopicA job the agent can do, such as “Order Support”, with a description and scopeA route or module
InstructionsPlain-language rules for a topicBusiness rules in the prompt
ActionA Flow, Apex method, prompt template or API the agent can callA tool in the tool-calling loop (Q14)
Atlas Reasoning EnginePicks the topic and actions for each requestThe planner / agent loop
Data Cloud and knowledgeUnified customer data and documents for groundingThe RAG layer
Einstein Trust LayerMasking, zero data retention, toxicity checks, audit trailSecurity and compliance layer
Customer / employee  (web chat, WhatsApp, Slack, Lightning page)
                    │
                    ▼
       ┌───────────────────────────┐
       │      Agentforce agent     │
       │  ┌─────────────────────┐  │
       │  │ Atlas Reasoning     │  │  1. understand the request
       │  │ Engine              │  │  2. pick a topic
       │  └──────────┬──────────┘  │  3. plan and run actions
       │     Topic + instructions  │
       └────┬─────────┬─────────┬──┘
            ▼         ▼         ▼
          Flow      Apex    Prompt template / API
            │         │         │
            └────┬────┴────┬────┘
                 ▼         ▼
        Salesforce data   External systems (Python on Azure)
                 │
                 ▼
  Einstein Trust Layer (masking · zero retention · toxicity · audit)
                 │
                 ▼
                LLM

Q21 How does the Atlas Reasoning Engine decide what to do?

Short answer: Atlas reads the user’s message and the conversation, classifies it into the best-matching topic using the topic descriptions, then plans which actions to run, runs them, checks the results and either asks a follow-up question or writes the final answer.

User message
     │
     ▼
Understand intent + conversation history
     │
     ▼
Classify into a TOPIC  ◀── topic names, descriptions, scope
     │
     ▼
Plan ACTIONS           ◀── action names, descriptions, inputs
     │
     ▼
Run action(s) ──▶ observe results ──▶ need more? ──yes──▶ (loop)
     │                                    │
     │                                    no
     ▼                                    ▼
Ask a clarifying question          Generate the grounded answer

This is why interviewers ask so much about descriptions: Atlas has nothing else to go on. Clear, specific, non-overlapping descriptions are the single biggest lever on agent quality.

Q22 When would you build an agent in Agentforce instead of a custom Python agent?

Choose Agentforce when…Choose a custom Python agent when…
The data and processes live mainly in SalesforceThe data lives mainly outside Salesforce
You need Salesforce security (sharing rules, FLS) on every answerYou need full control over the model, prompts and orchestration
Admins should be able to change topics and instructionsYou need a framework feature Agentforce does not offer
Channels such as Service Cloud, Slack and Experience Cloud matterThe agent runs inside your own product or on edge devices

Many real projects combine both: Agentforce is the front door for Salesforce users, and heavy processing (document analysis, scoring models) runs in a Python service on Azure that an Agentforce action calls (see Q26).

Q23 How do you write good topics and instructions?

Short answer: One topic per clear job, a description that says exactly what the topic covers, a scope that says what it does not cover, and short, testable instructions.

WeakStrong
Topic nameOrdersOrder Status and Delivery
DescriptionHelps with ordersAnswers questions about the status, tracking and delivery date of existing orders
Scope(empty)Only existing orders. Refunds and cancellations are handled by the Refunds topic.
InstructionBe helpfulIf the customer has not given an order number, ask for it before calling any action.

Rule of thumb: if two topic descriptions could both match the same customer sentence, Atlas will sometimes pick the wrong one. Rewrite until each sentence clearly belongs to one topic.

Q24 What types of actions can an Agentforce agent use?

Action typeUse it forExample
FlowDeclarative logic admins can maintainCreate a case, update a field
Apex (@InvocableMethod)Complex logic, bulk queries, calloutsCalculate a refund, call an external API
Prompt templateGenerating text grounded in record dataSummarise an account, draft an email
Standard actionsBuilt-in capabilitiesQuery records, answer questions with knowledge
External APIsSystems outside Salesforce via Named Credentials, External Services or MuleSoftCheck stock in an ERP

Q25 Write an Apex invocable action for an Agentforce agent.

Short answer: Mark a static method with @InvocableMethod and describe its inputs and outputs with @InvocableVariable. The labels and descriptions are what Atlas reads, so write them like documentation. The method must be bulk-safe: it receives a list.

public with sharing class OrderStatusAction {

    public class Request {
        @InvocableVariable(label='Order Number' description='The customer order number, for example 00012345' required=true)
        public String orderNumber;
    }

    public class Response {
        @InvocableVariable(label='Order Status' description='Current status of the order')
        public String status;
        @InvocableVariable(label='Expected Delivery' description='Expected delivery date of the order')
        public Date expectedDelivery;
    }

    @InvocableMethod(label='Get Order Status'
                     description='Returns the status and expected delivery date of an existing order by its order number')
    public static List<Response> getStatus(List<Request> requests) {
        Set<String> numbers = new Set<String>();
        for (Request r : requests) {
            numbers.add(r.orderNumber);
        }

        Map<String, Order> byNumber = new Map<String, Order>();
        for (Order o : [SELECT OrderNumber, Status, EndDate FROM Order
                        WHERE OrderNumber IN :numbers WITH USER_MODE]) {
            byNumber.put(o.OrderNumber, o);
        }

        List<Response> results = new List<Response>();
        for (Request r : requests) {
            Order o = byNumber.get(r.orderNumber);
            Response res = new Response();
            res.status = (o == null) ? 'Not found' : o.Status;
            res.expectedDelivery = (o == null) ? null : o.EndDate;
            results.add(res);
        }
        return results;
    }
}

Points interviewers look for: with sharing and WITH USER_MODE so the agent only sees what its user may see, one SOQL query for all requests (no query inside the loop), and a clear “Not found” instead of an exception.

Q26 How can an Agentforce action call a Python service running on Azure?

Short answer: Expose the Python logic as a secure REST API (for example FastAPI on Azure Container Apps), store the endpoint and authentication in a Salesforce Named Credential, and call it from an Apex invocable action. The agent then uses that Apex action like any other.

Agentforce agent
      │  chooses action "Get Account Risk Score"
      ▼
Apex @InvocableMethod
      │  callout:Risk_Service/score   (Named Credential: URL + OAuth)
      ▼
Azure API Management / Container Apps
      │
      ▼
FastAPI service (Python) ──▶ ML model / Azure OpenAI / database
      │
      ▼
JSON response ──▶ Apex ──▶ Agent ──▶ grounded answer to the user
public with sharing class RiskScoreAction {

    public class Request {
        @InvocableVariable(label='Account Id' description='Salesforce Id of the account to score' required=true)
        public Id accountId;
    }

    public class Response {
        @InvocableVariable(label='Risk Score' description='Churn risk from 0 (low) to 100 (high)')
        public Decimal riskScore;
        @InvocableVariable(label='Reason' description='Short explanation of the score')
        public String reason;
    }

    @InvocableMethod(label='Get Account Risk Score'
                     description='Returns a churn risk score from 0 to 100 and the main reason for an account')
    public static List<Response> score(List<Request> requests) {
        List<Response> results = new List<Response>();
        for (Request r : requests) {            // agents send one request at a time; callout limit is 100
            HttpRequest req = new HttpRequest();
            req.setEndpoint('callout:Risk_Service/score');
            req.setMethod('POST');
            req.setHeader('Content-Type', 'application/json');
            req.setTimeout(10000);
            req.setBody(JSON.serialize(new Map<String, Object>{ 'account_id' => r.accountId }));

            Response res = new Response();
            HttpResponse http = new Http().send(req);
            if (http.getStatusCode() == 200) {
                Map<String, Object> body = (Map<String, Object>) JSON.deserializeUntyped(http.getBody());
                res.riskScore = Decimal.valueOf(String.valueOf(body.get('score')));
                res.reason = (String) body.get('reason');
            } else {
                res.reason = 'The risk service is not available right now.';
            }
            results.add(res);
        }
        return results;
    }
}
from fastapi import Depends, FastAPI
from pydantic import BaseModel, Field

app = FastAPI(title="Risk Service")

class ScoreRequest(BaseModel):
    account_id: str = Field(min_length=15, max_length=18)

class ScoreResponse(BaseModel):
    score: float = Field(ge=0, le=100)
    reason: str

@app.post("/score", response_model=ScoreResponse, dependencies=[Depends(verify_salesforce_token)])
def score(req: ScoreRequest) -> ScoreResponse:
    features = load_features(req.account_id)        # usage, tickets, payments ...
    value, reason = model.predict_with_reason(features)
    return ScoreResponse(score=round(value, 1), reason=reason)

Mention the non-functional points: a timeout shorter than the agent’s patience, a friendly fallback message, OAuth instead of a static key, and logging the Salesforce request ID on both sides for tracing.

Q27 How do you ground an Agentforce agent in company knowledge (RAG in Agentforce)?

Short answer: Agentforce grounds answers with Salesforce data the user can access and with unstructured content such as Knowledge articles and files. Data Cloud indexes this content for semantic search, and retrievers fetch the relevant chunks at run time: the same RAG pattern as Q15, managed by the platform.

  • Structured data: records from Salesforce objects, read through actions or prompt-template merge fields.
  • Unstructured data: Knowledge articles, PDFs and web content, indexed in Data Cloud (for example through an Agentforce Data Library).
  • Retrievers: search the index and return the most relevant chunks, which prompt templates and the agent use.
  • Security: grounding respects the running user’s access, unlike a home-made RAG pipeline where you must enforce this yourself.

Q28 What is the Einstein Trust Layer, and why does it matter to developers?

Short answer: The Einstein Trust Layer is the security layer between Agentforce and the LLM. It grounds prompts in Salesforce data that the user is allowed to see, masks sensitive data, enforces zero data retention with LLM partners, checks for toxicity and keeps an audit trail.

  • Dynamic grounding: prompts are filled with real CRM data, respecting sharing rules.
  • Data masking: personal data can be masked before the prompt leaves Salesforce.
  • Zero data retention: partner LLM providers do not store or train on your prompts.
  • Toxicity detection and audit trail: responses are scored, and prompts and responses can be logged for review.

For a Python developer the key point is this: when your Python service calls Salesforce, you get these controls; when it calls an LLM directly (for example Azure OpenAI), you must build masking, logging and access control yourself.

Q29 What is the Agentforce Python SDK, and why would a Python developer use it?

Short answer: The Agentforce Python SDK (agentforce-sdk on PyPI, imported as agent_sdk) is an official Salesforce library for creating, managing and deploying Agentforce agents from Python code instead of clicking through Agent Builder. It also lets you send messages to a deployed agent.

  • Version control: agents are defined as code or JSON and reviewed in Git like any other change.
  • CI/CD: the same agent definition can be deployed to a sandbox, tested and then promoted.
  • Bulk work: generate or update many similar agents from templates.
  • Automated testing: send test messages to an agent from a Python test suite.
pip install agentforce-sdk

Know the current status: the SDK’s GitHub repository (salesforce/agent-sdk) was archived by Salesforce on 2 September 2026 and is now read-only; the latest version on PyPI is 0.2.1. Mentioning this in an interview shows that you check your dependencies. For a new project, pin the version, test it in a sandbox and confirm the recommended tooling with your Salesforce team (for example the Salesforce CLI and Agentforce DX).

Q30 How do you authenticate to Salesforce with the Agentforce Python SDK?

Short answer: The SDK provides several authentication classes in agent_sdk.core.auth. You pick one and pass it to Agentforce(auth=...). For automated pipelines, use the JWT bearer flow or client credentials, never a personal username and password.

ClassParametersWhen to use
BasicAuthusername, password, security_token, domainLocal experiments and sandbox demos
ClientCredentialsAuthconsumer_key, consumer_secret, domainServer-to-server integration with a Connected App
JwtBearerAuthusername, consumer_key, private_key_path or private_key, domainCI/CD pipelines (no password stored)
DirectAuthsession_id, instance_url, domainYou already have a valid session
import os
from agent_sdk import Agentforce
from agent_sdk.core.auth import JwtBearerAuth

auth = JwtBearerAuth(
    username=os.environ["SF_USERNAME"],
    consumer_key=os.environ["SF_CONSUMER_KEY"],
    private_key_path=os.environ["SF_PRIVATE_KEY_PATH"],
    domain="test",          # "test" = sandbox, "login" = production
)

agentforce = Agentforce(auth=auth)

Credentials always come from environment variables or a secret store such as Azure Key Vault (see Q37), never from the code.

Q31 Create and deploy an Agentforce agent with Python.

Short answer: You build the agent from Pydantic-based models (Agent, Topic, Action, Input, SystemMessage) and call agentforce.create(agent), which packages the metadata and deploys it to the org.

import os
from agent_sdk import Agentforce
from agent_sdk.core.auth import BasicAuth
from agent_sdk.exceptions import MetadataDeploymentError
from agent_sdk.models import Action, Agent, Input, SystemMessage, Topic

auth = BasicAuth(
    username=os.environ["SF_USERNAME"],
    password=os.environ["SF_PASSWORD"],
    security_token=os.environ.get("SF_SECURITY_TOKEN"),
    domain="test",
)
agentforce = Agentforce(auth=auth)

# 1. Action: what the agent can do (backed by a Flow or Apex in the org)
get_order_status = Action(
    name="Get Order Status",
    description="Returns the delivery status for a customer order number",
    inputs=[
        Input(name="order_number", description="The customer's order number",
              data_type="String", required=True),
    ],
    example_output={"status": "success", "order_status": "Shipped", "eta": "2 days"},
)

# 2. Topic: a job the agent handles, with its rules
order_support = Topic(
    name="Order Support",
    description="Answers questions about the status and delivery of existing orders",
    scope="Only order status and delivery questions. Do not handle refunds or payments.",
    instructions=[
        "Ask for the order number if the customer has not provided it.",
        "Never promise a delivery date that the action did not return.",
    ],
    actions=[get_order_status],
)

# 3. Agent
agent = Agent(
    name="Order Assistant",
    description="Helps customers track their orders",
    agent_type="External",
    company_name="LearnFrenzy Retail",
    sample_utterances=["Where is my order?", "Track order 12345"],
    system_messages=[SystemMessage(message="You are a polite, concise order support assistant.",
                                   msg_type="system")],
    topics=[order_support],
)

try:
    result = agentforce.create(agent)      # packages the metadata and deploys it
    print("Deployment result:", result)
except MetadataDeploymentError as err:
    print("Deployment failed:", err)

Interviewers often follow up with: “What makes the agent pick the right action?” The answer is the quality of the descriptions. The reasoning engine reads the topic description, scope and action descriptions to decide what to call, so vague descriptions cause wrong routing (see Q41).

Q32 How do you keep agent definitions in Git and deploy them through CI/CD?

Short answer: Store the agent as a JSON file (or a directory of JSON files) in the repository, load it with AgentUtils, and let the pipeline deploy it to a sandbox, run tests and then deploy to production.

{
  "name": "Order Assistant",
  "description": "Helps customers track their orders",
  "agent_type": "External",
  "company_name": "LearnFrenzy Retail",
  "sample_utterances": ["Where is my order?", "Track order 12345"],
  "topics": [
    {
      "name": "Order Support",
      "description": "Answers questions about the status and delivery of existing orders",
      "scope": "Only order status and delivery questions",
      "instructions": ["Ask for the order number if the customer has not provided it."],
      "actions": [
        {
          "name": "Get Order Status",
          "description": "Returns the delivery status for a customer order number",
          "inputs": [
            {"name": "order_number", "description": "The customer's order number",
             "data_type": "String", "required": true}
          ]
        }
      ]
    }
  ]
}
from agent_sdk import Agentforce, AgentUtils
from agent_sdk.core.auth import JwtBearerAuth

agent = AgentUtils.create_agent_from_file("agents/order_assistant.json")
agentforce = Agentforce(auth=JwtBearerAuth(...))   # credentials from the pipeline's secret store
agentforce.create(agent)
Developer ──▶ Pull request (agent JSON + Apex + tests)
                   │
                   ▼
       CI: validate JSON · lint Python · run unit tests
                   │
                   ▼
       Deploy to sandbox ──▶ Run golden test conversations (<a href="/blogs/ai-agent-developer-interview-questions">Q19</a>)
                   │
                   ▼
       Manual approval ──▶ Deploy to production ──▶ Monitor

A typical pipeline: pull request → validate the JSON and lint the Python → deploy to a sandbox → run the golden test conversations (Q19) → manual approval → deploy to production. The SDK can also load nested or modular directory layouts (create_agent_from_directory_structure, create_agent_from_modular_files) when one big JSON file becomes hard to review.

Q33 How do you talk to a deployed agent from Python, keeping the conversation context?

Short answer: Use send_message() with the agent’s API name. The first call returns a session_id; pass it back on the next call so the agent remembers the conversation.

response = agentforce.send_message(
    agent_name="Order_Assistant",          # the agent's API name in the org
    user_message="Hi, I want to track my order",
)
print("Agent:", response["agent_response"])
session_id = response["session_id"]

response = agentforce.send_message(
    agent_name="Order_Assistant",
    user_message="The order number is 12345",
    session_id=session_id,                 # same conversation
)
print("Agent:", response["agent_response"], "| success:", response["is_success"])

This is very useful for automated regression tests: loop over your golden dataset, send each message and compare the answers. The SDK also offers list_agents(), get_agent_by_name() and export_agent_from_salesforce(), which is handy for pulling an agent built in Agent Builder into Git.

Follow-up: what if the SDK is not an option? Any language can talk to a deployed agent through the Agent API, a REST API. You authenticate with the OAuth client credentials flow of a Connected App (or External Client App), start a session, send messages and end the session:

import os
import uuid
import requests

MY_DOMAIN = os.environ["SF_MY_DOMAIN"]          # e.g. https://learnfrenzy.my.salesforce.com
AGENT_ID = os.environ["SF_AGENT_ID"]            # the agent's 18-character ID
API = "https://api.salesforce.com/einstein/ai-agent/v1"

# 1. OAuth client credentials flow
token = requests.post(f"{MY_DOMAIN}/services/oauth2/token", data={
    "grant_type": "client_credentials",
    "client_id": os.environ["SF_CLIENT_ID"],
    "client_secret": os.environ["SF_CLIENT_SECRET"],
}, timeout=20).json()["access_token"]
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}

# 2. Start a session
session = requests.post(f"{API}/agents/{AGENT_ID}/sessions", headers=headers, json={
    "externalSessionKey": str(uuid.uuid4()),
    "instanceConfig": {"endpoint": MY_DOMAIN},
    "streamingCapabilities": {"chunkTypes": ["Text"]},
    "bypassUser": True,
}, timeout=30).json()
session_id = session["sessionId"]

# 3. Send a message (sequenceId increases with every message in the session)
reply = requests.post(f"{API}/sessions/{session_id}/messages", headers=headers, json={
    "message": {"sequenceId": 1, "type": "Text", "text": "Where is order 12345?"},
}, timeout=60).json()
for m in reply.get("messages", []):
    print(m.get("type"), ":", m.get("message"))

# 4. End the session
requests.delete(f"{API}/sessions/{session_id}", headers={**headers, "x-session-end-reason": "UserRequest"}, timeout=20)

Check the latest Agent API reference before going live: field names and limits change between releases, and the Connected App needs the right OAuth scopes.

Q34 How do you test, secure and monitor an Agentforce agent before go-live?

Short answer: Test routing and answers in bulk, give the agent the least privilege it needs, and watch real conversations after launch.

AreaWhat to do
Conversation previewIn Agent Builder, check which topic and actions were chosen for each test message and why
Testing CenterRun batches of test utterances with the expected topic, action and outcome on every change
Agent userRun the agent as a dedicated user with only the permission sets it needs
Data securitySharing rules, field-level security, with sharing and WITH USER_MODE in Apex
GuardrailsClear scope in topics, Trust Layer masking and toxicity checks, human handoff (escalation) for sensitive cases
After launchReview conversation logs, escalation rate, failed actions and user feedback weekly

Quick Revision: Q20–Q34

ConceptOne-line answer
AgentforceAgent → topics → instructions + actions, on the Einstein Trust Layer
Atlas Reasoning EngineClassifies the topic, plans actions, observes results, answers
TopicsOne job each; specific description and clear scope
Apex actions@InvocableMethod, bulk-safe, WITH USER_MODE, clear descriptions
Python integrationApex callout through a Named Credential to FastAPI on Azure
GroundingCRM data + Data Cloud search indexes and retrievers
Trust LayerMasking, zero data retention, toxicity scoring, audit trail
Python SDKagentforce-sdk: Agentforce(auth=...), create(), send_message(); repo archived Sep 2026
Agent APIREST: start session → send messages → end session
TestingTesting Center batches + golden dataset in CI
SecurityDedicated agent user, least privilege, sharing rules and FLS apply

Section 5: Azure AI Interview Questions: Python on Azure (Q35–Q39)

Q35 Where would you host a Python AI agent service on Azure?

Short answer: It depends on the traffic pattern. Event-driven, short tasks suit Azure Functions; a long-running API with streaming suits Azure Container Apps or App Service.

ServiceGood forWatch out for
Azure FunctionsEvent-driven jobs: queue messages, document ingestion, scheduled re-indexingExecution time limits and cold starts on the Consumption plan
Azure App ServiceA classic web API with simple deploymentLess control over scaling than containers
Azure Container AppsContainerised FastAPI agents, scale to zero, background workersYou manage the Docker image
Azure Kubernetes ServiceLarge platforms with many services and a platform teamOperational complexity
Users / Salesforce (Apex callouts)
           │
           ▼
Azure API Management   (auth, rate limits, versioning)
           │
           ▼
Azure Container Apps: FastAPI agent service ──▶ Azure OpenAI
           │                    │
           │                    └──────────▶ Azure AI Search (RAG)
           ▼
Azure Service Bus ──▶ Azure Functions (document ingestion)
                                │
                                ▼
                       Blob Storage ──▶ re-index

Cross-cutting: Key Vault · Managed Identity · Application Insights

A common, sensible answer: “FastAPI in Azure Container Apps for the chat API, Azure Functions with a Service Bus trigger for document ingestion.”

Q36 How do you call Azure OpenAI from Python?

Short answer: Use the official openai package with the AzureOpenAI client. The main difference from OpenAI is that you pass your Azure endpoint and API version, and model is the name of your deployment, not the model family.

import os
from openai import AzureOpenAI

client = AzureOpenAI(
    azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],   # https://<resource>.openai.azure.com/
    api_key=os.environ["AZURE_OPENAI_API_KEY"],
    api_version="2024-10-21",
)

response = client.chat.completions.create(
    model="support-gpt4o-mini",        # YOUR deployment name in Azure AI Foundry
    messages=[
        {"role": "system", "content": "You are a helpful support assistant."},
        {"role": "user", "content": "Summarise our refund policy in two lines."},
    ],
    temperature=0.2,
)
print(response.choices[0].message.content)

Interviewers like hearing why companies choose Azure OpenAI: data stays in the company’s Azure tenant and region, it works with private networking and Microsoft Entra ID, and it fits existing enterprise compliance.

Q37 How do you manage secrets for a Python app on Azure?

Short answer: Store secrets in Azure Key Vault and let the app reach it with a Managed Identity, so there is no password in code, config files or pipelines. DefaultAzureCredential uses your developer login locally and the Managed Identity in Azure, with the same code.

from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

credential = DefaultAzureCredential()
vault = SecretClient(vault_url="https://learnfrenzy-kv.vault.azure.net/", credential=credential)

salesforce_key = vault.get_secret("sf-consumer-key").value

Even better: many Azure services, including Azure OpenAI, accept Entra ID tokens directly, so you can drop API keys altogether and use role-based access control.

Q38 How do you build RAG on Azure?

Short answer: Store document chunks and their embeddings in Azure AI Search, use hybrid search (keyword plus vector) with the semantic ranker to find the best chunks, and send them to Azure OpenAI to generate the answer.

import os
from azure.core.credentials import AzureKeyCredential
from azure.search.documents import SearchClient

search = SearchClient(
    endpoint=os.environ["AZURE_SEARCH_ENDPOINT"],
    index_name="policies",
    credential=AzureKeyCredential(os.environ["AZURE_SEARCH_KEY"]),
)

results = search.search(search_text="refund for damaged item", top=5)
chunks = [doc["content"] for doc in results]
# Next: build_prompt(question, chunks) from <a href="/blogs/ai-agent-developer-interview-questions">Q15</a> and call Azure OpenAI (Q28)

For a full answer, add how the index stays fresh: an Azure Function triggered when a file lands in Blob Storage chunks it, creates embeddings and updates the index.

Q39 How do you monitor a Python AI service running on Azure?

Short answer: Send logs, traces and metrics to Application Insights (Azure Monitor) using OpenTelemetry. Track latency per step, token usage, error rates and cost, and set alerts on them.

import logging
from azure.monitor.opentelemetry import configure_azure_monitor

# Reads APPLICATIONINSIGHTS_CONNECTION_STRING from the environment
configure_azure_monitor()

logger = logging.getLogger("agent")
logger.info("llm_call", extra={"model": "support-gpt4o-mini", "tokens": 812, "latency_ms": 1430})

Beyond the usual HTTP metrics, an AI service needs its own dashboard: tokens per request, cost per day, tool failure rate, escalation rate and average conversation length.

Quick Revision: Q35–Q39

ConceptOne-line answer
HostingContainer Apps for the API, Functions for event-driven jobs
Azure OpenAIAzureOpenAI client; model = your deployment name
SecretsKey Vault + Managed Identity via DefaultAzureCredential
RAG on AzureAzure AI Search hybrid + semantic ranker, then Azure OpenAI
MonitoringApplication Insights with OpenTelemetry; track tokens, cost, latency

Section 6: AI Agent Scenario-Based Questions and Problem-Solving (Q40–Q45)

These questions decide most interviews at the 2–4 year level. There is rarely one correct answer: the interviewer wants to see a calm, structured way of thinking. Use this pattern: clarify → reproduce → isolate → fix → prevent.

Q40 Users report that the agent became slow: answers now take 12 seconds instead of 3. What do you do?

  1. Measure before guessing: check the per-step timings (Q6) or the traces in Application Insights. Which step grew: retrieval, the LLM call or a tool API?
  2. Check recent changes: a new prompt that doubled the context, a new tool, a model or region change.
  3. LLM slow? Look at prompt size (tokens in), streaming, the provider’s status page and 429 rate-limit retries hiding inside the latency.
  4. Tool slow? Add timeouts, caching for repeated lookups and run independent calls concurrently (Q1).
  5. Prevent: add a latency alert (for example p95 above 6 seconds) and a performance check to the release process.

Q41 The agent keeps choosing the wrong action. How do you fix it?

Short answer: Routing errors are almost always a description problem. The reasoning engine picks topics and actions by reading their names, descriptions, scope and instructions, so overlapping or vague text confuses it.

  • Collect the failing conversations and look at which topic and action were chosen (in Agentforce: the Agent Builder conversation preview and event logs).
  • Make descriptions specific and different: “Returns the delivery status for an existing order number” instead of “Order helper”.
  • Add clear scope boundaries: “Do not handle refunds; the Refunds topic does that.”
  • Split a topic that tries to do too much.
  • Add the failing utterances to the test set so the bug never comes back.

Q42 The monthly LLM bill tripled. How do you bring the cost down?

  • Find the source: log tokens per request, per feature and per user. Usually one feature or one bug (for example a retry loop) is responsible.
  • Trim the prompt: send the 5 best chunks instead of 20, summarise long chat history.
  • Right-size the model: use a small, cheap model for classification and routing, and a large one only for hard answers.
  • Cache: cache answers to frequent identical questions and embeddings of unchanged documents.
  • Guard rails: maximum tokens per response, maximum agent steps (Q14) and per-user rate limits.

Q43 The agent works in the sandbox but fails in production. How do you troubleshoot?

Short answer: Compare the two environments systematically, because “works in sandbox” usually means something is different, not that the code is wrong.

  • Permissions: the agent user in production may lack access to objects, fields or Apex classes. This is the most common cause in Agentforce.
  • Data: production data is bigger and messier: nulls, special characters, very long text.
  • Configuration: different Named Credentials, endpoints, API versions or missing environment variables.
  • Limits: real traffic hits rate limits, timeouts and governor limits that a quiet sandbox never reaches.
  • Logs: compare the full trace of one failing request in both environments.

Q44 A customer asks the support agent for another customer’s order details. What should happen, and how do you guarantee it?

Short answer: The agent must refuse, and the guarantee must come from code and platform security, not from the prompt. An instruction such as “never share other customers’ data” helps, but it can be bypassed; access checks cannot.

  • Identify the user (logged-in session or verified email or OTP) before any personal data is shown.
  • Every tool checks ownership: order.customer_id == current_user.id (Q18).
  • In Agentforce, the agent runs with a dedicated user whose permissions, sharing rules and field-level security limit what it can read.
  • Mask personal data in logs and prompts, and log every access for audits.

Q45 Walk me through a real AI agent project you would build for a company.

Short answer: Pick one business problem, describe the architecture end to end, and explain the trade-offs. Here is a model answer you can adapt:

“A retail company gets 8,000 support chats a day and 60% are about order status, returns and invoices. We would build an Agentforce service agent for the Salesforce Service Cloud channel with three topics: Order Status, Returns and Invoices. Order status and returns use Apex actions on Salesforce data. Invoices live in the ERP, so an Apex action calls a FastAPI service on Azure Container Apps through a Named Credential. Return policies come from Knowledge articles indexed in Data Cloud. We keep a 150-question golden dataset in Git and run it in the Testing Center before every release. After launch we track resolution rate, escalations to human agents, cost per conversation and p95 latency in Application Insights and the Agentforce analytics.”

Then say what you would measure for success (for example: 40% of chats resolved without a human in three months) and what the biggest risk is (wrong answers about refunds), with your mitigation (human approval above a refund limit).

How to answer scenario questions: think aloud, ask one or two clarifying questions, start with measurement and logs, propose a fix, then say how you would stop it from happening again. Interviewers score the process more than the final answer.

Quick Revision: The Whole Guide in One Table

TopicRemember this
async/awaitConcurrency for I/O-bound LLM and API calls; never block the event loop
GILHurts CPU-bound work; use processes for heavy parsing
PydanticValidate every LLM output before acting on it
FastAPIAsync, validation, auto docs, StreamingResponse for tokens
Tool callingThe model chooses a tool, your code runs it, loop with a step limit
RAGRetrieve your data, then generate; fix retrieval first
Prompt injectionLeast privilege and permission checks in code
AgentforceAgent → topics → instructions + actions, on the Einstein Trust Layer
Agentforce Python SDKagentforce-sdk: Agentforce(auth=...), create(), send_message(); repo archived Sep 2026
AzureContainer Apps or Functions, Key Vault + Managed Identity, AI Search, App Insights

Tips to Crack Your AI Agent Developer Interview

  • Bring one project you can explain end to end: architecture, why you chose each part, what broke and how you fixed it. Even a small personal agent works.
  • Talk about failure modes: rate limits, hallucinations, wrong tool calls and cost. This is what separates experienced developers.
  • Write clean code in live rounds: type hints, small functions, clear names and error handling matter more than clever tricks.
  • Know your numbers: latency, token counts, cost per conversation and success rate from your own projects.
  • Be honest: “I have not used that, but here is how I would approach it” beats a guessed answer every time.

Final Thoughts

If you remember only three things from this guide, make them these: validate everything an LLM produces before you act on it, enforce security in code and platform permissions rather than in prompts, and measure your agent with real test conversations. Those three habits answer half of the scenario questions you will meet.

Conclusion

AI agent development is still young, and that is good news for Python developers with 2–4 years of experience. Companies are not looking for people who have memorised every framework. They want engineers who write solid Python, understand how agents reason and call tools, keep company data safe and can debug a production problem without panic.

Work through these 45 AI Agent Developer interview questions with the code open next to you. Build a small agent with FastAPI and RAG, deploy it to Azure, then create the same agent in Agentforce with the Python SDK. After that, most interview questions will feel like describing something you have already done.

Have you faced an interesting AI agent question in a recent interview? Share it in the comments below, so we can add it to this list and help other developers prepare.

Written by

Saurabh Samir Technology & Learning Content Lead

Hey, I'm Saurabh Samir, a Software Developer and technology enthusiast with a passion for sharing knowledge on Python, JavaScript, React, Node.js, Salesforce, Agentforce, AI agents and Software Engineering. Through LearnFrenzy, I aim to simplify complex concepts, provide practical coding insights, and help developers prepare for technical interviews and grow their careers. Feel free to leave a comment below if you have any questions or feedback.

View profile

Get new articles in your inbox

One short email when we publish something new — interview questions, Salesforce guides and career tips. No spam, unsubscribe in one click.

We will email you a link to confirm. Unsubscribe any time.

Keep reading

More in Interview

Comments

Questions, corrections or your own experience — they all help the next reader.

Leave a comment

Comments are reviewed before they appear.

Search LearnFrenzy

Esc

Quick links