Freshworks
100+ TCS Interview Questions and Answers
Given a singly linked list of integers. Your task is to return the head of the reversed linked list.
For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked lis...read more
You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.
An array is said to have a...read more
You are given a binary search tree of integers with 'N' nodes. Your task is to return the K-th largest element of this BST.
If there is no K-th largest element in the BST, return -1.
A bi...read more
You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...read more
You have been given two integers 'N' and 'D', Your task is to find the square root of the number 'N' with precision up to 'D' decimal places i.e. the difference between your answer and the ...read more
You are given two Singly Linked List of integers, which are merging at some node of a third linked list.
Your task is to find the data of the node at which merging starts. If there is...read more
You're given string ‘STR’ consisting solely of “{“, “}”, “(“, “)”, “[“ and “]” . Determine whether the parentheses are balanced.
Input Format:
The first line contains an Integer 'T' which denot...read more
You are provided with a Binary Tree and one of its leaf nodes. You have to invert this binary tree. Inversion must be done by following all the below guidelines:
• The given leaf node become...read more
Ninja has been given two sorted integer arrays/lists ‘ARR1’ and ‘ARR2’ of size ‘M’ and ‘N’. Ninja has to merge these sorted arrays/lists into ‘ARR1’ as one sorted array. You may have to a...read more
You are given a Singly Linked List of integers which is sorted based on absolute value.
You have to sort the Linked List based on actual values.
The absolute value of a real number x, denoted |x...read more
You are given a binary tree having ‘N’ number of nodes. Your task is to find the deepest leaf node in the given input tree.
Note:
The deepest leaf node is the leaf node which will be the left child...read more
Given a string input of length n, find the length of the longest substring without repeating characters i.e return a substring that does not have any repeating characters.
Substring is t...read more
The Ultimate Ninja Ankush is a straightforward, no-nonsense guy and loves binary Trees, and he has given you a binary tree, and you have to return the vertical order traversal of the val...read more
Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.
If there are an odd number of elements, return the middle element if there are eve...read more
You have been given the start and end times of 'N' intervals. Write a function to check if any two intervals overlap with each other.
Note :
If an interval ends at time T and another interv...read more
Given a text and a wildcard pattern of size N and M respectively, implement a wildcard pattern matching algorithm that finds if the wildcard pattern is matched with the text. The matchi...read more
You are given an integer array ‘ARR’. You have to find the length of the shortest contiguous subarray such that, if you sort this subarray in ascending order, then the whole array will be sorted in asce...read more
You are given a string ‘S’ and an integer ‘ROW’, convert the row into a zig-zag pattern with rows equal to ‘ROW’ and output it row-wise. You may refer to the example below to better understand...read more
You have been given two Strings “STR1” and “STR2” of characters. Your task is to find the length of the longest common subsequence.
A String ‘a’ is a subsequence of a String ‘b’ if ‘a’...read more
You are given a positive integer N, and you have to find the number of ways to represent N as a sum of cubes of two integers(let’s say A and B), such that:
N = A^3 + B^3.
Note:
1. A should be gre...read more
Given an array/list 'ARR' of ‘N’ distinct integers, you are supposed to find the third largest element in the given array 'ARR'.
Input Format :
The first line contains a single integer ‘T’...read more
Write a program to find x to the power n (i.e., x^n). Take x and n from the user. You need to print the answer.
Note: For this question, you can assume that 0 raised to the power of 0 is 1...read more
Given an array of ‘N’ integers and ‘Q’ queries. The query is defined as below :-
Given 2 integers ‘l’ and ‘r’ (‘l’ >= 0 and ‘r’ < N) find the maximum subarray sum between ‘l’ to ‘r’ ...read more
You are given a 32-bit signed integer ‘N’. So, the integer will lie in the range [-2^31, 2^31 - 1]. Your task is to return the reverse of the given integer. If reversing causes overflow, then ret...read more
You are given an array/list 'ARR' consisting of N integers, which contains elements only in the range 0 to N - 1. Some of the elements may be repeated in 'ARR'. Your task is to find all ...read more
You are given a Singly Linked List of integers and an integer 'K'. Your task is to remove all such nodes from the linked list whose value is equal to 'K'.
A singly linked list is a ...read more
Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the update...read more
You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.
Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' r...read more
Build a file-based key-value data store that supports the basic CRD (create, read, and delete)operations. This data store is meant to be used as local storage for one single process on one lap...read more
You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.
For example:
For the given binary tree
The level order traversal wil...read more
Q31. Consider the situation where you have one critical customer requirement which is a road blocker for them to go live. This was not identified during sales or evaluation period. Please provide key pointers to han...
read moreIdentify the root cause and work with the customer to find a solution.
Gather all necessary information about the requirement and the impact on the customer's business.
Identify the root cause of the issue and determine if it can be resolved within the current system.
If the issue cannot be resolved within the current system, work with the customer to find a workaround or alternative solution.
Communicate regularly with the customer to keep them informed of progress and any poten...read more
Design online conference booking platform
User can see different conferences on online portal
User can see active conferences on online portal
User can go and register itself in one or multip...read more
Scenario based questions
1. Like you have DB which is read heavy. What could be your approach to reduce DB calls
Answer: caching
2. How virtual memory works
3. Behavioral questions
Design BookMyShow LLD+HLD
Design database schema for support ticketing system (freshdesk)
I was Asked to code some basic SQL queries. All them were really simple if you know the basics of SQL.
Q37. What is a customer centered company? What are its main features?
A customer centered company prioritizes customer needs and satisfaction over profits.
Focuses on understanding and meeting customer needs
Values customer feedback and uses it to improve products/services
Provides excellent customer service
Tailors marketing and messaging to customer preferences
Prioritizes long-term customer relationships over short-term profits
What is threading. What are different scheduling algorithm
Q39. Do you think so you are fit for Product marketing?
Yes, I believe I am fit for Product Marketing.
I have a strong understanding of the target audience and their needs.
I am skilled in market research and analysis.
I have experience in developing and executing successful marketing campaigns.
I am able to effectively communicate the value of a product to potential customers.
I am creative and able to come up with innovative marketing strategies.
I am able to work collaboratively with cross-functional teams to ensure product success.
LLD on building system like Flipkart
Q41. Given an Array [2,5,1,3,4] return resulting array such that at ith position multiply all element except ith element. Result array [60, 24, 120, 40, 60]
Given an array, return a new array where each element is the product of all elements in the original array except the corresponding element.
Create a new array of the same length as the input array
Iterate through the input array and calculate the product of all elements except the current element
Store the product in the corresponding position in the new array
Return the new array
Design an app like uber
Q43. When would money not be a factor for you?
Money would not be a factor for me when pursuing my passion or helping others in need.
I would prioritize my passion and purpose over financial gain
I would donate to charities and causes that align with my values
I would invest in experiences and personal growth opportunities
I would prioritize spending time with loved ones and creating meaningful memories
Examples: pursuing a career in the arts, volunteering for a non-profit organization, traveling to explore different cultures
Q44. How would you check static UI appearance
To check static UI appearance, I would perform visual testing using tools like Applitools or Selenium.
Use visual testing tools to compare screenshots of the UI before and after changes
Check for consistency in font, color, layout, and alignment
Ensure that all UI elements are visible and not overlapping
Verify that the UI is responsive and looks good on different screen sizes
Perform manual checks to ensure that the UI meets design specifications
what is deadlock and join and quary
Current project architecture
Q47. Implement a reusable carousel component in vanilla js.
Q48. Remote working is the trend - how does this augur for customer relations
Remote working can positively impact customer relations by providing flexibility, accessibility, and personalized communication.
Remote working allows for more flexibility in scheduling meetings and calls with customers
It also allows for easier accessibility to customers in different time zones or locations
Personalized communication can be achieved through video conferencing and screen sharing
Remote working can also lead to increased productivity and faster response times
Howev...read more
Q49. if A -> 1, AA -> 27 AZ->52 what will be 702
702 is represented by ZZ in the given pattern.
The pattern seems to be assigning numbers to alphabets based on their position in the English alphabet.
The first letter represents the position in the alphabet and the second letter represents the position multiplied by 26.
Therefore, ZZ represents 26*26 + 26 = 702.
Q50. take anyone product from freshworks and explain features of it
Freshdesk - Customer Support Software
Omnichannel support for email, phone, chat, social media
Automated ticket routing and prioritization
Knowledge base for self-service support
SLA management and reporting
Integrations with other tools like CRM and project management
Mobile app for agents and customers
Q51. Find the department with maximum number of students ? Department table: Id, dept_name Student table: I'd, stident_name, dept_id
The department with the maximum number of students needs to be found.
Join the Department and Student tables on the dept_id column
Group the data by department
Count the number of students in each department
Find the department with the maximum count
Q52. Find count of hard nodes in a binary tree ? A node is a hard node if it's current value is greater than its root's value.
Count the number of hard nodes in a binary tree.
Traverse the binary tree using any traversal algorithm.
Compare the value of each node with its root's value.
Increment the count if the node's value is greater than its root's value.
Q53. Round2: System design- Design a database to store custom fields for a ticket.
Design a database to store custom fields for a ticket.
Identify the custom fields needed for a ticket
Create a table for each custom field
Link the tables to the main ticket table using foreign keys
Use appropriate data types for each custom field
Consider indexing frequently searched fields
Q54. Given i/p 2[abc3[ac]] o/p should be acacacabcabc
The given input string needs to be decoded to produce the output string.
The input string contains nested encoding of characters.
The number preceding the square brackets indicates the number of times the characters inside the brackets should be repeated.
The characters outside the square brackets are repeated as is.
The decoding needs to be done recursively.
The output string is obtained by decoding the input string.
Q55. Round1 : Write a program to find out if given number is prime.
Program to check if a given number is prime or not.
A prime number is only divisible by 1 and itself.
Loop through numbers from 2 to n/2 and check if n is divisible by any of them.
If n is divisible by any number, it is not prime.
If n is not divisible by any number, it is prime.
Q56. How do you build a tiny URL Application?
A tiny URL application is built by generating short aliases for long URLs, storing them in a database, and redirecting users to the original URL when the alias is accessed.
Generate a unique short alias for each long URL
Store the alias and corresponding long URL in a database
Implement a redirect mechanism to redirect users from the alias to the original URL
Handle edge cases like duplicate URLs, expired aliases, and invalid URLs
Q57. What are the keys to marketing success?
The keys to marketing success are understanding your audience, creating a strong brand, and effective communication.
Understand your target audience and their needs
Create a strong brand identity that resonates with your audience
Develop a clear and concise message that communicates the value of your product or service
Utilize multiple channels to reach your audience, including social media, email marketing, and advertising
Measure and analyze your marketing efforts to continually...read more
Q58. Count pair whose sum is perfect square.
Count pairs in an array whose sum is a perfect square.
Iterate through the array and calculate the sum of each pair.
Check if the sum is a perfect square using a function.
Increment a counter if the sum is a perfect square.
Return the final count of pairs.
Q59. Differentiate between business market and consumer market
Business market refers to organizations that buy goods and services for use in their own products or operations, while consumer market refers to individuals or households who buy goods and services for personal use.
Business market involves larger purchases and longer decision-making processes
Consumer market involves smaller purchases and shorter decision-making processes
Business market focuses on functionality and efficiency, while consumer market focuses on emotions and pers...read more
Q60. Pascal triangle , Sorting number using occurence
The question is unclear and lacks context. Please provide more information.
Please provide more information about the specific requirements of the task.
What is the purpose of the Pascal triangle and how does it relate to sorting numbers by occurrence?
What programming language and tools should be used for this task?
Q61. How will u sell this pen
I will sell this pen by highlighting its unique features and demonstrating its usefulness in various scenarios.
Emphasize the pen's sleek design and high-quality materials
Highlight its smooth writing experience and quick-drying ink
Demonstrate its versatility by showcasing its compatibility with different paper types
Offer a special promotion or discount to incentivize purchase
Provide testimonials from satisfied customers who have benefited from using the pen
Q62. What is your expected CTC?
My expected CTC is in line with industry standards and commensurate with my experience and skills.
I have researched the market and have a good understanding of the salary range for this position.
I am open to negotiation based on the specific responsibilities and benefits offered.
I am looking for a fair and competitive compensation package.
Based on my experience and skills, I am expecting a salary range of X to Y.
I am also open to discussing performance-based incentives and bo...read more
Q64. When to have SQL and NoSql db ?
SQL databases are suitable for structured data and complex queries, while NoSQL databases are better for unstructured data and high scalability.
Use SQL databases when data has a fixed schema and relationships between entities are well-defined.
Use NoSQL databases when data is unstructured or semi-structured, and when high scalability and performance are required.
SQL databases are better for complex queries involving multiple tables and joins.
NoSQL databases are suitable for ha...read more
Q65. How to grow business in pandemic
To grow business in pandemic, focus on digital transformation, adapt to changing customer needs, and explore new markets.
Invest in digital marketing and e-commerce platforms
Offer flexible payment and delivery options
Develop new products or services that cater to pandemic-related needs
Explore new markets or partnerships
Prioritize customer communication and support
Optimize supply chain and operations for efficiency
Consider remote work and virtual events to reduce costs
Monitor i...read more
Q66. how do you handle escalting customer
When handling escalating customers, it is important to remain calm, listen actively, empathize, and find a solution.
Stay calm and composed throughout the interaction.
Listen actively to the customer's concerns and frustrations.
Empathize with the customer and acknowledge their feelings.
Take ownership of the issue and assure the customer that you will find a solution.
Offer alternative solutions or escalate the issue to a higher authority if necessary.
Follow up with the customer ...read more
Q67. Triplets in array of integers without duplicates
Find all triplets in an array of integers without duplicates
Iterate through the array and for each element, find all pairs that sum up to the negative of that element
Use a set to store the seen elements to avoid duplicates
Time complexity can be improved to O(n^2) by sorting the array first
Q68. Explain anyone feature of amazon
Amazon Prime - free shipping, streaming, and more
Amazon Prime offers free two-day shipping on eligible items
Prime members also have access to streaming of movies, TV shows, and music
Additional benefits include early access to select lightning deals and free e-books
Prime Wardrobe allows members to try on clothing before purchasing
Q69. Find all square matrices in a given matrix
To find all square matrices in a given matrix, iterate through each cell as the top left corner of a potential square matrix and check if all elements within the square are the same.
Iterate through each cell in the matrix as the top left corner of a potential square matrix
For each cell, check if all elements within the square formed by the cell are the same
If all elements are the same, consider it as a square matrix
Q70. system design on scheduler and tougher situation as a manager
Designing a scheduler system and handling tough situations as a manager
Understand the requirements and constraints of the scheduler system
Consider scalability, reliability, and efficiency in the design
Implement algorithms for task scheduling and resource allocation
Handle conflicts and prioritize tasks effectively as a manager
Communicate clearly with team members and stakeholders during tough situations
Q71. Manual Testing, Write test cases for integration test
Integration test cases ensure different modules work together correctly
Identify integration points between modules
Test data flow between modules
Verify communication between modules
Check for data consistency across modules
Q72. Immediate higher number to right
The immediate higher number to the right of each element in an array
Iterate through the array from right to left
For each element, compare it with the elements to its right to find the immediate higher number
Store the immediate higher number in a new array
Q73. Challenges faced in automation
Automation challenges include tool selection, maintenance, and test case design.
Selecting the right automation tool for the project
Maintaining the automation scripts as the application changes
Designing effective test cases for automation
Handling dynamic elements on the application
Integrating automation with CI/CD pipeline
Ensuring test data availability and consistency
Managing test environment and infrastructure
Dealing with flaky tests and false positives
Ensuring cross-browser...read more
Q74. what is hub , switch , router
A hub, switch, and router are networking devices used to connect devices in a network.
A hub is a simple device that connects multiple devices in a network, but it does not manage or control the traffic.
A switch is a more advanced device that connects devices in a network and manages the traffic by directing it to the intended recipient.
A router is a device that connects multiple networks and directs traffic between them, making decisions based on IP addresses.
Example: A hub i...read more
Q75. Write program to find duplicate elements from array
Program to find duplicate elements from array of strings
Iterate through the array and store elements in a HashMap with element as key and count as value
Check if count of any element is greater than 1, then it is a duplicate
Q76. Loop in a linked list and removing it
Loop through the linked list to find and remove a specific node
Start at the head of the linked list and iterate through each node
Check if the current node matches the one to be removed
If found, update the pointers to skip over the node and remove it
Continue until the end of the list is reached
Q77. Debugging an application and wirtting cases
Debugging an application involves identifying and fixing issues in the code, while writing test cases ensures the application functions correctly.
Understand the functionality of the application and identify the root cause of the issue
Use debugging tools like breakpoints, logging, and stack traces to pinpoint the problem
Write test cases to cover different scenarios and ensure the issue is resolved
Reproduce the issue to validate the fix and prevent regression
Document the debugg...read more
Q78. Elevator travel, find the no. of hops
The question is asking to calculate the number of hops an elevator needs to travel between floors.
Calculate the difference between the starting floor and the destination floor
Divide the difference by the maximum number of floors the elevator can travel in one hop
Round up the result to get the number of hops needed
Q79. Design an online real time document sharing tool
An online real time document sharing tool for collaboration and communication
Implement real-time editing and commenting features
Allow multiple users to access and edit the document simultaneously
Provide version control and history tracking
Include user authentication and permission settings
Support various file formats such as text, images, and videos
Q80. implement hashmap in java
Implementing hashmap in Java
Create an array of linked lists to store key-value pairs
Hash the key to get the index of the array
Insert the key-value pair at the index in the linked list
Handle collisions by chaining
Implement methods like put(), get(), remove()
Use generics to allow any type of key-value pairs
Q81. Kth largest number in BST
To find the Kth largest number in a Binary Search Tree (BST), we can perform an in-order traversal and keep track of the Kth largest element.
Perform an in-order traversal of the BST to get the elements in non-decreasing order.
Keep track of the Kth largest element while traversing the BST.
Return the Kth largest element once found.
Q82. Find the max element in the array
Find the max element in the array
Iterate through the array and compare each element with a variable storing the current max value
Use built-in functions like Math.max() or spread operator to find the max value
Consider edge cases like empty array or array with negative values
Q83. Framework explanation from scratch
Framework is a set of guidelines, standards, and tools used to develop and execute automated tests.
Framework provides a structure for organizing test cases and test data.
It helps in reducing the effort required for test automation.
It provides reusable components and libraries for test automation.
Examples of frameworks are Selenium, Appium, TestNG, JUnit, etc.
Q84. write a lambda function in python
A lambda function in Python is a small anonymous function defined using the lambda keyword.
Lambda functions can have any number of arguments, but can only have one expression.
Syntax: lambda arguments : expression
Example: lambda x, y : x + y
Q85. Implement debounce function
Debounce function delays the execution of a function until after a specified amount of time has passed since the last time it was invoked.
Create a function that takes a function and a delay time as parameters
Use setTimeout to delay the execution of the function
Use clearTimeout to reset the timer if the function is invoked again within the delay time
Q86. What is your typing speed
My typing speed is 80 words per minute.
Typing speed: 80 words per minute
Accuracy: 98%
Experience with data entry tasks
Proficient in using typing software
Regular practice to improve speed
Q87. what is commit in SQL
A commit in SQL is a command that saves all the changes made in a transaction to the database.
A commit is used to make all the changes made in a transaction permanent.
Once a commit is issued, the changes cannot be rolled back.
It is important to use commit to ensure data integrity and consistency.
Example: COMMIT; - this command is used to commit the changes in a transaction.
Q88. Do you know c program
Yes, I am familiar with C programming language.
I have experience writing and debugging C programs
I am comfortable working with data structures and algorithms in C
I have worked on projects where C was the primary language used
Q89. What is living feslety
Living feslety is not a known term or concept in the security field.
Living feslety is not a recognized term or concept in the security industry.
It is possible that the interviewer misspoke or meant to ask a different question.
As a security officer, it is important to be knowledgeable about various security protocols and procedures.
Some common responsibilities of a security officer include monitoring surveillance footage, patrolling premises, and responding to emergencies.
It i...read more
Q90. Quota carrying full explanation
Quota carrying refers to the sales target or goal that a salesperson is expected to meet within a specific time period.
Quota carrying is typically measured in terms of revenue or units sold.
Salespeople are often incentivized to meet or exceed their quota through bonuses or commissions.
Quotas can be set on a monthly, quarterly, or annual basis.
Failure to meet quota may result in consequences such as reduced commissions or even termination.
Example: A Bdm Executive may have a mo...read more
Q91. How caching works ?
Caching is a technique used to store frequently accessed data in a temporary storage for faster retrieval.
Caching improves performance by reducing the need to fetch data from the original source.
It involves storing data in a cache, which is a high-speed storage system closer to the user or application.
When a request is made for data, the cache is checked first, and if the data is found, it is returned quickly.
If the data is not in the cache, it is fetched from the original so...read more
Q92. check palindrom from given string
Check if a given string is a palindrome
Iterate through the string from both ends and compare characters
Ignore spaces and punctuation marks while checking for palindrome
Convert the string to lowercase for case-insensitive comparison
Q93. Explain Software development life cycle
Software development life cycle is a process used by software development teams to design, develop, test, and deploy software.
It involves planning, designing, coding, testing, and deployment stages.
Each stage has specific goals and deliverables.
Examples of SDLC models include Waterfall, Agile, and DevOps.
Q94. Transactions in spring boot
Transactions in Spring Boot manage database transactions in a declarative way.
Spring Boot uses @Transactional annotation to mark a method as transactional.
Transactions can be managed at class level or method level.
Rollback can be configured based on specific exceptions.
Example: @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
Q95. Do you know c++
Yes, I am familiar with C++ programming language.
I have experience in writing C++ code for various projects.
I am comfortable with concepts like classes, inheritance, polymorphism, and templates.
I have used C++ for data structures and algorithms implementations.
I have worked with libraries like STL in C++.
Q96. Find max square in matrix
Iterate through the matrix to find the largest square of 1s
Iterate through each cell in the matrix
For each cell, check if it is part of a square of 1s by checking the cells to the right, below, and diagonally right-down
Keep track of the size of the largest square found
Q97. Streaming use case with spark
Spark can be used for real-time data processing in streaming use cases.
Spark Streaming allows for processing real-time data streams.
It can handle high-throughput and fault-tolerant processing.
Examples include real-time analytics, monitoring, and alerting.
Q98. dbutils in databricks
dbutils is a utility provided by Databricks for interacting with files and directories in the Databricks environment.
dbutils.fs.ls('/') - list files in root directory
dbutils.fs.cp('dbfs:/file.txt', 'file.txt') - copy file from DBFS to local file system
dbutils.fs.mkdirs('dbfs:/new_dir') - create a new directory in DBFS
Q99. Arr of those accounts
The question is asking about the average revenue per account (ARR) of those accounts.
ARR is calculated by dividing the total annual revenue generated from a group of accounts by the number of accounts in that group.
For example, if a group of 10 accounts generated a total revenue of $100,000 in a year, the ARR would be $10,000 ($100,000 / 10).
Q100. Sales process and techniques
Sales process involves identifying leads, qualifying prospects, making presentations, handling objections, closing deals, and following up.
Identify leads through networking, cold calling, and referrals.
Qualify prospects by understanding their needs and budget.
Make compelling presentations showcasing the benefits of your product or service.
Handle objections by addressing concerns and providing solutions.
Close deals by asking for the sale and overcoming any final objections.
Fol...read more
More about working at Freshworks
Top HR Questions asked in TCS
Interview Process at TCS
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month