Career Guide

Top 50 ServiceNow Developer Interview Questions (With Answers)

Introduction

ServiceNow developer interviews test a wide range of knowledge, from platform fundamentals to advanced scripting, integration patterns, and architectural decisions. This guide compiles the 50 questions most commonly reported by candidates across entry, mid-level, and senior developer interviews.


Section 1: Platform Fundamentals (Q1–Q10)

Q1: What is the difference between a Business Rule and a Client Script?

Business Rules run server-side in response to database operations (insert/update/delete/display). Client Scripts run in the user's browser and interact with the form UI. Business Rules are mandatory for security and data integrity; Client Scripts handle UI behavior.

Q2: What are the four Business Rule timing options?

before (runs before DB write, can modify the record), after (runs after DB write), async (runs asynchronously after the transaction), display (runs when record loads for display, used with g_scratchpad).

Q3: Explain the ACL evaluation order.

ServiceNow evaluates ACLs from most specific to least specific: table.field → table.* → *.field → . . The first matching ACL that passes grants access. Multiple matching ACLs use OR logic. No matching ACL defaults to DENY when strict mode is enabled.

Q4: What is g_scratchpad and when is it used?

g_scratchpad is a shared object between Display Business Rules (server-side) and Client Scripts (client-side). You set values on it in a Display BR, and read them in an onLoad Client Script. It avoids needing a GlideAjax call for data that's already known at page load time.

Q5: What is the difference between getValue() and getDisplayValue()?

getValue() returns the raw database value (always a string). For reference fields, it returns the sys_id. getDisplayValue() returns the human-readable label—for reference fields, it returns the display name of the referenced record.

Q6: What is coalesce in a Transform Map?

Coalesce marks a field as the "key" for upsert logic. During import, the engine searches the target table for a matching record by the coalesced field. If found, it updates; if not found, it inserts. Multiple coalesce fields must all match for an update to occur.

Q7: How does table inheritance work in ServiceNow?

ServiceNow uses single-table inheritance. Extended tables share the same database table as their parent, with records distinguished by a sys_class_name field. All columns from parent classes are available in child classes. Example: incident extends task—all task fields are available on incidents.

Q8: What is the difference between a Catalog Item and a Record Producer?

A Catalog Item creates an sc_requestsc_req_item chain and is used for service requests. A Record Producer creates records directly in any target table (incident, change, etc.) without an RITM wrapper. Record Producers are preferable when you want intake that goes directly into ITSM processes.

Q9: What does current.setAbortAction(true) do?

Used in a before Business Rule, it cancels the database operation. The record will not be saved. Use it for validation rules where you want to prevent an invalid record from being inserted or updated.

Q10: What are the stages of an incident in ServiceNow's default ITSM process?

New → In Progress → On Hold → Resolved → Closed (Canceled is also available). State transitions can be controlled by Business Rules, UI Policies, and State Flows.


Section 2: Scripting (Q11–Q20)

Q11: What is GlideAjax and when should it be used?

GlideAjax enables asynchronous server-side calls from Client Scripts. Use it when a Client Script needs data from the server (e.g., looking up a field value based on another field's selection) without a full page reload. Always use asynchronous callbacks, never synchronous calls.

Q12: Write a GlideAjax Script Include and corresponding Client Script.

Script Include:

var UserLookupAjax = Class.create();
UserLookupAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    getUserEmail: function() {
        var userId = this.getParameter('sysparm_user_id');
        var user = new GlideRecord('sys_user');
        if (user.get(userId)) {
            return user.getValue('email');
        }
        return '';
    },
    type: 'UserLookupAjax'
});

Client Script:

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || !newValue) return;
    var ga = new GlideAjax('UserLookupAjax');
    ga.addParam('sysparm_name', 'getUserEmail');
    ga.addParam('sysparm_user_id', newValue);
    ga.getXMLAnswer(function(answer) {
        g_form.setValue('u_caller_email', answer);
    });
}

Q13: What is the difference between updateMultiple() and a loop with update()?

updateMultiple() performs a single bulk database UPDATE operation—extremely fast but bypasses Business Rules, ACLs, and audit logging. Looping with update() fires Business Rules for every record but is much slower on large sets. Choose based on whether automation logic needs to execute.

Q14: How do you prevent infinite loops in Business Rules?

Use current.changes() or current.fieldName.changesTo() conditions to only fire when relevant fields actually change. You can also set a flag on a record using current.setWorkflow(false) to prevent the rule from firing on its own update, or use a session-level flag via gs.getSession().putClientData().

Q15: Explain the difference between current and previous in a Business Rule.

current represents the record's values as they will be written (for before rules) or as they were written (for after rules). previous represents the values before this update. previous is only available on update operations, not inserts.

Q16: What is a Script Include? When is it callable from client scripts?

A Script Include is a reusable server-side code library. It's callable from Client Scripts only if it extends AbstractAjaxProcessor (making it a GlideAjax Script Include). Regular Script Includes are server-only.

Q17: How do you use GlideAggregate?

GlideAggregate performs COUNT, SUM, AVG, MIN, MAX operations at the database level without loading individual records. It's far more efficient than iterating GlideRecord results for aggregate calculations.

Q18: What is gs.getProperty() used for?

It retrieves a System Property value by name. Used extensively for configuration-driven code (e.g., API endpoints, feature flags, timeout values). Use gs.setProperty() to create/update properties programmatically.

Q19: Explain Class.create() and Object.extendsObject().

Class.create() creates a new class using ServiceNow's prototype-based OOP pattern. Object.extendsObject(ParentClass.prototype, {...}) implements single inheritance, extending the parent class's methods and adding/overriding them in the child.

Q20: What is the answer variable in an ACL script?

In an ACL's Script field, setting answer = true grants access and answer = false denies it. If answer is not set, the ACL's role requirements alone determine access.


Section 3: Integration (Q21–Q30)

Q21: What is the difference between a REST Message and a Scripted REST API?

A REST Message defines an outbound API call from ServiceNow to an external system. A Scripted REST API creates a custom inbound endpoint that external systems call on ServiceNow.

Q22: What is a MID Server and when is it required?

A MID (Management Instrumentation and Discovery) Server is a Java application installed on a server within your network. It's required when ServiceNow (cloud) needs to communicate with resources on your internal network—for Discovery, JDBC connections, on-premise integrations, and agent-based monitoring.

Q23: How do you securely store API credentials for outbound integrations?

Use Credential records (sys_credentials) rather than System Properties. Credentials are encrypted at rest and can be referenced by name in REST Messages and Connection records. Never hardcode secrets in scripts.

Q24: What HTTP status codes should your Scripted REST API return?

200 (OK), 201 (Created), 204 (No Content), 400 (Bad Request/validation error), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), 500 (Internal Server Error).

Q25: What is IntegrationHub?

IntegrationHub extends Flow Designer with pre-built "spokes" (action packages) for popular external systems (Slack, Jira, AWS, Azure, etc.). It abstracts complex API calls into drag-and-drop actions in flows, requiring no scripting for common integrations.


Section 4: Flow Designer & Automation (Q26–Q35)

Q26: What is the difference between a Flow, a Subflow, and an Action in Flow Designer?

A Flow is the complete automation with a trigger and sequence of steps. A Subflow is a reusable group of steps callable from multiple flows. An Action is a single reusable step (create record, send email, call REST API).

Q27: When would you use a scheduled Flow vs. a Business Rule?

Use a scheduled Flow for time-based, batch operations (e.g., "every Monday, send SLA breach report"). Use a Business Rule for real-time operations that must fire when a record changes (e.g., "when incident is resolved, stop SLA timer").

Q28: What is a Wait condition in Flow Designer?

A Wait condition pauses flow execution until a specified condition is met or a timeout occurs. Common use: pause after creating an approval record, then branch based on whether it was approved, rejected, or timed out.

Q29: How does Flow Designer handle errors?

Flow Designer has error handling at the flow level. You can configure an error handler path that fires when an action fails. Use try/catch patterns in custom Inline Scripts within flows for fine-grained error control.

Q30: Can Flow Designer replace all legacy Workflow use cases?

Almost. Flow Designer handles the vast majority of automation use cases and is ServiceNow's recommended path. Legacy Workflow retains some specific functionality (complex multi-path parallel approvals, activity-level scripting) but all new development should use Flow Designer.


Section 5: Architecture & Performance (Q31–Q40)

Q31: What is a scoped application vs. global scope?

Global scope configurations apply to the entire instance and can access any table/API. Scoped applications are isolated namespaces with restricted access—they must explicitly request access to tables outside their scope. Scoped apps are recommended for any distributable application.

Q32: How does ServiceNow handle high availability?

Production instances run on clustered application nodes behind a load balancer with automatic failover. Databases run with replication. ServiceNow manages the infrastructure; customers don't configure HA directly.

Q33: What is an Instance Scan and what does it detect?

Instance Scan is a ServiceNow tool that analyzes your instance's configuration against best practice rules—detecting expensive queries without limits, conflicting Business Rules, deprecated API usage, security gaps, and other anti-patterns.

Q34: What causes "slow" Business Rules and how do you fix them?

Common causes: GlideRecord queries without indexes, N+1 query patterns (query inside a loop), synchronous execution of operations that could be async, and rules firing on every update when they should only fire on specific field changes. Fix with addQuery optimization, moving to async timing, and field change conditions.

Q35: Explain domain separation.

Domain Separation allows a single ServiceNow instance to serve multiple tenants (e.g., a managed service provider serving multiple clients). Each domain has isolated data, configurations, and users. Records can belong to specific domains and inherit from parent domains based on configured rules. Requires the Domain Separation plugin.


Section 6: Advanced & Scenario-Based (Q36–Q50)

Q36: A Business Rule is causing an infinite loop. How do you diagnose and fix it?

Check if the rule fires on updates and also calls update() on the same table without a condition preventing re-entry. Add a condition like current.fieldName.changesTo('targetValue'), or use current.setWorkflow(false) before update(), or set a session flag to prevent re-entry.

Q37: A customer says form load is very slow. What's your investigation approach?

  1. Enable JavaScript Debug in Settings to profile client-side time. 2. Check number and complexity of onLoad Client Scripts. 3. Check Display Business Rules. 4. Use Session Diagnostics to see server-side execution times. 5. Check for synchronous server calls in Client Scripts.

Q38: How would you design a multi-step approval process in Flow Designer?

Use sequential "Ask for Approval" actions with Wait conditions between each. For parallel approvals, use a subflow that handles multiple simultaneous approvals and returns the outcome. Include timeout branches and rejection notification paths.

Q39: How do you pass data from a Business Rule to a Client Script without a GlideAjax call?

Use g_scratchpad in a Display Business Rule. Set properties on g_scratchpad server-side, and read them in an onLoad Client Script. This is efficient because the data is included in the form's initial page load.

Q40: What is the recommended way to store configuration values in a scoped app?

Use System Properties (with the scoped app's namespace prefix) for simple values. For complex configuration, create a configuration table within the app with a single record approach. Avoid hardcoding configuration in scripts.

Q41: How do you roll back a bad Update Set commit?

ServiceNow doesn't have a native "undo commit." Options: 1) If you prepared a rollback Update Set pre-deployment, commit it. 2) Manually revert changed records if the set was small. 3) Request an instance restore from a backup (last resort, requires ServiceNow support involvement).

Q42: What is the difference between a Data Policy and a UI Policy for mandatory fields?

A UI Policy makes fields mandatory only in the browser form. A Data Policy enforces mandatory at the database level—records cannot be saved via API, imports, or any channel without the required fields. Use Data Policies for fields that must be present regardless of how the record is created.

Q43: How do you make a GlideRecord query case-insensitive?

ServiceNow's database queries are case-insensitive by default for most string fields when using addQuery() with equals or CONTAINS operators. For explicit control, use LIKE operator or leverage LOWER() in encoded queries where supported.

Q44: What is the purpose of the type property in a Script Include class?

The type property identifies the class name in stack traces and logs. It's convention in ServiceNow's prototype-based OOP pattern and aids debugging. Always match it to the Script Include's name.

Q45: How would you implement field-level encryption for sensitive data?

Use ServiceNow's Edge Encryption module for fields that should never reach ServiceNow's servers in plaintext, or use Encryption Support in the platform for encryption-at-rest within the database. Define Encrypted Fields in the Encryption Support configuration.

Q46: What is a Workflow Activity vs. a Flow Designer Action?

A Workflow Activity is the building block of legacy Workflow—run script, approval, wait, notification, etc. A Flow Designer Action is the equivalent modern concept—single-purpose, reusable, packageable into Spokes. Actions are easier to create, test, and share than custom Workflow Activities.

Q47: How do you test a Business Rule without affecting production data?

Use a PDI or sub-prod environment. For testing specific scenarios, use Background Scripts (admin-only) to simulate record changes. ATF (Automated Test Framework) provides structured unit testing with assertions.

Q48: What is a CI relationship and name three relationship types.

CI relationships describe how Configuration Items depend on or connect to each other in the CMDB. Three types: Runs on (application runs on a server), Hosted on (virtual machine hosted on physical hardware), Depends on (service depends on a database).

Q49: Explain the purpose of gs.getUser() vs. gs.getUserID().

gs.getUserID() returns the sys_id of the current user (a string). gs.getUser() returns the full GlideUser object with methods to access user properties like name, email, roles, manager, and department.

Q50: If you had to pick ONE performance optimization technique for a slow ServiceNow instance, what would it be?

Profiling Business Rules and Client Scripts using the Performance Analyzer / JavaScript Debugger to find the most expensive operations. In practice, a single poorly-written async Business Rule on the incident table that runs a full-table GlideRecord query can degrade an entire instance. Finding and fixing that one rule often has more impact than ten smaller optimizations.


Conclusion

Preparation is everything. The best candidates combine theoretical knowledge (knowing why something works) with hands-on practice (having actually built it in a PDI). Study these questions, practice in your sandbox, and enter your interview confident that you understand ServiceNow from the platform fundamentals up through enterprise architecture decisions.

Keep reading this guide

Log in to access the full study guide and supercharge your preparation.