WorksheetsServiceNow Quiz
Total questions: 51
Worksheet time: 26mins
In ServiceNow, which combination of table extension and ACL strategy could lead to a privilege escalation if not monitored, and why?
Parent table, restrictive ACLs on child only
Child table, open ACLs on parent
Separate tables, duplicate inherited ACLs
Parent table, field-level ACLs only
A Business Rule on task (when=before) updates a field based on a condition. An insert is triggered by an Import Set. Which sequence of events causes the Business Rule’s update to be lost?
UI Policy triggering after business rule
Data Source transform overwriting fields after rule execution
ACL check nullifying update mid-transaction
DOM manipulation overriding GlideRecord values
If a client-callable Script Include exposes sensitive table data, which is the strongest mitigation?
Adding field-level ACLs
Limiting to GET requests only
Adding a role check in the Script Include method
Converting it to a Background Script
Which ServiceNow API pattern is most likely to cause race conditions in asynchronous flows?
GlideRecord with synchronous queries
Multiple GlideAjax calls without callback synchronization
Using current.update() inside Display Business Rule
Accessing script includes with this operator
When a UI policy occasionally hides and requires the same field, what is the most effective triage method?
Disable all UI Policies and test individually
Use JavaScript alert debugging in the policy script
Analyze g_form events via browser dev console
Recreate the form from scratch
What’s the main risk of running a global GlideRecord query in a UI Action script on a high-volume table?
Data corruption
Thread-limiting performance degradation
Table schema lockout
Field ACL bypass
In an Import Set with a coalesce field, when do updates overwrite unintended records?
When coalesce matches partial string patterns
When coalesce is set to a non-unique column
When coalesce is tied to sys_id
When transform map uses scripted field mapping
What problem can the following script cause on production data? var gr = new GlideRecord('incident'); gr.addQuery('short_description', 'STARTSWITH', 'Error'); gr.query(); while(gr.next()) { gr.state = 3; gr.update(); }
Updates too many records unintentionally
Infinite loop
Skips ACL checks entirely
Deletes existing records
Which notification feature can leak sensitive variables to end users?
Email Scripts inside notifications
Template print statements
HTML sanitization disabled
Inline images hosting
After enabling Domain Separation, why might Business Rules ignore domain filters?
The rule runs in before-query context
The sys_domain field is missing from form
Execution scope is set to global
The rule is set to run as 'System'
What is counters() after: let counters = []; for(var i=0;i < 0; i++) { counters.push(i); }
[]
n | (n - 1) === 0
n % 2 === 0
n >> 1 === 1
Deep immutable nested object (two levels): which approach in JS?
Use Object.assign recursively
Use Object.freeze recursively
Set writable: false only on top level
Define as constant with let
Given ``, which one-liner finds numbers whose double is present?
arr.filter(x => arr.includes(2*x))
arr.map(x => x*2)
arr.filter(x => x/2 in arr)
arr.reduce((a,v)=>a+arr.includes(v*2),0)
What bug occurs in this code? let obj = {}; Object.defineProperty(obj, "a", { value: 2, writable: false }); obj.a = 3;
Run-time error thrown
Value changes unexpectedly
Value remains 2, no error
Property is deleted
Output Order ? const p = Promise.resolve(); p.then(()=>console.log(1)).then(()=>console.log(2)).then(()=>console.log(3)); console.log(4);
1 2 3 4
4 1 2 3
1 4 2 3
1 2 4 3
What is the memory difference in closures capturing primitive vs object references in an event handler?
Primitives always freed earlier
Objects may keep referenced heap memory
Both keep memory the same way
Primitives store as array, objects as link
What is a after: int a=10, b=2; a=a+++b;
12
13
11
10
What may happen if a C pointer holds the address of a local variable and is accessed after its function returns?
Segmentation fault
Memory leak
Garbage value read or crash
It always works
Predict output: char* p = "abcdef"; p[3] = 'Z'; printf("%s", p);
abZdef
Undefined behavior or crash
abcdef
Compilation error
In C++, what’s the bug if a polymorphic base class lacks virtual destructor?
Child destructor not called, memory leak
Compile-time error
Null pointer error
Base destructor called twice
Which C++ construct resolves diamond inheritance ambiguity?
override keyword
Virtual base class
Static member
Friend class
Which C code causes integer overflow only on two's complement systems?
INT_MAX + 1
0 - 1
Unsigned int overflow
Multiply by zero
Undefined behavior in this C++ code occurs on which line? int* p = new int[5]; delete[] p; p[2] = 7;
Line 1
Line 2 (delete)
Line 3 (assignment after delete)
No UB
Which C program gives segmentation fault without explicit pointer dereference?
Buffer overflow on stack array
Reading from file
Using increment operator
Printing static variable
In C++ multiple inheritance, order of constructor/destructor execution is:
Derived→Base
Left Base→Right Base→Derived (ctors); Derived→Right Base→Left Base (dtors)
Right Base→Left Base→Derived
Any order
What only causes memory leak in C, not C++?
Missing free()
Using RAII
Double delete
Stack allocation
Output of: String s1 = new String("abc"); String s2 = "abc"; System.out.println(s1==s2);
true
false
Compile error
Throws NullPointerException
How to check if a string has all unique characters with no extra data structures?
Use nested loops comparing characters
Use HashSet
Use BitSet
Use sort then check neighbors
What exception occurs with: List list = Arrays.asList(1,2,3); list.add(4);
IndexOutOfBoundsException
UnsupportedOperationException
NullPointerException
IllegalArgumentException
When was the diamond operator (<>) introduced in Java and what subtle bug can it cause?
Java 6, loss of type info in generics
Java 7, type inference ambiguity
Java 8, checked exception bypass
Java 11, no type info
What is printed here? int x = Integer.MAX_VALUE + 1; System.out.println(x);
Compile error
-2147483648
2147483647
0
Which code reverses a singly linked list in-place, no recursion?
Use iterative pointer reversal
Create new list and copy data
Use Stack
Change data, not links
What’s the bug if a HashMap key’s hashCode() and equals() are inconsistent?
Keys become unreachable
Values get overwritten
Collisions always resolved
Map resizes
Which code allows thread race on static field, and how to fix?
No synchronization; use synchronized method
Use volatile only
Immutable object solves it
Use final field
Why is this HTML structure inaccessible, and the best CSS fix? Click me
Not keyboard accessible, add tabindex and role
Needs CSS :hover
Only works in Firefox
No outer div
What happens with nested position: sticky and position: fixed in CSS?
Outer sticky positions inner fixed
Inner fixed ignores all parent positioning
Both inherit scroll context
Fixed parent disables sticky child
What color is p.special below? p { color: blue; } .special { color: red !important; } p.special { color: green; }
blue
red
green
black
Which pure CSS centers a square inside any parent?
margin: auto; position: absolute; top:0; left:0; bottom:0; right:0;
display: flex; justify-content: center; align-items: center;
float: center; width:100%;
position: fixed; top:50%; left:50%;
Which CSS pseudo-elements can be animated?
::before and ::after
::selection
:target
:first-child
CSS specificity override example: which best describes it?
Inline style is always most specific
!important with higher specificity can override inline
ID selector overrides everything
Universal selector wins
Which sentence has bad parallel structure?
She likes reading, to swim, and biking.
Reading, swimming, and biking are her favorites.
She enjoys reading and swimming.
All are correct
Replace "(understand)" with a more advanced synonym:
(a)
Which is grammatically correct?
Neither the boy nor his friends is going.
Neither the boy nor his friends are going.
Neither the boy nor his friend is going.
Neither the boys nor his friend are going.
Which sentence has incorrect gerund usage?
He enjoys singing.
She avoids to speak in public.
They admitted cheating.
I’m fond of reading.
What’s the subtle ambiguity in “Visiting relatives can be boring”?
a) Who is visiting whom is unclear
b) Tense
c) Improper passive
d) Double negative
Tense and mood in: “Had I known about the event, I would have gone”?
Past perfect, conditional
Present perfect, subjunctive
Past conditional, indicative
Past perfect, subjunctive
Fill the blank: “____ he not arrived late, we would have started earlier.”
Had
Have
If
Was
Correct noun clause usage:
I wonder who is she.
I wonder who she is.
I wonder she is who.
I wonder is who she.
Which C/C++ one-liner counts bits set to 1 without loops?
__builtin_popcount(n)
log2(n)
n&&n-1
sizeof(n)*CHAR_BIT
JavaScript: flatten all array values in an object?
Object.values(obj).flat()
Object.keys(obj)
Object.values(obj)
Array.from(obj)
Thread-safe Java singleton, lazy init, no synchronized block:
Use enum singleton
Double-checked locking with volatile
Double-checked locking with volatile
Use ThreadLocal
