Add office photos
Employer?
Claim Account for FREE

Arcesium

3.6
based on 299 Reviews
Video summary
Filter interviews by

30+ Sakthi Motors Interview Questions and Answers

Updated 15 Mar 2024
Popular Designations

Q1. Find first missing positive integer from an array for non-negative integers.

Ans.

Find first missing positive integer from an array of non-negative integers.

  • Create a hash set to store all positive integers in the array

  • Loop through the array and add all positive integers to the hash set

  • Loop through positive integers starting from 1 and return the first missing integer not in the hash set

Add your answer

Q2. Given list of strings group them into distinct anagrams.

Ans.

Group list of strings into distinct anagrams.

  • Create a hash table with sorted string as key and list of anagrams as value.

  • Iterate through the list of strings and add each string to its corresponding anagram list in the hash table.

  • Return the values of the hash table as a list of lists.

Add your answer

Q3. Find least common ancestor of a binary tree.

Ans.

Find the lowest common ancestor of a binary tree.

  • Traverse the tree recursively from the root node.

  • If the current node is null or matches either of the given nodes, return the current node.

  • Recursively search for the nodes in the left and right subtrees.

  • If both nodes are found in different subtrees, return the current node.

  • If both nodes are found in the same subtree, continue the search in that subtree.

Add your answer

Q4. Connecting Ropes with Minimum Cost

You are given 'N' ropes, each of varying lengths. The task is to connect all ropes into one single rope. The cost of connecting two ropes is the sum of their lengths. Your obj...read more

Ans.

Given 'N' ropes of varying lengths, find the minimum cost to connect all ropes into one single rope.

  • Sort the lengths of ropes in ascending order.

  • Keep connecting the two shortest ropes at each step.

  • Update the total cost by adding the lengths of the connected ropes.

  • Repeat until all ropes are connected.

  • Return the total cost as the minimum cost to connect all ropes.

Add your answer
Discover Sakthi Motors interview dos and don'ts from real experiences

Q5. Ninja and Binary String Problem Statement

Ninja has a binary string S of size N given by his friend. The task is to determine if it's possible to sort the binary string S in decreasing order by removing any num...read more

Ans.

Determine if a binary string can be sorted in decreasing order by removing non-adjacent characters.

  • Check if the count of '1's in the string is equal to the length of the string, in which case it can be sorted in decreasing order.

  • If there are multiple '0's between two '1's, they can be removed to sort the string in decreasing order.

  • If there are more '0's than '1's, it is not possible to sort the string in decreasing order.

Add your answer

Q6. Maximum Meetings Problem Statement

Given the schedule of N meetings with their start time Start[i] and end time End[i], you need to determine which meetings can be organized in a single meeting room such that t...read more

Ans.

Given N meetings with start and end times, determine the maximum number of meetings that can be organized in a single room without overlap.

  • Sort the meetings based on their end times.

  • Iterate through the sorted meetings and select the first meeting that does not overlap with the previous one.

  • Repeat the process until all meetings are considered.

  • Return the selected meetings in the order they are organized.

Add your answer
Are these interview questions helpful?

Q7. Topological Sort Problem Statement

Given a Directed Acyclic Graph (DAG) consisting of V vertices and E edges, your task is to find any topological sorting of this DAG. You need to return an array of size V repr...read more

Ans.

Implement a function to find any topological sorting of a Directed Acyclic Graph (DAG).

  • Use Depth First Search (DFS) to traverse the graph and add vertices to the result in reverse order of finishing times.

  • Maintain a visited array to keep track of visited vertices to avoid revisiting them.

  • Start DFS from any unvisited vertex and recursively explore its neighbors.

  • Once all neighbors are visited, add the current vertex to the result.

  • Repeat the process until all vertices are visite...read more

Add your answer

Q8. BST to Greater Tree Problem Statement

Given a binary search tree (BST) with 'N' nodes, the task is to convert it into a Greater Tree.

A Greater Tree is defined such that every node's value in the original BST i...read more

Ans.

Convert a binary search tree into a Greater Tree by replacing each node's value with the sum of all values greater than or equal to it.

  • Traverse the BST in reverse inorder (right, root, left) to visit nodes in descending order.

  • Keep track of the running sum of visited nodes and update each node's value with this sum.

  • Recursively apply the above steps to all nodes in the BST.

  • Example: Input - 4 1 6 0 2 5 7 -1 -1 -1 3 -1 -1 -1 -1, Output - 20 24 21 15 26 16 7 -1 -1 -1 3 -1 -1 -1 -1

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Optimize Memory Usage Problem Statement

Alex wants to maximize the use of 'K' memory spaces on his computer. He has 'N' different document downloads, each with unique memory usage, and 'M' computer games, each ...read more

Ans.

Maximize memory usage by pairing downloads and games within memory limit 'K'.

  • Sort downloads and games in descending order.

  • Iterate through downloads and games to find the pair with maximum memory usage.

  • Return the indices of the selected download and game pairs.

Add your answer

Q10. Spiral Order Traversal of a Binary Tree

Given a binary tree with N nodes, your task is to output the Spiral Order traversal of the binary tree.

Input:

The input consists of a single line containing elements of ...read more
Ans.

Implement a function to output the Spiral Order traversal of a binary tree given in level order.

  • Traverse the binary tree in a spiral order, alternating between left to right and right to left at each level.

  • Use a queue to keep track of nodes at each level and a stack to reverse the order of nodes at odd levels.

  • Handle null nodes appropriately to maintain the spiral order traversal.

  • Example: Input: 1 2 3 -1 -1 4 5, Output: 1 3 2 4 5

Add your answer

Q11. N-th Node From The End Problem Statement

You are provided with a Singly Linked List containing integers. Your task is to determine the N-th node from the end of the list.

Example:

Input:
If the list is (1 -> -2...read more
Ans.

Find the N-th node from the end of a Singly Linked List containing integers.

  • Traverse the list to find the length L of the list.

  • Calculate the position of the N-th node from the beginning as L - N + 1.

  • Traverse the list again to reach the calculated position and return the node's value.

  • Handle edge cases like N being equal to 1 or equal to the length of the list.

Add your answer

Q12. Bottom View of Binary Tree

Given a binary tree, determine and return its bottom view when viewed from left to right. Assume that each child of a node is positioned at a 45-degree angle from its parent.

Nodes in...read more

Ans.

Given a binary tree, return the bottom view of the tree when viewed from left to right.

  • Traverse the tree level by level and keep track of the horizontal distance of each node from the root.

  • For each horizontal distance, store the node with the maximum depth in a map.

  • After traversing the entire tree, return the values of the map in sorted order of their horizontal distance.

Add your answer

Q13. Serialize and Deserialize Binary Tree Problem Statement

Given a binary tree of integers, your task is to implement serialization and deserialization methods. You can choose any algorithm for serialization and d...read more

Ans.

Implement serialization and deserialization methods for a binary tree of integers.

  • Use level order traversal for serialization and deserialization.

  • Use -1 to represent null nodes in the binary tree.

  • Ensure the serialized string can be correctly decoded back to form the original binary tree.

Add your answer

Q14. Number of Islands Problem Statement

You are given a non-empty grid that consists of only 0s and 1s. Your task is to determine the number of islands in this grid.

An island is defined as a group of 1s (represent...read more

Ans.

The task is to determine the number of islands in a grid consisting of 0s and 1s.

  • Iterate through the grid and perform depth-first search (DFS) to find connected 1s.

  • Mark visited 1s as 0 to avoid counting them again.

  • Increment the island count each time a new island is found.

  • Consider all 8 adjacent cells (horizontally, vertically, diagonally) while performing DFS.

  • Handle edge cases like out of bounds and already visited cells.

Add your answer

Q15. Determine the Left View of a Binary Tree

You are given a binary tree of integers. Your task is to determine the left view of the binary tree. The left view consists of nodes that are visible when the tree is vi...read more

Ans.

The task is to determine the left view of a binary tree, which consists of nodes visible when viewed from the left side.

  • Traverse the binary tree in a level order manner and keep track of the leftmost node at each level.

  • Use a queue to perform level order traversal of the binary tree.

  • Maintain a count of nodes at each level to identify the leftmost node.

  • Return the leftmost nodes at each level as the left view of the binary tree.

Add your answer

Q16. Design a parking lot

Ans.

Design a parking lot

  • Consider the size and capacity of the parking lot

  • Decide on the layout and organization of parking spaces

  • Implement a system to manage parking availability and reservations

  • Include features like ticketing, payment, and security

  • Consider scalability and future expansion

Add your answer

Q17. Minimum weight to reach bottom right corner in matrix starting from top left. You can move only down and right.

Ans.

Minimum weight to reach bottom right corner in matrix starting from top left. You can move only down and right.

  • Use dynamic programming to solve the problem efficiently

  • Create a 2D array to store the minimum weight to reach each cell

  • The minimum weight to reach a cell is the minimum of the weight to reach the cell above and the cell to the left plus the weight of the current cell

  • The minimum weight to reach the bottom right corner is the value in the last cell of the 2D array

Add your answer

Q18. Stock Split, What happens to value of options after stock split?

Ans.

After a stock split, the value of options will be adjusted based on the new stock price and the split ratio.

  • Value of options will be adjusted based on the new stock price and the split ratio

  • Number of options will increase proportionally to the split ratio

  • Strike price of options will decrease proportionally to the split ratio

Add your answer

Q19. Find nearest index of character in string for each index.

Ans.

Find the nearest index of a character in a string for each index.

  • Create an array of strings to store the results.

  • Loop through each character in the string.

  • For each character, loop through the rest of the string to find the nearest index of the same character.

  • Store the result in the array.

Add your answer

Q20. What is Beta, Required Return, Methods of calculating required return?

Ans.

Beta is a measure of a stock's volatility, required return is the minimum return an investor expects, methods include CAPM and DDM.

  • Beta measures a stock's volatility in relation to the market.

  • Required return is the minimum return an investor expects to compensate for the risk of an investment.

  • Methods of calculating required return include Capital Asset Pricing Model (CAPM) and Dividend Discount Model (DDM).

  • CAPM formula: Required Return = Risk-Free Rate + Beta * (Market Return...read more

Add your answer
Q21. Can you explain the concept of virtual destructors in C++?
Ans.

Virtual destructors in C++ are used to ensure that the correct destructor is called when deleting an object through a base class pointer.

  • Virtual destructors are declared with the 'virtual' keyword in the base class to allow proper cleanup of derived class objects.

  • When deleting an object through a base class pointer, having a virtual destructor ensures that the destructor of the derived class is called.

  • Without a virtual destructor, only the base class destructor would be calle...read more

Add your answer

Q22. What are futures and forward contracts?

Ans.

Futures and forward contracts are financial agreements to buy or sell an asset at a specified price on a future date.

  • Futures contracts are standardized and traded on exchanges, while forward contracts are customized and traded over-the-counter.

  • Both contracts involve an agreement to buy or sell an asset at a predetermined price on a future date.

  • Futures contracts require daily settlement of gains and losses, while forward contracts settle at the end of the contract period.

  • Examp...read more

Add your answer

Q23. 1) Maximum meetings in one room 2)Bottom view of tree 3) Serialize deserialize binary tree 4) Difference between Virtual destructor in java and c++

Ans.

Interview questions for Software Developer Intern

  • Maximum meetings in one room can be calculated using greedy approach

  • Bottom view of tree can be obtained using level order traversal and a map to store horizontal distance

  • Serialization and deserialization of binary tree can be done using preorder traversal

  • Virtual destructor in Java is automatically called while in C++ it needs to be explicitly defined

Add your answer

Q24. Missing number in array in 1 to n

Ans.

Find the missing number in an array of integers from 1 to n.

  • Create a hash set to store the numbers in the array

  • Loop through the numbers from 1 to n and check if they are in the hash set

  • Return the number that is not in the hash set

Add your answer

Q25. Topological Sort along with dry run

Ans.

Topological Sort is a linear ordering of vertices in a directed acyclic graph.

  • It is used to find a linear ordering of elements that have dependencies.

  • It is based on the concept of DFS (Depth First Search).

  • It can be implemented using both DFS and BFS (Breadth First Search).

  • It is commonly used in scheduling jobs, resolving dependencies, and compiling code.

  • Example: Topological sorting of courses to take in a college based on prerequisites.

Add your answer

Q26. Find nth node from last in a linked list in one traversal

Ans.

To find nth node from last in a linked list in one traversal

  • Use two pointers, one at the head and the other at nth node from head

  • Move both pointers simultaneously until the second pointer reaches the end

  • The first pointer will be at the nth node from last

Add your answer

Q27. Design a 2 player chess game

Ans.

A 2 player chess game with standard rules and GUI

  • Implement standard chess rules and moves

  • Create a GUI for players to interact with the game

  • Allow players to make moves and track game progress

  • Incorporate checkmate and stalemate conditions

  • Implement a timer for each player's turn

Add your answer

Q28. Exposure to financial domain

Ans.

I have extensive exposure to the financial domain.

  • I have worked as a Product Manager for a financial services company for 3 years.

  • I have experience in developing and launching financial products such as credit cards, loans, and savings accounts.

  • I have a good understanding of financial regulations and compliance requirements.

  • I have collaborated with cross-functional teams including finance, legal, and compliance to ensure product success.

  • I have also conducted market research a...read more

View 1 answer

Q29. Left view of a tree

Ans.

The left view of a tree shows the nodes visible from the left side of the tree.

  • The leftmost node of each level is visible in the left view.

  • Nodes to the right of the leftmost node are not visible in the left view.

  • The left view can be obtained using a depth-first search or a breadth-first search algorithm.

Add your answer

Q30. left view of binary tree

Ans.

Left view of a binary tree is the set of nodes visible when the tree is viewed from the left side.

  • Traverse the tree level by level from left to right

  • At each level, add the first node encountered to the result array

  • Continue this process until all levels are traversed

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Sakthi Motors

based on 5 interviews
Interview experience
4.4
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.8
 • 334 Interview Questions
3.9
 • 256 Interview Questions
3.3
 • 150 Interview Questions
4.2
 • 142 Interview Questions
3.9
 • 140 Interview Questions
4.1
 • 140 Interview Questions
View all
Top Arcesium Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter