Representative practice prompts
Five ServiceNow frontend interview practice questions
For each prompt, clarify the contract, explain ownership and trade-offs, implement or diagram the smallest credible slice, and test the failure cases. Each prompt links to the public report it is modelled on and to a practice page.
Prompt 1
Write polyfills for built-in methods and defend the edge cases
Implement map, then forEach or bind, without using the built-in. Handle sparse arrays, the this argument, non-function callbacks and arrays that change during iteration, and explain each decision.
Practice version modelled on a reported round: Public report: ServiceNow software engineer (UI) loop, 2025
What this measures
How the language actually behaves: prototype methods, this binding, holes in arrays, argument validation and reading a specification-shaped contract.
Clarify first
- Confirm whether holes should be skipped like the built-in does, and whether the callback receives index and array.
- Confirm whether the polyfill may be attached to the prototype or must stay a standalone function.
Strong answer should cover
- Validate the callback and throw the same error type the built-in throws.
- Iterate over own indices that exist, skip holes, and pass value, index and array to the callback with the given this value.
- Read the length once so elements appended during iteration are not visited.
- Name one edge case you chose not to cover and why, such as array-like objects.
Common miss: A for loop that visits holes as undefined and ignores the this argument, so the first follow-up question exposes the gap.
Implement Array.prototype.map (Premium) Prompt 2
Predict console output and write loop counters that prove you understand closures
Predict what a set of snippets logs, covering hoisting, timers inside loops and promise ordering. Then write functions that increment and decrement a shared variable from inside loops without leaking it to the global scope.
Practice version modelled on a reported round: Public report: ServiceNow software engineer (UI) loop, 2025
What this measures
Scope and the temporal dead zone, how closures capture variables, microtasks versus timers, and the ability to narrate execution order.
Clarify first
- Confirm whether the snippet uses var or let in the loop before predicting the timer output.
- Confirm whether the counter must expose reset or only increment and decrement.
Strong answer should cover
- Separate the synchronous pass, the microtask queue and the timer queue, and log in that order.
- Explain that var shares one binding across iterations while let creates one per iteration.
- Return an object of functions that close over a private variable, and show that the variable is unreachable from outside.
- Point out the memory implication of closures that capture large structures.
Common miss: Predicting timer output as 0, 1, 2 with var, or exposing the counter variable on a global object.
Practice the counter function Prompt 3
Implement a tiny virtual DOM renderer
Given a nested object that describes elements, attributes, event handlers and children, render it to real DOM nodes. Then describe how you would update the DOM when a new tree arrives without rebuilding everything.
Practice version modelled on a reported round: Public thread: ServiceNow staff engineer phone screen, frontend-leaning, September 2021
What this measures
Recursion over trees, the difference between attributes and properties, event binding, and a plain-language understanding of reconciliation.
Clarify first
- Confirm the tree shape: tag, props, children, and how text nodes and handlers are represented.
- Confirm whether updating is in scope or only initial rendering.
Strong answer should cover
- Create elements recursively, append children in order, and treat strings as text nodes.
- Set attributes for plain values, properties for things like value and checked, and addEventListener for handlers.
- For updates, compare trees by position and type, patch changed props, and replace subtrees whose type changed.
- Explain why keys help when children reorder, without claiming to implement a full diff.
Common miss: Using innerHTML with string concatenation, which drops handlers and opens an injection hole.
Build a DOM renderer from a nested object (Premium) Prompt 4
Design the components and data flow of a UI feature: notification panel, nested comments or autocomplete
Pick a feature such as a notification panel, a nested comment thread or an autocomplete field. Define the components, where state lives, how data flows in and out, and how the feature behaves while loading, empty, failing and under a large volume of items.
Practice version modelled on a reported round: Public thread: ServiceNow staff engineer phone screen, frontend-leaning, September 2021
What this measures
Component boundaries, state ownership, derived versus stored state, loading and empty states, debouncing, and bounded rendering of long lists.
Clarify first
- Confirm the data source and update frequency, and whether items arrive in real time.
- Confirm the largest realistic volume, such as one hundred thousand messages, before choosing a rendering strategy.
Strong answer should cover
- Draw the component tree and mark which component owns each piece of state and which only receives it.
- Show the request flow with debouncing for user input and cancellation of stale responses.
- Give every list a loading, empty and error state and say what the user sees in each.
- Virtualise long lists and keep unread counts and ordering truthful while items arrive.
Common miss: Rendering every message into the DOM and keeping state in several components at once, so counts drift and the panel stalls.
Work through the notification toast system case Prompt 5
Explain Map versus Object and other fundamentals without leaning on a framework
In a conversational round, explain the differences between Map and a plain object, how Map works internally, when you would choose each in a real application, and defend the trade-offs when the interviewer pushes back.
Practice version modelled on a reported round: Public report: ServiceNow software engineer (UI) loop, 2025
What this measures
Depth of language understanding, the ability to reason about data structures and performance without a framework, and clear trade-off communication.
Clarify first
- Ask what the keys look like and how often entries are added and removed before recommending a structure.
- Ask whether iteration order or serialisation matters for the use case.
Strong answer should cover
- Map accepts any key type, keeps insertion order, exposes size and iterates cleanly; objects have prototype keys, string and symbol keys only, and serialise to JSON directly.
- Describe Map as a hash-based structure with constant-time average operations, and note that objects with many dynamic keys can lose engine optimisations.
- Choose Map for frequent additions and removals or non-string keys, and objects for fixed-shape records and JSON payloads.
- Mention WeakMap for object-keyed caches that should not block garbage collection.
Common miss: Reciting a list of differences without being able to say which one matters for the use case in front of you.
Read the Map versus plain object answer