# ServiceNow Interview Experience for Associate Software Engineer (On-Campus)

Round 1(Online Coding Round – Hackerrank Platform): This round consisted of 1 Coding question and 15 Multiple choice questions. This round lasted for 60 minutes. One cannot switch between tabs during the test. Also, Webcam snapshots will be taken periodically.The Coding Question:A financial analyst is responsible for a portfolio of profitable stocks represented in an array. Each item in the array represents the yearly profit of a corresponding stock. The analyst gathers all distinct pairs of stocks that reached the target profit. Distinct pairs are pairs that differ in at least one element. Given the array of profits, find the number of distinct pairs of stocks where the sum of each pair’s profits is exactly equal to the target sum.Example:stocksProfit = [5, 7, 9, 13, 11, 6, 6, 3, 3]
target = 12 profit’s targetThere are 4 pairs of stocks that have the sum of their profits equal to the target 12. Note that because there are two instances of 3 in stocksProfit there are two pair matching (9, 3): stocksProfits indices 2 and 7, and indices 2 and 8, but only one can be included.There are 3 distinct pairs of stocks: (5, 7), (3, 9), and (6, 6) and the return value is 3.Function Description:Complete the function stockPairs in the editor below.stocksPairs has the following parameter(s):int stocksProfit[n]: an array of integers representing the stocksprofitstarget: an integer representing the yearly target profitReturns:int: the total number of pairs determinedConstraints: Solution:There are several ways to solve this problem. One of the best ways is to use Hashing. Other ways include sorting and the two-pointers technique.Round 2(Technical Interview 1 – 60 Mins):Tell me about yourselfA link to Collab workspace was shared, where two or more people can write/see codes written by others.The following were the questions askedA Small Coding snippet was given, find and correct mistakes.unsigned int i = 0;
for(i = 100; i >= 0; i–) {
printf(“%dn”, i);