CoverPhoto
ServiceNow logo
Premium Employer

ServiceNow

Verified
4.1
based on 382 Reviews
Filter interviews by
Senior Software Engineer
Skills
Clear (1)

10+ ServiceNow Senior Software Engineer Interview Questions and Answers

Updated 27 Oct 2024

Q1. Explain event loop, what are different types of queues in event loop

Ans.

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 (requestAnimationFrame callbacks).

Add your answer
right arrow

Q2. Minimum number of platforms required for a railway station.

Ans.

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.

Add your answer
right arrow

Q3. Find if a given regex (containing ., * and lower case english chars) matches a given string.

Ans.

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.

Add your answer
right arrow

Q4. Find squares of elements in a sorted array and return the sorted response.

Ans.

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.

Add your answer
right arrow
Discover ServiceNow interview dos and don'ts from real experiences

Q5. Set of numbers from an array that can form nearest sum to the given number

Ans.

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

Add your answer
right arrow

Q6. Find longest palindromic substring in a given string.

Ans.

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.

Add your answer
right arrow
Are these interview questions helpful?

Q7. Explain about throttling and implement throttle function.

Ans.

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: Throttling the rate of data transfer in a network to prevent conges...read more

Add your answer
right arrow

Q8. Write a short promise example and implement your own promise

Ans.

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

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. Least cost to travel from source to destination(DP problem)

Ans.

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 of the destination

  • Example: Given a grid with costs to trav...read more

Add your answer
right arrow

Q10. How to serialize and deserialise a tree

Ans.

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.

Add your answer
right arrow

Q11. What is virtual DOM and why its faster

Ans.

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 rendering.

  • Example: React uses virtual DOM to efficiently ...read more

Add your answer
right arrow

Q12. Level order traversal of Binary tree

Ans.

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

Add your answer
right arrow

Q13. Overlapping circular linked list problem.

Ans.

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

Add your answer
right arrow

Q14. Trapping Rain water problem

Ans.

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

Add your answer
right arrow

Q15. Find if Linked list is circular

Ans.

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.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at ServiceNow Senior Software Engineer

based on 7 interviews
3 Interview rounds
Technical Round - 1
Technical Round - 2
Technical Round - 3
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Senior Software Engineer Interview Questions from Similar Companies

View all
Recently Viewed
REVIEWS
Concentrix Corporation
No Reviews
REVIEWS
Concentrix Corporation
No Reviews
REVIEWS
Concentrix Corporation
No Reviews
INTERVIEWS
ServiceNow
No Interviews
REVIEWS
Concentrix Corporation
No Reviews
REVIEWS
Concentrix Corporation
No Reviews
REVIEWS
Concentrix Corporation
No Reviews
INTERVIEWS
ServiceNow
20 top interview questions
SALARIES
Concentrix Corporation
REVIEWS
Concentrix Corporation
No Reviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter