Intuit| SDE2 | India | 2022 [Reject]

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2022-02-08Added By Anonymous
Source: Link

Company: Intuit
Role: SDE2
Interview Stage: Onsite
Location: India
Year: 2022

Original Post Content:

Online Assessment
Some basic questions and one coding question. Most efficient approach of finding whether a LinkedList is a palindrome.
Break the linked list into 2 parts, reverse the other part and compare.

Round 1

https://leetcode.com/problems/delete-nodes-and-return-forest/

Round 2

Question was easy. Find the largest substring containing non-repeating character.

I implemented it and made a class and kept this function as static.
Tested the code and was working on all test cases.

class LongestSubstring
{
public static int largestNonRepeatingSubstringLength(String s)
{
logic here
}
}

Interviewer told me that you need to make this class have a constructor and pass the input string to the constructor.

I told him that since we have just 1 function in this class and no other variables we don't need to have that approach since that would take unnecessary space in instantiating the object and having an extra string variable in the class. So I can just directly use the classname.function and pass the input string. He did not like this approach for some reason.

After this round I immediately got a rejection mail. Can someone tell me how I was wrong and why the interviewer was right.

Comments