Intuit | OA | SDE Intern | August 2021 | India
- Location
- Bangalore
- Posted
- 25 Aug 2021
Summary
I recently participated in the Intuit Online Assessment for an SDE Intern position in August 2021. The OA consisted of four distinct coding challenges, including a classic N-Queens problem, a variation of the Heaters problem, a complex permutation problem with specific positional constraints, and a unique 2D string vector transformation task.
How it went
Intuit visited our campus for SDE Intern hiring in August 2021. The online coding round was quite challenging, featuring four distinct problems. I had to solve them within the given time limit. The problems covered a range of topics from standard backtracking to more intricate data manipulation and custom constraint handling, requiring careful thought and implementation.
Questions asked (4)
- 01
N-Queens Problem
Data Structures & Algorithms
Open the problemThe classic N-Queens problem, where the goal is to place N non-attacking queens on an N×N chessboard.
- 02
Heaters Problem Variation
Data Structures & Algorithms
Open the problemThis was a variation of the LeetCode Heaters problem. Instead of given house positions, the total number of houses (N) was provided, and it had to be assumed that a house exists at every positive integer value up to N. After determining the minimum radius required to heat all houses, the answer needed to be returned with a decimal precision of 9 (e.g., 1.000000000 instead of 1).
- 03
Permutations with Positional Constraints
Data Structures & Algorithms
Given an array, I had to return all the possible permutations of the array under specific conditions:
- If a number
xwas present in a special array provided as input, then the permutation must follow the condition:perm[x] < perm[x+1]. This meant that if, for example, the number 3 was in the special array, then the number at the 3rd index (0-indexed) of the permutation should always be less than the number at the 4th index. - If a number
ywas not present in the special array, then it should follow the condition:perm[y] > n * perm[y+1], wherenis the size of the input array (not the special array).
- If a number
- 04
2D Vector String One-Hot Encoding
Data Structures & Algorithms
I was given a 2D vector of strings where each row was of the form
{Position, RandomString}. The task was to return a new 2D vector of strings such that the number of columns would be equal to1 + Number of unique strings in Column 2of the input matrix. Each of these new columns represented a unique string from the input, arranged in lexicographical order. For everyi-th row in the output, the first value again represented the position (i.e.,i), and subsequently, the column representing thei-th string of the input matrix was set to1, with all other string-representing columns set to0.
For example:
Input:0 Berkeley 1 Berkeley 2 Berkeley 3 Columbia
Output:0 1 0 0 1 0 0 1 0 0 0 1
Explanation matrix:Position isThisBerkeley isThisColumbia 0 1 0 1 1 0 2 1 0 3 0 1
Note that the column headers are arranged lexicographically.