
Intuit


20+ Intuit Interview Questions and Answers for Freshers
Q1. Word Presence in Sentence
Determine if a given word 'W' is present in the sentence 'S' as a complete word. The word should not merely be a substring of another word.
Input:
The first line contains an integer 'T...read more
Check if a given word is present in a sentence as a complete word.
Split the sentence into words using spaces as delimiter.
Check if the given word matches any of the words in the sentence.
Ensure the word is not just a substring of another word in the sentence.
Q2. Detect the First Node of the Loop in a Singly Linked List
You are provided with a singly linked list that may contain a cycle. Your task is to return the node where the cycle begins, if such a cycle exists.
A c...read more
To detect the first node of a loop in a singly linked list, we can use Floyd's Cycle Detection Algorithm.
Use Floyd's Cycle Detection Algorithm to detect the cycle in the linked list.
Once the cycle is detected, find the starting node of the cycle using two pointers approach.
The first pointer moves one step at a time while the second pointer moves two steps at a time until they meet at the starting node of the cycle.
Q3. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Q4. N Queens Problem
Given an integer N
, find all possible placements of N
queens on an N x N
chessboard such that no two queens threaten each other.
Explanation:
A queen can attack another queen if they are in the...read more
The N Queens Problem involves finding all possible placements of N queens on an N x N chessboard without threatening each other.
Use backtracking algorithm to explore all possible configurations.
Keep track of rows, columns, and diagonals to ensure queens do not threaten each other.
Generate all valid configurations and print them out.
Q5. Sort 0 1 2 Problem Statement
Given an integer array arr
of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.
Input:
The first line contains an integer 'T' representing the number of...read more
Sort an array of 0s, 1s, and 2s in linear time complexity using a single scan.
Use three pointers to keep track of the positions of 0s, 1s, and 2s in the array.
Iterate through the array and swap elements based on their values and the pointers.
After a single scan, the array will be sorted in-place with 0s, 1s, and 2s in order.
Q6. Inorder Successor in a Binary Tree
Find the inorder successor of a given node in a binary tree. The inorder successor is the node that appears immediately after the given node during an inorder traversal. If th...read more
Find the inorder successor of a given node in a binary tree.
Perform an inorder traversal of the binary tree to find the successor node
If the given node has a right child, the successor is the leftmost node in the right subtree
If the given node does not have a right child, backtrack to find the ancestor whose left child is the given node
Q7. Add Two Numbers as Linked Lists
You are given two singly linked lists, where each list represents a positive number without any leading zeros.
Your task is to add these two numbers and return the sum as a linke...read more
Add two numbers represented as linked lists and return the sum as a linked list.
Traverse both linked lists simultaneously while keeping track of carry from previous sum
Handle cases where one linked list is longer than the other by padding with zeros
Create a new linked list to store the sum of the two numbers
Q8. Sort a Stack Problem Statement
You are provided with a stack consisting of 'N' integers. The goal is to sort this stack in descending order by utilizing recursion.
Allowed Stack Operations:
is_empty(S) : Check ...read more
Sort a stack in descending order using recursion without using loop constructs.
Implement a recursive function to sort the stack in descending order.
Use the provided stack operations to manipulate the stack.
Recursively pop elements from the stack, sort them, and push them back in descending order.
Handle base cases such as an empty stack or a single element stack.
Ensure the stack is sorted in descending order after the recursive calls.
Avoid using loop constructs like while or f...read more
Q9. Product Of Array Except Self Problem Statement
You are provided with an integer array ARR
of size N
. You need to return an array PRODUCT
such that PRODUCT[i]
equals the product of all the elements of ARR
except...read more
The problem requires returning an array where each element is the product of all elements in the input array except itself.
Iterate through the array twice to calculate the product of all elements to the left and right of each element.
Use two arrays to store the products to the left and right of each element.
Multiply the corresponding elements from the left and right arrays to get the final product array.
Handle integer overflow by taking modulo MOD = 10^9 + 7.
To solve with O(1...read more
Q10. Generate All Parentheses Combinations
Given an integer N
, your task is to create all possible valid parentheses configurations that are well-formed using N
pairs. A sequence of parentheses is considered well-fo...read more
Generate all valid parentheses combinations for N pairs.
Use backtracking to generate all possible combinations of parentheses.
Keep track of the number of open and close parentheses used.
Add '(' if there are remaining open parentheses, and add ')' if there are remaining close parentheses.
Stop when the length of the generated string is 2*N.
Q11. Minimum Number Of Operations To Reach X Problem Statement
Given an array ARR
of 'N' integers and an integer 'X', determine the minimum number of operations required to make the sum of removed elements from eith...read more
Given an array of integers and a target sum, find the minimum number of operations to make the sum of removed elements equal to the target.
Iterate from both ends of the array, removing elements until the sum matches the target
Use a two-pointer approach to efficiently find the minimum number of operations
If achieving the target sum is not possible, return -1
Q12. Grid Satisfaction Problem
In this problem, you are given a grid of size N*M containing two types of people: type ‘A’ and type ‘B’. You are given the number of people of each type: 'countA' denotes the number of...read more
Given a grid with type A and B people, maximize satisfaction based on neighbors.
Start with type A people for maximum satisfaction
Optimally place people to maximize satisfaction
Consider satisfaction levels for each type of person and their neighbors
Q13. Problem Statement: Find the Number of States
You are given ‘n’ cities, some of which are connected by bidirectional roads. You also have an ‘n x n’ matrix ‘roads’, where if city ‘i’ and city ‘j’ are connected b...read more
Find the number of states of cities connected by roads in a matrix.
Identify connected cities using DFS or Union-Find algorithm
Count the number of disjoint sets to determine the number of states
Handle self-connections of cities by setting roads[i][i] = 1
Q14. Binary Tree Diameter Problem Statement
You are given a Binary Tree, and you need to determine the length of the diameter of the tree.
The diameter of a binary tree is the length of the longest path between any ...read more
The task is to find the diameter of a binary tree, which is the longest path between any two nodes in the tree.
Traverse the tree to find the longest path between two nodes.
Keep track of the maximum diameter found during traversal.
The diameter may or may not pass through the root node.
Consider the height of the left and right subtrees to calculate the diameter.
Q15. Triplets with Given Sum Problem
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
Explanation:
A triplet i...read more
Identify all distinct triplets within an array that sum up to a specified number.
Iterate through the array and use nested loops to find all possible triplets.
Use a set to store unique triplets and check if the sum equals the target.
Handle edge cases like duplicate elements and no valid triplets.
Return the triplets as space-separated integers or -1 if no triplets exist.
Q16. Number of Islands Problem Statement
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in this ma...read more
Count the number of islands in a 2D matrix of 1s and 0s.
Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.
Maintain a visited array to keep track of visited cells to avoid redundant traversal.
Increment the island count each time a new island is encountered.
Consider edge cases like boundary conditions and handling of diagonals while traversing.
Handle the input matrix efficiently to optimize the solution.
Example...read more
Q17. Longest Palindromic Substring Problem Statement
You are provided with a string STR
of length N
. The goal is to identify the longest palindromic substring within this string. In cases where multiple palindromic ...read more
Given a string, find the longest palindromic substring, prioritizing the one with the smallest start index.
Iterate through the string and expand around each character to find palindromes
Keep track of the longest palindrome found and its starting index
Return the longest palindromic substring with the smallest start index
Q18. Stack using Two Queues Problem Statement
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Explanation:
1. Cons...read more
Implement a stack using two queues to store integer values.
Use two queues to simulate stack operations efficiently.
Maintain the top element in one of the queues for easy access.
Ensure proper handling of edge cases like empty stack.
Example: Push elements onto one queue, then dequeue and enqueue to the other queue for pop operation.
Example: Use a flag to track the top element and update it accordingly.
Q19. Max Game Minimum Penalty Problem
In this game, you are given a collection of 'N' numbers. The objective is to minimize the total penalty incurred while playing by following these steps:
- Select any two numbers,...read more
The objective is to minimize total penalty by selecting two numbers, summing them, and accumulating the penalty until only one number remains.
Iteratively select two numbers, sum them, and accumulate the penalty until only one number remains.
Choose the two smallest numbers to minimize the penalty.
Repeat the process until only one number remains to find the minimum possible penalty.
Use sliding window technique to find smallest subarray with k distinct values.
Use a sliding window approach to keep track of the subarray with k distinct values.
Use a hashmap to store the frequency of each element in the window.
Slide the window to the right until the hashmap contains k distinct elements.
Shrink the window from the left while maintaining k distinct elements.
Update the minimum subarray length as you slide the window.
Return the smallest subarray length found.
Exam...read more
Q21. Kth Largest Element Problem
Given an array containing N
distinct positive integers and a number K
, determine the Kth largest element in the array.
Example:
Input:
N = 6, K = 3, array = [2, 1, 5, 6, 3, 8]
Output...read more
Find the Kth largest element in an array of distinct positive integers.
Sort the array in non-increasing order and return the Kth element.
Use a priority queue or quick select algorithm for efficient solution.
Handle constraints like array size and element values properly.
Ensure all elements in the array are distinct for accurate results.
Q22. Rearrange Linked List Problem Statement
Given a singly linked list in the form 'L1' -> 'L2' -> 'L3' -> ... 'Ln', your task is to rearrange the nodes to the form 'L1' -> 'Ln' -> 'L2' -> 'Ln-1', etc. You must not...read more
Rearrange the nodes of a singly linked list in a specific order without altering the data of the nodes.
Use two pointers to split the linked list into two halves, reverse the second half, and then merge the two halves alternately.
Ensure to handle cases where the number of nodes is odd or even separately.
Time complexity: O(N), Space complexity: O(1)
Example: Input: 1 -> 2 -> 3 -> 4 -> 5 -> NULL, Output: 1 -> 5 -> 2 -> 4 -> 3 -> NULL
Q23. AWS technologies on which you worked
I have worked on AWS technologies such as EC2, S3, Lambda, and RDS.
EC2 (Elastic Compute Cloud)
S3 (Simple Storage Service)
Lambda
RDS (Relational Database Service)
Q24. What is polymorphism?
Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Inheritance allows a child class to override a method from its parent class, exhibiting polymorphic behavior.
Q25. Write code for stack operations
Code for stack operations in C++ using array
Declare an array to store stack elements
Implement push operation to add elements to the top of the stack
Implement pop operation to remove elements from the top of the stack
Implement peek operation to view the top element without removing it
Q26. HLD of project worked previously
Designed a high-level architecture for a web-based project using microservices and RESTful APIs.
Utilized microservices architecture to break down the project into smaller, independent services.
Implemented RESTful APIs for communication between services.
Used a service discovery mechanism like Eureka or Consul for dynamic service registration and discovery.
Ensured scalability and fault tolerance by incorporating load balancing and circuit breaker patterns.
Secured communication ...read more
Q27. normalization in DBMS
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down a table into smaller tables and establishing relationships between them.
There are different levels of normalization, with each level addressing a specific type of data redundancy.
Normalization helps to prevent data inconsistencies and anomalies, and improves database performance.
Example: A customer table can be normalized into a cu...read more
More about working at Intuit

Top HR Questions asked in Intuit for Freshers
Interview Process at Intuit for Freshers

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

