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);
}Given a linked list where the elements are not sorted, the task is to remove duplicatesVersion 1: Without using Additional space (can compromise on Time Complexity)Version 2: Additional space can be used and can create a new listVersion 3: Additional space can be used but do not create a new listGiven a string of length N consisting of lower-case English alphabets, the task is to count the number of substrings in which the frequency of each character is exactly K.Version 1: Brute-force on all Substrings –  Version 2: Optimise a little bit –  Version 3: Super optimized approach –    where   is the number of distinct characters present in the string – viz., 26I also showed her why my approach will work, by telling her that this was the problem I improved on Geeksforgeeks earlierDiscussion about one of my projects – If I were to extend my project, what feature would I implement?The Interviewer asked me if I had any questionsI was able to solve all the problems with ease, the interviewer was quite impressed.Round 3(Technical Interview 2 – 60 Mins):Tell me about yourselfA link to Collab was shared, it contained all of my codes in the previous Technical Interview round.The following were the questions asked: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Input: digits = “23”
Output:
[“ad”,”ae”,”af”,”bd”,”be”,”bf”,”cd”,”ce”,”cf”]Version 2: You are also provided with a list of words; your task is to find how many words will be present in the output generated aboveFollow up: Can you do it in   time, where N is the number  of words and M is the maximum of the length of words., given that the length of the string digits will not exceed 15Question 2: Lowest Common Ancestor of two nodes in a TreeVersion 1: LCA of two nodes in Binary Search Tree (using the property of BST)Version 2: LCA of two nodes in Binary Tree (Using Recursion)Version 3: LCA of two nodes in N-ary Tree (Single Query)Version 4: LCA of two nodes in N-ary Tree (Multiple Queries) – Can be solved using Euler Tour + RMQDiscussion on 2 of my projects – the brief idea of why we did them, how we did them, the scope of the project etc.Do you have any questions?I was able to solve all the problems and it was a very good experience. The Interviewer helped me when I was stuck solving Version – 1 of the Key-pad problem.Round 4(HM Interview Round – 90 Minutes):Basic HR QuestionsDid you ever feel uncomfortable?What do you do when you feel uncomfortable?How did you spend time during the pandemic?Did you take the Vaccine?What do you know about the Company?Tell me something about your collegeWhen did you enjoy the best in your college?Did you ever feel uncomfortable in college?What did you do then?How do you convince a class of 60 students to attend a session? (They’ll not listen to you, they already have 75% attendance, punishing will bring chaos – How will you convince them?)Some Technical StuffTell me about your projectsTalk about the Database Schemas used in your projectsIf you want to scale your project, what would you prefer, vertical scaling or horizontal scaling, or both?System Design-based questions – Functional requirements, UI design, database schemas, load balancing, etc.Do you have any questions?Again, the interviewer was quite impressed, it was a very friendly and healthy conversation.Some key takeaways:The Interviewer is always there to help you. Always ask questions/hints whenever you’re stuck. Make sure you understand the problem statement.Practice coding problems. Hackerrank, GeeksforGeeks, and Leetcode have a good collection of problems asked in Interviews.Do a good number of interesting Projects. Projects add great value to the Resume.Never talk about your weaknesses. Never give them a reason to reject youVerdict: Selected for Associate Software Engineer RoleAttention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon. Google ,  E-Litmus and Microsoft Test Serieses.