wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ServiceNow Quiz

Total questions: 51

Worksheet time: 26mins

Name
Class
Date
1.

In ServiceNow, which combination of table extension and ACL strategy could lead to a privilege escalation if not monitored, and why?

a)

Parent table, restrictive ACLs on child only

b)

Child table, open ACLs on parent

c)

Separate tables, duplicate inherited ACLs

d)

Parent table, field-level ACLs only

2.

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?

a)

UI Policy triggering after business rule

b)

Data Source transform overwriting fields after rule execution

c)

ACL check nullifying update mid-transaction

d)

DOM manipulation overriding GlideRecord values

3.

If a client-callable Script Include exposes sensitive table data, which is the strongest mitigation?

a)

Adding field-level ACLs

b)

Limiting to GET requests only

c)

Adding a role check in the Script Include method

d)

Converting it to a Background Script

4.

Which ServiceNow API pattern is most likely to cause race conditions in asynchronous flows?

a)

GlideRecord with synchronous queries

b)

Multiple GlideAjax calls without callback synchronization

c)

Using current.update() inside Display Business Rule

d)

Accessing script includes with this operator

5.

When a UI policy occasionally hides and requires the same field, what is the most effective triage method?

a)

Disable all UI Policies and test individually

b)

Use JavaScript alert debugging in the policy script

c)

Analyze g_form events via browser dev console

d)

Recreate the form from scratch

6.

What’s the main risk of running a global GlideRecord query in a UI Action script on a high-volume table?

a)

Data corruption

b)

Thread-limiting performance degradation

c)

Table schema lockout

d)

Field ACL bypass

7.

In an Import Set with a coalesce field, when do updates overwrite unintended records?

a)

When coalesce matches partial string patterns

b)

When coalesce is set to a non-unique column

c)

When coalesce is tied to sys_id

d)

When transform map uses scripted field mapping

8.

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(); }

a)

Updates too many records unintentionally

b)

Infinite loop

c)

Skips ACL checks entirely

d)

Deletes existing records

9.

Which notification feature can leak sensitive variables to end users?

a)

Email Scripts inside notifications

b)

Template print statements

c)

HTML sanitization disabled

d)

Inline images hosting

10.

After enabling Domain Separation, why might Business Rules ignore domain filters?

a)

The rule runs in before-query context

b)

The sys_domain field is missing from form

c)

Execution scope is set to global

d)

The rule is set to run as 'System'

11.

What is counters() after: let counters = []; for(var i=0;i < 0; i++) { counters.push(i); }

a)

[]

b)

n | (n - 1) === 0

c)

n % 2 === 0

d)

n >> 1 === 1

12.

Deep immutable nested object (two levels): which approach in JS?

a)

Use Object.assign recursively

b)

Use Object.freeze recursively

c)

Set writable: false only on top level

d)

Define as constant with let

13.

Given ``, which one-liner finds numbers whose double is present?

a)

arr.filter(x => arr.includes(2*x))

b)

arr.map(x => x*2)

c)

arr.filter(x => x/2 in arr)

d)

arr.reduce((a,v)=>a+arr.includes(v*2),0)

14.

What bug occurs in this code? let obj = {}; Object.defineProperty(obj, "a", { value: 2, writable: false }); obj.a = 3;

a)

Run-time error thrown

b)

Value changes unexpectedly

c)

Value remains 2, no error

d)

Property is deleted

15.

Output Order ? const p = Promise.resolve(); p.then(()=>console.log(1)).then(()=>console.log(2)).then(()=>console.log(3)); console.log(4);

a)

1 2 3 4

b)

4 1 2 3

c)

1 4 2 3

d)

1 2 4 3

16.

What is the memory difference in closures capturing primitive vs object references in an event handler?

a)

Primitives always freed earlier

b)

Objects may keep referenced heap memory

c)

Both keep memory the same way

d)

Primitives store as array, objects as link

17.

What is a after: int a=10, b=2; a=a+++b;

a)

12

b)

13

c)

11

d)

10

18.

What may happen if a C pointer holds the address of a local variable and is accessed after its function returns?

a)

Segmentation fault

b)

Memory leak

c)

Garbage value read or crash

d)

It always works

19.

Predict output: char* p = "abcdef"; p[3] = 'Z'; printf("%s", p);

a)

abZdef

b)

Undefined behavior or crash

c)

abcdef

d)

Compilation error

20.

In C++, what’s the bug if a polymorphic base class lacks virtual destructor?

a)

Child destructor not called, memory leak

b)

Compile-time error

c)

Null pointer error

d)

Base destructor called twice

21.

Which C++ construct resolves diamond inheritance ambiguity?

a)

override keyword

b)

Virtual base class

c)

Static member

d)

Friend class

22.

Which C code causes integer overflow only on two's complement systems?

a)

INT_MAX + 1

b)

0 - 1

c)

Unsigned int overflow

d)

Multiply by zero

23.

Undefined behavior in this C++ code occurs on which line? int* p = new int[5]; delete[] p; p[2] = 7;

a)

Line 1

b)

Line 2 (delete)

c)

Line 3 (assignment after delete)

d)

No UB

24.

Which C program gives segmentation fault without explicit pointer dereference?

a)

Buffer overflow on stack array

b)

Reading from file

c)

Using increment operator

d)

Printing static variable

25.

In C++ multiple inheritance, order of constructor/destructor execution is:

a)

Derived→Base

b)

Left Base→Right Base→Derived (ctors); Derived→Right Base→Left Base (dtors)

c)

Right Base→Left Base→Derived

d)

Any order

26.

What only causes memory leak in C, not C++?

a)

Missing free()

b)

Using RAII

c)

Double delete

d)

Stack allocation

27.

Output of: String s1 = new String("abc"); String s2 = "abc"; System.out.println(s1==s2);

a)

true

b)

false

c)

Compile error

d)

Throws NullPointerException

28.

How to check if a string has all unique characters with no extra data structures?

a)

Use nested loops comparing characters

b)

Use HashSet

c)

Use BitSet

d)

Use sort then check neighbors

29.

What exception occurs with: List list = Arrays.asList(1,2,3); list.add(4);

a)

IndexOutOfBoundsException

b)

UnsupportedOperationException

c)

NullPointerException

d)

IllegalArgumentException

30.

When was the diamond operator (<>) introduced in Java and what subtle bug can it cause?

a)

Java 6, loss of type info in generics

b)

Java 7, type inference ambiguity

c)

Java 8, checked exception bypass

d)

Java 11, no type info

31.

What is printed here? int x = Integer.MAX_VALUE + 1; System.out.println(x);

a)

Compile error

b)

-2147483648

c)

2147483647

d)

0

32.

Which code reverses a singly linked list in-place, no recursion?

a)

Use iterative pointer reversal

b)

Create new list and copy data

c)

Use Stack

d)

Change data, not links

33.

What’s the bug if a HashMap key’s hashCode() and equals() are inconsistent?

a)

Keys become unreachable

b)

Values get overwritten

c)

Collisions always resolved

d)

Map resizes

34.

Which code allows thread race on static field, and how to fix?

a)

No synchronization; use synchronized method

b)

Use volatile only

c)

Immutable object solves it

d)

Use final field

35.

Why is this HTML structure inaccessible, and the best CSS fix? Click me

a)

Not keyboard accessible, add tabindex and role

b)

Needs CSS :hover

c)

Only works in Firefox

d)

No outer div

36.

What happens with nested position: sticky and position: fixed in CSS?

a)

Outer sticky positions inner fixed

b)

Inner fixed ignores all parent positioning

c)

Both inherit scroll context

d)

Fixed parent disables sticky child

37.

What color is p.special below? p { color: blue; } .special { color: red !important; } p.special { color: green; }

a)

blue

b)

red

c)

green

d)

black

38.

Which pure CSS centers a square inside any parent?

a)

margin: auto; position: absolute; top:0; left:0; bottom:0; right:0;

b)

display: flex; justify-content: center; align-items: center;

c)

float: center; width:100%;

d)

position: fixed; top:50%; left:50%;

39.

Which CSS pseudo-elements can be animated?

a)

::before and ::after

b)

::selection

c)

:target

d)

:first-child

40.

CSS specificity override example: which best describes it?

a)

Inline style is always most specific

b)

!important with higher specificity can override inline

c)

ID selector overrides everything

d)

Universal selector wins

41.

Which sentence has bad parallel structure?

a)

She likes reading, to swim, and biking.

b)

Reading, swimming, and biking are her favorites.

c)

She enjoys reading and swimming.

d)

All are correct

42.

Replace "(understand)" with a more advanced synonym:

(a)  

43.

Which is grammatically correct?

a)

Neither the boy nor his friends is going.

b)

Neither the boy nor his friends are going.

c)

Neither the boy nor his friend is going.

d)

Neither the boys nor his friend are going.

44.

Which sentence has incorrect gerund usage?

a)

He enjoys singing.

b)

She avoids to speak in public.

c)

They admitted cheating.

d)

I’m fond of reading.

45.

What’s the subtle ambiguity in “Visiting relatives can be boring”?

a)

a) Who is visiting whom is unclear

b)

b) Tense

c)

c) Improper passive

d)

d) Double negative

46.

Tense and mood in: “Had I known about the event, I would have gone”?

a)

Past perfect, conditional

b)

Present perfect, subjunctive

c)

Past conditional, indicative

d)

Past perfect, subjunctive

47.

Fill the blank: “____ he not arrived late, we would have started earlier.”

a)

Had

b)

Have

c)

If

d)

Was

48.

Correct noun clause usage:

a)

I wonder who is she.

b)

I wonder who she is.

c)

I wonder she is who.

d)

I wonder is who she.

49.

Which C/C++ one-liner counts bits set to 1 without loops?

a)

__builtin_popcount(n)

b)

log2(n)

c)

n&&n-1

d)

sizeof(n)*CHAR_BIT

50.

JavaScript: flatten all array values in an object?

a)

Object.values(obj).flat()

b)

Object.keys(obj)

c)

Object.values(obj)

d)

Array.from(obj)

51.

Thread-safe Java singleton, lazy init, no synchronized block:

a)

Use enum singleton

b)

Double-checked locking with volatile

c)

Double-checked locking with volatile

d)

Use ThreadLocal