i
ServiceNow
Filter interviews by
I applied via Referral and was interviewed in Sep 2024. There were 2 interview rounds.
Use dynamic programming to find the longest palindromic substring in a given string.
Iterate through the string and expand around each character to find palindromes.
Store the length of the longest palindrome found so far.
Return the substring based on the start and end indices of the longest palindrome.
To serialize and deserialize a tree, use a recursive approach to traverse the tree and store the data in a suitable format.
Use pre-order traversal to serialize the tree by storing the node values in a list or string.
For deserialization, reconstruct the tree by recursively building nodes from the serialized data.
Consider using JSON or XML format for serialization to easily store and retrieve tree structure.
Use regex library to match given regex with string.
Use a regex library like re in Python to match the given regex with the string.
Check if the regex matches the string using the library functions.
Handle cases where the regex contains special characters like . and * appropriately.
Throttling is a technique used to control the rate of requests sent to a server.
Throttling helps prevent server overload by limiting the number of requests processed at a time.
Implementing a throttle function involves setting a maximum request rate and delaying excess requests.
Example: Implementing a throttle function in a web application to limit the number of API calls made to a third-party service.
Example: Throttlin...
Sort the squares of elements in a sorted array and return the sorted response.
Iterate through the array and square each element.
Store the squared values in a new array.
Sort the new array and return it.
A promise is a commitment to do something in the future, typically used for asynchronous operations in JavaScript.
Promises are used to handle asynchronous operations in JavaScript.
They represent a value that may be available now, in the future, or never.
Promises have three states: pending, fulfilled, or rejected.
Example: new Promise((resolve, reject) => { setTimeout(() => resolve('Done!'), 1000); });
Event loop is a mechanism that allows for asynchronous execution of code by managing the order of events in a single thread.
Event loop continuously checks the call stack for any functions that need to be executed, and processes them in a non-blocking manner.
Different types of queues in event loop include microtask queue (Promise callbacks), macrotask queue (setTimeout, setInterval callbacks), and animation frame queue
Virtual DOM is a lightweight copy of the actual DOM, used to improve performance by minimizing direct manipulation of the real DOM.
Virtual DOM is a concept used in frameworks like React to optimize rendering performance.
Changes are first made to the virtual DOM, which is then compared to the real DOM to identify the minimal updates needed.
This approach reduces the number of actual DOM manipulations, resulting in faster...
I was interviewed in Aug 2023.
Check if a linked list is circular by using two pointers moving at different speeds.
Initialize two pointers, slow and fast, both pointing to the head of the linked list.
Move slow pointer by one node and fast pointer by two nodes in each iteration.
If the fast pointer reaches the end of the list or meets the slow pointer, the list is circular.
ServiceNow interview questions for designations
They called me for javascript development when i was a java developer. But they took 2 rouds which went well.
Get interview-ready with Top ServiceNow Interview Questions
I was interviewed before Nov 2023.
Simple coding test - DSA questions. Questions on JS
I applied via Recruitment Consulltant and was interviewed in Apr 2022. There were 5 interview rounds.
Minimum 2 platforms required for a railway station.
At least 2 platforms are required for trains to arrive and depart simultaneously.
Additional platforms may be required based on the frequency of trains and passenger traffic.
Platforms should be long enough to accommodate the longest trains that will use the station.
Platforms should also have appropriate facilities for passengers, such as seating, shelter, and signage.
Find set of numbers from an array that can form nearest sum to the given number.
Sort the array in ascending order
Use two pointers approach to find the nearest sum
Return the set of numbers
Trapping Rain Water Problem
The problem involves calculating the amount of water trapped between bars in a histogram
The solution involves finding the maximum height of bars on both sides of each bar and subtracting the height of the bar itself
This can be done using two arrays to store the maximum height of bars on the left and right side of each bar
The problem is to find the least cost to travel from source to destination using dynamic programming.
Use dynamic programming to solve the problem
Create a 2D array to store the minimum cost to reach each cell
Fill the array using the recurrence relation: minCost[i][j] = cost[i][j] + min(minCost[i-1][j], minCost[i][j-1], minCost[i-1][j-1])
The final answer will be stored in minCost[m][n], where m and n are the coordinates ...
Level order traversal of Binary tree
Use a queue to traverse the tree level by level
Enqueue the root node and then dequeue it and enqueue its children
Repeat until the queue is empty
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
Top trending discussions
DSA round leetcode style question
2 Interview rounds
based on 24 reviews
Rating in categories
Software Engineer
395
salaries
| ₹14 L/yr - ₹45 L/yr |
Senior Software Engineer
310
salaries
| ₹16 L/yr - ₹59 L/yr |
Technical Support Engineer
114
salaries
| ₹8 L/yr - ₹24.5 L/yr |
Content Data Analyst
89
salaries
| ₹2.8 L/yr - ₹4.3 L/yr |
Staff Software Engineer
65
salaries
| ₹28 L/yr - ₹90 L/yr |
Salesforce
Oracle
SAP
Microsoft Corporation