Freshworks Coding Interview Questions
25 Freshworks coding interview problems with full optimal solutions — 10 easy, 11 medium, 4 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Freshworks interviewer values, and a FAQ section.
Showing 25 problems of 25
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target.
- #2easyfoundational
2. Valid Parentheses
Determine if a string of brackets is correctly opened and closed.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Deduplicate ticket IDs streaming in sorted order without allocating a second buffer.
- #5easyfoundational
5. Merge Sorted Array
Merge two sorted ticket buffers in place, mirroring how Freshdesk consolidates queues from primary and replica shards.
- #6easyfoundational
6. Best Time to Buy and Sell Stock
Find the max single-pass profit — Freshworks dresses this up as 'lowest SLA breach risk window' across a day of ticket resolution times.
- #7easyfoundational
7. Single Number
Find the one un-paired ticket ID in a batch where every other ID was acknowledged twice — a classic XOR trick framed as Freshdesk audit reconciliation.
- #8easyfoundational
8. Min Stack
Design a stack with O(1) push, pop, top, and getMin — Freshworks frames it as 'lowest open-ticket priority' at any point in an undo history.
- #9easyfoundational
9. Majority Element
Find the agent ID assigned to more than half the open tickets — a Boyer-Moore voting drill that Freshworks dresses up as automation-rule triage.
- #10easyfoundational
10. Reverse Linked List
Reverse a singly-linked list iteratively — the warm-up Freshworks asks before any deeper linked-list problem like ticket-queue rotation.
- #11mediumfoundational
11. Add Two Numbers
Add two big numbers stored as reverse-order linked lists — Freshworks frames it as merging two automation-rule counters that overflow Int32.
- #12mediumfoundational
12. Longest Substring Without Repeating Characters
Find the longest run of unique characters in a string — Freshworks frames it as the longest stretch of distinct tags on a ticket timeline before a rule re-fires.
- #13mediumfoundational
13. 3Sum
Find every distinct triplet that sums to zero — Freshworks dresses it as balancing three SLA-credit ledgers to net zero.
- #14mediumfoundational
14. Permutations
Generate every ordering of a small set — Freshworks asks it to probe whether you can enumerate automation-rule firing orders cleanly.
- #15mediumfoundational
15. Group Anagrams
Bucket strings by anagram equivalence — Freshworks uses this shape for grouping tickets by canonical tag combinations regardless of label order.
- #16mediumfoundational
16. Merge Intervals
Merge overlapping time intervals — Freshworks frames it directly as collapsing overlapping SLA-timer windows on a ticket's lifecycle.
- #17mediumfoundational
17. Number of Islands
Count connected components in a grid — Freshworks frames it as counting independent tenant clusters in a sharded ticket grid.
- #18mediumfoundational
18. LRU Cache
Design an O(1) least-recently-used cache — Freshworks asks this verbatim because their multi-tenant ticket cache is exactly this data structure.
- #19mediumfoundational
19. Word Search
DFS-search a 2D grid for a word — Freshworks frames it as detecting a specific automation-rule signature path across a tag adjacency grid.
- #20mediumfoundational
20. Validate Binary Search Tree
Verify a binary tree satisfies the BST property — Freshworks asks this when probing whether you can reason about a permission tree's ordering invariant.
- #21mediumfoundational
21. Binary Tree Level Order Traversal
BFS a binary tree level-by-level — Freshworks uses this as the warm-up before any multi-tenant org-tree question.
- #22hardfoundational
22. Median of Two Sorted Arrays
Find the median across two sorted arrays in O(log min(m, n)) — Freshworks asks this to probe binary-search fluency over a partitioned domain.
- #23hardfoundational
23. Trapping Rain Water
Compute trapped water over an elevation histogram — Freshworks asks it to probe whether you can derive two-pointer invariants under pressure.
- #24hardfoundational
24. Merge k Sorted Lists
Merge k sorted linked lists into one — Freshworks frames it directly as merging k per-shard ticket queues into one global SLA-sorted stream.
- #25hardfoundational
25. Minimum Window Substring
Find the smallest window containing every required character — Freshworks frames it as finding the shortest ticket-history window covering every required SLA-breach tag.