
Freshworks


Freshworks Software Engineer Interview Questions and Answers
Q1. 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.
Q2. Sort Linked List Based on Actual Values
Given a Singly Linked List of integers that are sorted based on their absolute values, the task is to sort the linked list based on the actual values.
The absolute value ...read more
Sort a Singly Linked List based on actual values instead of absolute values.
Traverse the linked list and store the values in an array.
Sort the array based on actual values.
Update the linked list with the sorted values.
Q3. 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
The task is to 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.
Check if the sum of the triplet equals the specified number.
Print the valid triplets or return -1 if no triplet exists.
Q4. Intersection of Linked List Problem
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine the data...read more
Find the node where two linked lists merge, return -1 if no merging occurs.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging node
Q5. Remove Nodes with Specific Value from Linked List
You are provided with a singly linked list consisting of integer values and an integer 'K'. Your task is to eliminate all nodes from the linked list that have a...read more
Remove nodes with specific value from a singly linked list.
Traverse the linked list and remove nodes with value equal to 'K'.
Update the references of the previous node to skip the removed node.
Handle edge cases like removing the head node or multiple nodes with the same value.
Return the modified linked list after removal.
Q6. Find Duplicates in an Array
Given an array ARR
of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.
Return the duplicate elements in any order. If n...read more
Find duplicates in an array of integers within a specified range.
Iterate through the array and keep track of the count of each element using a hashmap.
Identify elements with count greater than 1 as duplicates.
Return the duplicate elements as the output.
Handle edge cases like empty array or no duplicates found.
More about working at Freshworks

Interview Process at Freshworks Software Engineer

Top Software Engineer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

