Intuit interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Intuit
upvote
share-icon
4 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Medium
Coding Test - Pen and paper
Duration60 minutes
Interview date16 May 2015
Coding problem2

It comprised of general aptitude questions and two coding questions. It was an offline test.

1. N Queens

Hard
55m average time
35% success
0/120
Asked in companies
Thought WorksTwitterAdobe

You are given an integer 'N'. For a given 'N' x 'N' chessboard, find a way to place 'N' queens such that no queen can attack any other queen on the chessboard.

A queen can be killed when it lies in the same row, or same column, or the same diagonal of any of the other queens. You have to print all such configurations.

Problem approach

DFS can be used to solve this problem. The idea is to place queens in different columns one by one, starting from the leftmost column. As we cannot place 2 queens in the same column, when we place the queen in the nth column and if its valid position, dfs again starting n+1 th column and try placing the next queen in all the rows of n+1th column and find a valid position. If no valid queen row found in n+1th row, backtrack and go to nth column, and change the queen position to the next row and repeat the process.

Try solving now

2. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
AmazonOracleWalmart

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

The simple approach is to simply count the number of 0’s, 1’s, and 2’s. Then, place all 0’s at the beginning of the array followed by 1’s and 2's. The time complexity of this approach would be O(n) and space complexity O(1). 
However, the approach requires two traversals of the array. The question can also be solved in a single scan of the array by maintaining the correct order of 0’s, 1’s, and 2’s using variables. 
We divide the array into four groups using three pointers. Let us name these pointers as low, mid, and high.
1. a[0…low-1] only zeroes
2. a[low..mid-1] only ones
3. a[mid…high] unknown
4. a[high+1..n-1] only twos
Algorithm : 
1. Initialize three pointers low = 0, mid = 0 and high = n -1
2. Run a while loop until mid<=high : 
2.1 If (a[mid] ==0), then swap the element with the element low and increment low and mid (low++ and mid++).
2.2 If (a[mid] ==1), then increment mid (mid++).
2.3 If (a[mid] ==2), then swap it with an element in high range and decrement high (high--).

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date18 May 2015
Coding problem2

The interviewer started by having a look at my CV. He asked for a firm technical introduction. He asked question about my projects. As I have had my intern from a very good place, he appeared impressed from the very start. After having a technical discussion about my CV, he gave me 2 questions to code.

1. Detect the first node of the loop

Moderate
10m average time
90% success
0/80
Asked in companies
VisaAdobeFacebook

You are given a singly linked list that may or may not contain a cycle. You are supposed to return the node where the cycle begins, if a cycle exists, else return 'NULL'.


A cycle occurs when a node's next pointer returns to a previous node in the list.


Example:
In the given linked list, there is a cycle starting at position 0, hence we return 0.

Sample Example 1

Problem approach

Define two pointers slow and fast. Both point to the head node, fast is twice as fast as slow. There will be no cycle if it reaches the end. Otherwise, it will eventually catch up to the slow pointer somewhere in the cycle.
Let X be the distance from the first node to the node where the cycle begins, and let X+Y be the distance the slow pointer travels. To catch up, the fast pointer must travel 2X + 2Y. L is the cycle size. The total distance that the fast pointer has travelled over the slow pointer at the meeting point is what we call the full cycle.
X+Y+L = 2X+2Y
L=X+Y
Based on our calculation, slow pointer had already traveled one full cycle when it met fast pointer, and since it had originally travelled A before the cycle began, it had to travel A to reach the cycle's beginning! 
After the two pointers meet, fast pointer can be made to point to head. And both slow and fast pointers are moved till they meet at a node. The node at which both the pointers meet is the beginning of the loop.
Pseudocode :

detectCycle(Node *head) {
Node *slow=head,*fast=head;
while(slow!=NULL && fast!=NULL && fast->next!=NULL) {
slow = slow->next; 
fast = fast->next->next; 
if(slow==fast) 
{
fast = head;
while(slow!=fast) 

slow = slow->next;
fast=fast->next;
}
return slow;
}
}
return NULL; 
}

Try solving now

2. Check if the Word is present in Sentence or not

Easy
15m average time
90% success
0/40
Asked in companies
AmazonWalmartIntuit

You have been given a sentence ‘S’ in the form of a string and a word ‘W’, you need to find whether the word is present in the given sentence or not. The word must be present as a complete string in the sentence and not a substring of some other word.

Note:

1. All the characters in the string and the word are in lowercase.
2. Length of the sentences and the words will always be greater than zero.
3. Words in the sentence will be separated by spaces.
Problem approach

The brute force solution is to check for every index in the string whether the sub-string can be formed at that index or not. To implement this, run a nested loop traversing the given string and check for sub-string from every index in the inner loop. 
Time Complexity : O(n^2)
The solution can be optimised by using KMP Algorithm. The KMP matching algorithm uses degenerating property (pattern having same sub-patterns appearing more than once in the pattern) of the pattern. The basic idea behind KMP algorithm is: whenever we detect a mismatch (after some matches), we already know some of the characters in the text of the next window. 

Pseudocode:

Find Prefix:
Begin
length := 0
prefArray[0] := 0

for all character index i of pattern, do
if pattern[i] = pattern[length], then
increase length by 1
prefArray[i] := length
else
if length !=0 then
length := prefArray[length - 1]
decrease i by 1
else
prefArray[i] := 0
done
End

KMP Algorithm:
Begin
n := size of text
m := size of pattern
call findPrefix(pattern, m, prefArray)

while i < n, do
if text[i] = pattern[j], then
increase i and j by 1
if j = m, then
print the location (i-j) as there is the pattern
j := prefArray[j-1]
else if i < n AND pattern[j] != text[i] then
if j != 0 then
j := prefArray[j - 1]
else
increase i by 1
done
End

Try solving now
03
Round
Easy
Face to Face
Duration60 minutes
Interview date18 May 2015
Coding problem1

The interviewer was a young guy. He too had a look at my CV and appeared impressed. He discussed in detail about the two major projects done during my internship. He sat smiling at me with a friendly look and said that yes you have had actually done a lot of work. In the end for formality sake he gave me one question to code

1. Inorder Sucessor

Moderate
30m average time
65% success
0/80
Asked in companies
SAP LabsInnovaccerAmazon

You have been given an arbitrary binary tree and a node of this tree. You need to find the inorder successor of this node in the tree.

The inorder successor of a node in a binary tree is that node that will be visited immediately after the given node in the inorder traversal of the tree. If the given node is visited last in the inorder traversal, then its inorder successor is NULL.

The inorder traversal of a binary tree is the traversal method in which for any node its left subtree is visited first, then the node itself, and then the right subtree.

Note
1. Each node is associated with a unique integer value. 

2. The node for which the successor is to be found is guaranteed to be part of the tree.
Problem approach

The question can be solved using a recursive approach. The idea is to search for the node in the tree and update the successor to the current node before visiting its left subtree. If the node is found in the BST, return the least value node in its right subtree, and if the right subtree of the node doesn’t exist, then inorder successor is one of the ancestors of it, which has already been updated while searching for the given key. Travel down the tree, if a node’s data is greater than root’s data then go right side, otherwise, go to left side.

Time Complexity : O(h) where h is the height of the tree

Try solving now
04
Round
Easy
HR Round
Duration45 minutes
Interview date18 May 2015
Coding problem1

This was supposed to be the HR round but out of surprise the interviewer started by giving me a question to code.
After I approached this question with the right solution he just asked about my family. After that he said to wait.
After half an hour the results were announced. A total of three students were hired and I was amongst one of them.

1. Generate all parenthesis

Moderate
30m average time
85% success
0/80
Asked in companies
FacebookExpedia GroupLinkedIn

You are given an integer 'N', your task is to generate all combinations of well-formed parenthesis having ‘N’ pairs.


A parenthesis is called well-formed if it is balanced i.e. each left parenthesis has a matching right parenthesis and the matched pairs are well nested.


For Example:

For ‘N’ = 3,
All possible combinations are: 
((()))
(()())
(())()
()(())
()()()
Problem approach

The question can be solved using a backtracking approach. Use two integers to count the remaining left parenthesis (n) and the right parenthesis (m) to be added. At each function call add a left parenthesis if n >0 and add a right parenthesis if m>n. Append the result and terminate recursive calls when both m and n are zero.
Steps :
1. Create a backtrack function that updates the current string if open_brackets are less than n or close_bracket are less than open_bracket
2. When the length of current string becomes equal to 2*n , add it to the combination result array.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by Intuit
1947 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Intuit
1177 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Intuit
1270 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Intuit
1372 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57824 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes