Filter interviews by
Clear (1)
I applied via Campus Placement and was interviewed in Jan 2024. There were 3 interview rounds.
It had questions ranging from leetcode moderate to hard.
Top trending discussions
I was interviewed before Jun 2016.
I have the ability to handle pressure effectively.
I remain calm and focused in high-pressure situations.
I prioritize tasks and manage my time efficiently.
I seek support and guidance from team members when needed.
I maintain a positive attitude and adapt to changing circumstances.
I have successfully completed projects under tight deadlines.
Function to return mutual friends given two ids and getFriends(id) function
Call getFriends(id) for both ids to get their respective friend lists
Iterate through both lists and compare to find mutual friends
Return the list of mutual friends
Function to return list of friends of friends in decreasing order of mutual friends
Use a set to store all friends of friends
Iterate through the list of friends of the given id
For each friend, iterate through their list of friends and count mutual friends
Sort the set of friends of friends by decreasing number of mutual friends
Given time slots, find a specific time with maximum overlap. Prove solution.
Create a list of all start and end times
Sort the list in ascending order
Iterate through the list and keep track of the number of overlaps at each time
Return the time with the maximum number of overlaps
Prove solution by testing with different input sizes and edge cases
Find the longest sub-array with increasing order of integers.
Iterate through the array and keep track of the current sub-array's start and end indices.
Update the start index whenever the current element is smaller than the previous element.
Update the end index whenever the current element is greater than or equal to the next element.
Calculate the length of the sub-array and compare it with the longest sub-array found s
Find the length of longest increasing subsequence and print the sequence from an array of integers.
Use dynamic programming to solve the problem
Create an array to store the length of longest increasing subsequence ending at each index
Traverse the array and update the length of longest increasing subsequence for each index
Print the sequence by backtracking from the index with the maximum length
Time complexity: O(n^2)
Exam...
Code to find a given integer in a rotated sorted array.
Use binary search to find the pivot point where the array is rotated.
Divide the array into two subarrays and perform binary search on the appropriate subarray.
Handle edge cases such as the target integer not being present in the array.
Use a min-heap to keep track of the largest K numbers seen so far.
Create a min-heap of size K.
For each incoming integer, add it to the heap if it's larger than the smallest element in the heap.
If the heap size exceeds K, remove the smallest element.
At the end, the heap will contain the largest K numbers in the input.
LRU Cache is a data structure that stores the most recently used items and discards the least recently used items.
Use a doubly linked list to keep track of the order of items in the cache
Use a hash map to store the key-value pairs for fast access
When an item is accessed, move it to the front of the linked list
When the cache is full, remove the least recently used item from the back of the linked list and the hash map
Solution to performing operations on a large array of bits.
Use bitwise operators to perform operations on individual bits
Use a loop to iterate through the array and perform the operations
Ensure that the array is large enough to accommodate all the bits
Consider using a data structure like a bitset for efficient bit manipulation
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Easy
In first round they asked me 2 coding questions where he asked me to code as close as possible to the actual one.
Ninja is tasked with merging two given sorted integer arrays ARR1
and ARR2
of sizes 'M' and 'N', respectively, such that the merged result is a single sorted array w...
Merge two sorted arrays into one sorted array in place.
Use two pointers to compare elements from both arrays and place them in the correct position in ARR1.
Start from the end of ARR1 and compare elements from both arrays, placing the larger element at the end of ARR1.
Continue this process until all elements from ARR2 are merged into ARR1.
Given a document represented as an array/list ARR
of words with length N
, find the smallest distance between two given words for multiple queries. The distance is defined as the ...
Find the smallest distance between two words in a document for multiple queries.
Iterate through the document array to find the indices of the two words in each query.
Calculate the absolute difference between the indices to get the distance.
If a word from the query is not present in the document, return the length of the document array.
Repeat the process for each query and output the smallest distance for each.
Round duration - 60 minutes
Round difficulty - Easy
Then in the second round they asked a little about tree and told me to code 2 codes.
Given a binary tree of integers, return the level order traversal of the binary tree.
The first line contains an integer 'T', representing the number of te...
The problem requires implementing a function to return the level order traversal of a binary tree.
Implement a function that takes the root of the binary tree as input and returns the level order traversal of the tree.
Use a queue data structure to perform level order traversal.
Process each level of the tree one by one, starting from the root node.
Print the node values at each level in the order they appear from left to ...
Given an array of distinct positive integers ARR
and a non-negative integer 'B', find all unique combinations in the array where the sum is equal to 'B'. Numbers can be c...
Find all unique combinations in an array where the sum is equal to a given target sum, with elements in non-decreasing order.
Use backtracking to generate all possible combinations.
Sort the array to ensure elements are in non-decreasing order.
Track the current combination and sum while backtracking.
Terminate recursion when the sum equals the target sum.
Avoid duplicates by skipping elements that have been used in previou
Round duration - 30 minutes
Round difficulty - Easy
HR round with typical behavioral problems.
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.
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.
I was interviewed before Mar 2021.
Round duration - 60 minutes
Round difficulty - Medium
This was a online test round where I was given 3 DSA questions to be solved in 60 minutes.
You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or tw...
The problem involves finding the number of distinct ways to climb to the Nth stair by taking one or two steps at a time.
Use dynamic programming to solve the problem efficiently.
The number of ways to reach the Nth stair is the sum of the number of ways to reach the (N-1)th stair and the (N-2)th stair.
Handle base cases for N=0 and N=1 separately.
Consider using modulo 10^9+7 to avoid overflow in calculations.
You are playing a coin game with your friend Ninjax. There are N
coins placed in a straight line.
Here are the rules of the game:
1. Each coin has a value associated wit...
The problem involves finding the optimal strategy to accumulate the maximum amount in a coin game with specific rules.
Start by understanding the rules of the game and how players take turns to choose coins.
Consider the scenario where both players play optimally to maximize winnings.
Iterate through different strategies to determine the best approach for selecting coins.
Keep track of the total winnings accumulated by eac...
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 w...
Generate all possible valid parentheses configurations using 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.
Base case: when the length of the generated string is 2*N, add it to the result array.
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.
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.
I was interviewed before Sep 2020.
Round duration - 75 minutes
Round difficulty - Easy
Timing it is around 11 am and Environment is good .
A ninja bird can gather fruits from trees arranged in a circle. Each tree has an associated fruit value. The bird can gather all the fruits from a tree i...
The task is to find the maximum number of fruits a bird can gather within a given time frame, moving between adjacent trees.
Start from each tree and calculate the maximum fruits that can be gathered within the time frame.
Use a sliding window approach to keep track of the fruits collected while moving between trees.
Choose the starting tree that gives the maximum total fruits collected.
Example: For input N=7, M=3, ARR={2...
You are given a decimal number 'N'. Your task is to convert this number into a base 58 representation.
The Base58 alphabet is defined by the following characters: “12...
Convert a decimal number to base 58 using a specific alphabet.
Iterate through each test case and convert the decimal number to base 58 using the given alphabet.
Handle the conversion by dividing the number by 58 and taking the remainder to find the corresponding base 58 character.
Build the base 58 representation by appending the characters in reverse order.
Output the final base 58 representation for each test case.
Round duration - 45 mintues
Round difficulty - Medium
Environment was very friendly but questions asked are hard
You are provided with an array ARR
consisting of N
distinct integers in ascending order and an integer TARGET
. Your objective is to count all the distinct pairs in ARR
whose sum...
Count distinct pairs in an array whose sum equals a given target.
Use two pointers approach to iterate through the array and find pairs with sum equal to target.
Keep track of visited pairs to avoid counting duplicates.
Return -1 if no such pair exists with the given target.
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
.
A t...
The task is to find all distinct triplets in 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 sum.
Handle edge cases like duplicate elements and no valid triplets.
Return the triplets or -1 if no valid triplet exists.
Tip 1 : Practice Atleast 500 Questions
Tip 2 : Do atleast 1 good projects
Tip 3 : You should be able to explain your project
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
I was interviewed before Dec 2020.
Round duration - 60 Minutes
Round difficulty - Medium
This was a Data Structures and Algorithms round with preety good questions . I was expected to come up with an efficient approach and code it as well .
Your house is located at the origin (0,0) of a 2-D plane. There are N
neighbors living at different points on the plane. Your goal is to visit exactly K
neighb...
Find the K closest points to the origin in a 2-D plane using Euclidean Distance.
Calculate the Euclidean Distance of each point from the origin
Sort the points based on their distances
Return the first K points as the closest neighbors
Given a sorted array of 'N' integers, your task is to generate the power set for this array. Each subset of this power set should be individually sorted.
A power set of a set 'ARR' i...
Generate the power set of a sorted array of integers with individually sorted subsets.
Use recursion to generate all possible subsets by including or excluding each element in the array.
Sort each subset before adding it to the power set.
Handle base cases for empty array and single element array.
Ensure the subsets are unique by using a set data structure.
Time complexity can be exponential due to the nature of generating
Round duration - 50 Minutes
Round difficulty - Hard
This was also a DSA round where I was asked to code only one of the questions but I eventually ended up coding both as I had some spare time and explained my approches very smoothly to the interviewer . This round went preety well .
Convert a string representing a Roman numeral into its integer equivalent and return the result.
Roman numerals are represented by seven different symbol...
Convert a Roman numeral string to its integer equivalent.
Create a mapping of Roman numeral symbols to their integer values.
Iterate through the input string and add the corresponding integer values.
Handle cases where subtraction is needed (e.g., IV = 4, IX = 9).
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Find pairs of elements in an array that sum up to a given value, sorted in a specific order.
Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.
If the complement exists, add the pair to the result list.
Sort the result list based on the criteria mentioned in the question.
Return the sorted list of pairs.
Round duration - 50 Minutes
Round difficulty - Medium
This was also a DSA round with 2 questions . One was implementation heavy and the other was related to recursion and so I handled it carefully so that my code does not run into TLE or Segmentation Fault.
You are provided with a string expression
consisting of characters '+', '-', '*', '/', '(', ')' and digits '0' to '9', representing an arithmetic express...
Evaluate arithmetic expressions in infix notation with given operators and precedence rules.
Parse the infix expression to postfix using a stack.
Evaluate the postfix expression using a stack.
Handle operator precedence and parentheses while evaluating.
Ensure no division by zero cases and operands fit in 32-bit integer.
You are given a sorted integer array ARR
of size N
. Your task is to remove the duplicates in such a way that each element appears only once. The outpu...
Remove duplicates from a sorted array in-place with O(1) extra memory.
Use two pointers - one for iterating through the array and another for placing unique elements.
Compare current element with next element to identify duplicates and skip them.
Update array in-place by moving unique elements to the front.
Return the length of the array after removal of duplicates.
Round duration - 50 Minutes
Round difficulty - Medium
This was a typical System Design round where I was asked about the various features of Facebook and what sort of data structures and algorithms are used in implementing them .
Facebook stores likes and dislikes using a combination of databases and algorithms.
Likes and dislikes are stored in databases such as MySQL or Cassandra.
Algorithms are used to analyze user behavior and recommend content based on likes and dislikes.
User interactions with posts, pages, and ads are tracked to determine likes and dislikes.
Likes and dislikes may also be used to personalize the user's feed and target ads mor
Facebook implements graph search using a graph database to efficiently search for connections between users and their interests.
Facebook uses a graph database to store connections between users, pages, groups, etc.
The graph search algorithm traverses the graph to find relevant connections based on user queries.
It takes into account factors like user relationships, interests, and interactions to provide personalized sea
Round duration - 50 Minutes
Round difficulty - Medium
This was a preety intense round as I was grilled more on my System Design concepts but eventually I was able to asnwers all the questions with some help from the interviewer.
Hadoop is a framework for distributed storage and processing of large data sets.
Hadoop is used for storing and processing big data across a distributed network of computers.
It is based on the MapReduce programming model, which allows for parallel processing of data.
Hadoop consists of HDFS for storage and YARN for resource management.
It is used for tasks like data warehousing, log processing, recommendation systems, and...
Facebook Chat works by using a combination of websockets, long polling, and push technology to deliver real-time messaging.
Facebook Chat uses websockets for real-time communication between the client and server.
Long polling is used to check for new messages when websockets are not supported.
Push technology is used to notify users of new messages even when the chat window is not open.
Messages are stored in a database an...
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.
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.
Some of the top questions asked at the Fastenal Software Developer Intern interview -
based on 1 interview
Interview experience
Software Developer
66
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
49
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer
31
salaries
| ₹0 L/yr - ₹0 L/yr |
Developer
31
salaries
| ₹0 L/yr - ₹0 L/yr |
IT Technical Lead
15
salaries
| ₹0 L/yr - ₹0 L/yr |
Grainger
WESCO International
Rexel
Wuerth