AI Agents — AI Technical Interview Questions & Answers

AI Agents

AI Agents

  • An agent is anything that sees and acts: sensors in, actuators out. A thermostat, a vacuum robot, a chatbot, a trading bot. Intelligence is how well it chooses actions for its goal. PEAS describes the job: Performance, Environment, Actuators, Sensors.
  • Vacuum: dirt sensor, bump sensor; motors to move and suck; goal = clean tiles. Chatbot: text in, text out. Don’t call every Python script an agent unless it has that sense–act loop.
  • AI Agents — output: suck / turn. Percept in, action out.
sensors  →  agent  →  actuators
                │
                ▼
            environment

Technical Interview Tip: Sense–act + one PEAS sketch.

Code Examples for AI Agents

Example

# Simple agent
def vacuum(dirt, bump):
    if dirt:
        return "suck"
    if bump:
        return "turn"
    return "forward"

print(vacuum(True, False))
print(vacuum(False, True))

AI Agents — output: suck / turn. Percept in, action out.

How to Explain AI Agents to an Interviewer

What is an AI agent?

Senses and acts Has a goal Vacuum / chatbot examples

What is PEAS?

Performance Environment Actuators Sensors