i
ServiceNow
Filter interviews by
I applied via Company Website and was interviewed in Jun 2021. There were 5 interview rounds.
Software lifecycle phase refers to the stages of software development from conception to retirement.
Software lifecycle phases include planning, design, development, testing, deployment, and maintenance.
Each phase has specific goals and deliverables that must be met before moving on to the next phase.
For example, in the planning phase, the project scope and requirements are defined, while in the testing phase, the softw...
I applied via Referral and was interviewed in Jul 2020. There were 3 interview rounds.
Detect if two circular linked lists overlap
Traverse both lists and check if they have the same tail node
If they have different tail nodes, they do not overlap
If they have the same tail node, check if they intersect at any point
Use Floyd's cycle-finding algorithm to detect intersection point
I applied via Naukri.com and was interviewed before Oct 2019. There were 3 interview rounds.
To find the area of a triangle given coordinates, use the formula: (1/2) * base * height
Identify the coordinates of the three vertices of the triangle
Calculate the length of each side of the triangle using the distance formula
Use Heron's formula or the formula (1/2) * base * height to calculate the area
ServiceNow interview questions for popular designations
Get interview-ready with Top ServiceNow Interview Questions
Space complexity O(1), time complexity O(n)
Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time
If there is a loop, the two pointers will eventually meet at the same node
Space complexity is O(1) as only two pointers are used, time complexity is O(n) as worst case is traversing the entire list
Use Floyd's Cycle Detection Algorithm to detect a loop in a singly linked list.
Use two pointers, one moving at twice the speed of the other.
If there is a loop, the two pointers will eventually meet.
Handle boundary cases like an empty list or a list with only one node.
A microcontroller is a small computer on a single integrated circuit that contains a processor core, memory, and programmable input/output peripherals.
Microcontrollers are used in various applications such as embedded systems, robotics, and automation.
They are designed to execute specific tasks and are often used in devices that require real-time control.
Examples of microcontrollers include Arduino boards, PIC microcon
A program to convert a given number into words.
Use a switch statement or if-else conditions to handle different cases for each digit
Break down the number into individual digits and convert each digit into its corresponding word
Handle special cases like numbers between 10 and 19 separately
Consider adding support for negative numbers and decimal places if required
Internship work involves gaining practical experience in a specific field or industry.
Assisting with daily tasks and projects
Shadowing and learning from experienced professionals
Participating in meetings and presentations
Conducting research and analysis
Developing skills and knowledge relevant to the field
Networking and building professional relationships
Receiving feedback and guidance from supervisors
Completing assigne...
Count numbers between (a,b) with no consecutive ones in binary representation.
Use dynamic programming to count numbers with no consecutive ones.
Calculate count of numbers with no consecutive ones up to b and a-1.
Subtract the counts to get the final answer.
Object-oriented programming focuses on objects and their interactions, functional programming emphasizes on functions and their composition, and logic programming uses logical rules to solve problems.
Object-oriented programming uses classes and objects to encapsulate data and behavior.
Functional programming uses pure functions and immutable data to avoid side effects.
Logic programming uses logical rules and constraints...
Abstract class can have implemented methods, interface cannot. Using abstract class without implemented methods is unnecessary.
Abstract class can have constructors, fields, and implemented methods, while interface cannot.
Abstract class can be used to provide default implementations for methods that subclasses can override.
Interface is used to define a contract that implementing classes must follow.
Using abstract class ...
Yes, it is allowed. Access parent's variable using 'super' keyword.
Child class can have a variable with the same name as parent's protected variable.
Access parent's variable in child class using 'super' keyword.
Reverse is not allowed i.e. parent cannot have a public variable with the same name as child's protected variable.
Stopping conditions for detecting a loop in a singly linked list if there is no loop.
If the current node or the next node is null, then there is no loop.
If the current node is the last node in the list, then there is no loop.
If the list has only one node, then there is no loop.
To ensure at least one node is left in a circularly linked list, we can use a sentinel node.
Create a sentinel node and point it to the last node in the list.
When removing a node, check if it is the last node. If it is, remove it and point the sentinel node to the new last node.
If all nodes are removed, the sentinel node will still be present.
Example: If we have a circularly linked list with nodes A, B, and C, we can cr...
Programmatically fit small, medium, and large balls in a container to minimize wasted space.
Start by calculating the volume of the container.
Calculate the volume of each type of ball.
Use a loop to try all possible combinations of balls.
Calculate the total volume of each combination and keep track of the one with the least wasted space.
Return the combination with the least wasted space.
To reduce booting time of processor with no control on hardware, modify software by disabling unnecessary services and programs.
Disable unnecessary services and programs
Optimize startup programs
Remove malware and viruses
Update drivers and software
Defragment hard drive
Find the lighter ball among 9 balls in 2 weightings using a balance.
Divide the balls into 3 groups of 3 each.
Weigh any 2 groups against each other.
If they balance, the lighter ball is in the third group.
If they don't balance, the lighter ball is in the lighter group.
Take 2 balls from the lighter group and weigh them against each other.
If they balance, the lighter ball is the remaining one.
If they don't balance, the lig
Use binary search to find the median of two sorted arrays in O(log N) time complexity and O(1) space complexity.
Use binary search to partition both arrays into two halves
Ensure that elements on the left side of the partition are smaller than elements on the right side
Calculate the median based on the partitioned arrays
Check if two strings are anagrams by sorting and comparing them
Sort both strings and compare if they are equal
Use a hashmap to count characters in each string and compare the counts
Level order traversal of a tree using Queue
Create an empty queue and enqueue the root node
While the queue is not empty, dequeue a node and print its value
Enqueue the left and right child nodes of the dequeued node
Continue this process until the queue is empty
Reverse level order traversal of a tree using Queue
Start by pushing the root node into a queue
While the queue is not empty, dequeue a node, push its children into the queue, and add the node to a stack
Once the queue is empty, pop elements from the stack to get the reverse level order traversal
BFS and DFS are two popular graph traversal algorithms with different approaches.
BFS explores nodes level by level, while DFS explores nodes depth by depth.
BFS uses a queue data structure, while DFS uses a stack or recursion.
BFS is optimal for finding shortest paths, while DFS is more memory efficient.
Example: BFS is used in finding the shortest path in a maze, while DFS is used in topological sorting.
Recursively delete a linked list by freeing memory of each node
Create a recursive function to delete nodes one by one
Update the next pointer of each node to NULL after freeing memory
Base case should be when the current node is NULL
To recursively delete a linked list from the end, traverse to the end of the list and delete nodes one by one.
Start by recursively moving to the end of the linked list
Delete the last node and update the previous node's next pointer to null
Repeat the process until the entire linked list is deleted
Recursively deleting a tree involves deleting all nodes starting from the leaves up to the root.
Start by deleting all child nodes of a parent node before deleting the parent node itself.
Use a recursive function to traverse the tree and delete nodes in a bottom-up manner.
Ensure to properly handle memory deallocation to avoid memory leaks.
Recursively delete elements from the end of an array
Start by checking if the array is empty, if so return the array as is
If the array is not empty, recursively call the function with a smaller array each time
Base case: when the array is empty, return an empty array
Using Dijkstra's algorithm, the shortest path between 2 points in 2-D space can be found in O(log N) time.
Dijkstra's algorithm is a popular algorithm for finding the shortest path between nodes in a graph.
In a 2-D space, the points can be represented as nodes in a graph with edges connecting them.
By applying Dijkstra's algorithm to this graph, the shortest path between the 2 points can be determined efficiently.
Example...
Find median of 2 sorted arrays in O(log N) time complexity and O(1) space complexity
Use binary search to find the partition point in both arrays
Calculate the median based on the partition point and array sizes
Adjust the partition points based on the median value
Repeat until the partition points are at the median
Handle edge cases such as empty arrays and uneven array sizes
Anagram of strings in O(1) space complexity
Use a fixed size array of integers to store the frequency of characters in the first string
Iterate through the second string and decrement the frequency of each character in the array
If all the frequencies are zero, then the strings are anagrams
Return true or false accordingly
Level order traversal of a tree using Queue
Create a queue and add the root node to it
While the queue is not empty, remove the front node and print its value
Add the left and right child nodes of the removed node to the queue
Repeat until the queue is empty
Reverse level order traversal of a tree using Queue
Create a queue and push the root node into it
While the queue is not empty, pop the front node and push its children into the queue
Add the popped node to a stack
Once the queue is empty, pop elements from the stack and print them
BFS and DFS are graph traversal algorithms. BFS explores nodes level by level while DFS explores nodes depth by depth.
BFS uses a queue while DFS uses a stack or recursion.
BFS is optimal for finding shortest path while DFS is optimal for finding a path between two nodes.
BFS requires more memory as it stores all the nodes at each level while DFS requires less memory.
BFS can be used to find connected components while DFS
Find product of each element of an array except that element in O(N) time complexity without using / operation
Use prefix and suffix products
Multiply prefix and suffix products for each element to get the final product
Handle edge cases where array has 0 or 1 element separately
Recursively delete a linked list
Create a recursive function that takes the head of the linked list as input
Base case: if the head is null, return
Recursively call the function with the next node as input
Delete the current node
Recursively delete a linked list from the end.
Start from the head and recursively traverse to the end of the list.
Delete the last node and set the second last node's next pointer to null.
Repeat until the entire list is deleted.
Use a recursive function to implement the deletion process.
Recursively delete a tree by deleting all its child nodes and then the parent node.
Start from the leaf nodes and delete them first.
Then move up to the parent nodes and delete them.
Repeat until the root node is deleted.
Use post-order traversal to ensure child nodes are deleted before parent nodes.
Recursively delete elements from the end of an array.
Create a recursive function that removes the last element of the array.
Call the function recursively until the desired number of elements are removed.
Handle edge cases such as empty arrays and removing more elements than the array contains.
Floyd Warshall finds shortest path between all pairs of vertices while Djikstra finds shortest path from a single source.
Floyd Warshall is used for dense graphs while Djikstra is used for sparse graphs.
Floyd Warshall has a time complexity of O(n^3) while Djikstra has a time complexity of O((n+m)logn).
Floyd Warshall can handle negative edge weights while Djikstra cannot.
Floyd Warshall can detect negative cycles while Dj
There is no known algorithm to find shortest path in 2-D space in O(log N) time.
The best known algorithm for finding shortest path in 2-D space is Dijkstra's algorithm which has a time complexity of O(N^2).
Other algorithms like A* and Bellman-Ford have better time complexity but still not O(log N).
If the points are on a grid, Lee algorithm can be used which has a time complexity of O(N).
Design a system for putting newspapers using classes and functions
Create a Newspaper class with attributes like title, date, and content
Create a Publisher class with methods to publish and distribute newspapers
Create a Subscriber class with methods to subscribe and receive newspapers
Use inheritance to create different types of newspapers like daily, weekly, etc.
Implement a database to store newspaper information and ha
I believe practical experience is more valuable than higher studies.
I have gained valuable experience through internships and projects.
I prefer hands-on learning and problem-solving over theoretical knowledge.
I am constantly learning and improving my skills through online courses and workshops.
Top trending discussions
Some of the top questions asked at the ServiceNow interview -
The duration of ServiceNow interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 117 interviews
Interview experience
based on 382 reviews
Rating in categories
Hyderabad / Secunderabad,
Ahmedabad
5-7 Yrs
Not Disclosed
Software Engineer
414
salaries
| ₹12.9 L/yr - ₹48 L/yr |
Senior Software Engineer
344
salaries
| ₹16 L/yr - ₹65 L/yr |
Technical Support Engineer
121
salaries
| ₹8 L/yr - ₹24.5 L/yr |
Content Data Analyst
89
salaries
| ₹2.8 L/yr - ₹4.1 L/yr |
Staff Software Engineer
76
salaries
| ₹26 L/yr - ₹88.5 L/yr |
Salesforce
Oracle
SAP
Microsoft Corporation