Sum of Elements using Indices | Service Now | SSE | Feb 2024 | DSA | Reject

servicenow logo
servicenow
SDE IIRejected
March 7, 20243 reads

Summary

I interviewed for a Software Staff Engineer position at ServiceNow in February 2024. The interview focused on Data Structures & Algorithms, specifically a problem involving calculating the sum of elements within a given range, and I was unfortunately rejected.

Full Experience

I recently had an interview for the SSE role at ServiceNow in February 2024. The session primarily revolved around Data Structures & Algorithms, where I was presented with a specific coding challenge. Despite my efforts, the outcome was a rejection.

Interview Questions (1)

Q1
Range Sum Query
Data Structures & AlgorithmsMedium

Given an array of n integers and q queries. Each query is defined by a start index s and an end index e. For each query, I needed to return the sum of elements of the indices from s to e (inclusive).

Example:
a=[1,2,3,6,3,2];
q = 3
Queries:
s,e-> [2,3]
s,e-> [0,4]
s,e-> [1,2]

Expected Output Sums:
sum=[9,12,5]

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!