Add office photos
Engaged Employer

Think Future Technologies

4.0
based on 162 Reviews
Filter interviews by

20+ HEM Motors Interview Questions and Answers

Updated 27 Jan 2025

Q1. Merge Sort Problem Statement

You are given a sequence of numbers, ARR. Your task is to return a sorted sequence of ARR in non-descending order using the Merge Sort algorithm.

Explanation:

The Merge Sort algorit...read more

Ans.

Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.

  • Use Divide and Conquer approach to recursively divide the input array into two halves.

  • Merge the sorted halves to produce a completely sorted array.

  • Ensure the implementation handles the constraints specified in the problem statement.

  • Example: For input [3, 1, 4, 1, 5], the output should be [1, 1, 3, 4, 5].

Add your answer

Q2. Candies Distribution Problem Statement

Prateek is a kindergarten teacher with a mission to distribute candies to students based on their performance. Each student must get at least one candy, and if two student...read more

Ans.

The task is to distribute candies to students based on their performance while minimizing the total candies distributed.

  • Create an array to store the minimum candies required for each student.

  • Iterate through the students' ratings array to determine the minimum candies needed based on the adjacent ratings.

  • Consider both left-to-right and right-to-left passes to ensure fair distribution.

  • Keep track of the total candies distributed and return the final count.

Add your answer

Q3. Count Subarrays with Given XOR Problem Statement

You are given an array of integers ARR and an integer X. Your task is to determine the number of subarrays of ARR whose bitwise XOR is equal to X.

Example:

Input...read more
Ans.

Count the number of subarrays in an array whose XOR is equal to a given value.

  • Iterate through the array and keep track of XOR values and their frequencies using a hashmap.

  • For each element in the array, calculate the XOR value with all previous elements and check if it equals the given XOR value.

  • Use the concept of XOR to efficiently solve the problem.

  • Handle edge cases like XOR value being 0 separately.

  • Time complexity can be optimized to O(N) using a hashmap to store XOR values...read more

Add your answer

Q4. Distinct Characters Problem Statement

Given a string STR, return all possible non-empty subsequences with distinct characters. The order of the strings returned is not important.

Example:

Input:
STR = "cbc"
Out...read more
Ans.

Return all possible non-empty subsequences with distinct characters from a given string.

  • Iterate through all possible subsequences of the input string

  • Check for distinct characters in each subsequence

  • Return the distinct character subsequences as an array of strings

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

Q5. Pair Sum Problem Statement

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'.

Note:

Each pa...read more

Ans.

Given an array and a target sum, find pairs of elements that add up to the target sum.

  • Iterate through the array and for each element, check if the complement (target sum - current element) exists in a hash set.

  • If the complement exists, add the pair to the result list. Otherwise, add the current element to the hash set.

  • Sort the pairs based on the first element and then the second element to meet the required output format.

Add your answer

Q6. Split Array with Equal Sums Problem Statement

Given an array 'ARR' of size 'N', determine if there exists a triplet (i, j, k) satisfying the conditions: 0 < i , i + 1 < j , j + 1 < k and k < N - 1, such that th...read more

Ans.

The problem involves determining if there exists a triplet in an array such that the sums of specific subarrays are equal.

  • Iterate through all possible triplets (i, j, k) within the array.

  • Calculate the sums of the subarrays [0, i - 1], [i + 1, j - 1], [j + 1, k - 1], [k + 1, N - 1] for each triplet.

  • Check if any triplet satisfies the condition of having equal sums for the subarrays.

  • Return 'True' if such a triplet exists, otherwise return 'False'.

Add your answer
Are these interview questions helpful?
Q7. Can you provide an example of how to use pointers in C/C++ and discuss different concepts related to them?
Ans.

Pointers in C/C++ are variables that store memory addresses. They are used to manipulate memory directly and improve performance.

  • Pointers are declared using an asterisk (*) before the variable name.

  • Pointers can be used to dynamically allocate memory using functions like malloc() and free().

  • Pointers can be used to pass variables by reference to functions.

Add your answer

Q8. Lazy and Eagar loading N+1 problem

Ans.

Lazy loading delays loading of related data until it is specifically requested, while eager loading loads all related data upfront. N+1 problem occurs when lazy loading results in multiple additional queries being made.

  • Lazy loading is used to improve performance by only loading related data when needed

  • Eager loading loads all related data upfront to reduce the number of queries made

  • N+1 problem occurs in lazy loading when each entity requires an additional query to fetch relate...read more

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

Q9. Roles and Responsibilities of ETLand Data Tester

Ans.

ETL and Data Testers are responsible for testing the Extract, Transform, Load process and ensuring data quality and integrity.

  • Develop and execute test cases for ETL processes to ensure data accuracy and completeness

  • Identify and troubleshoot data quality issues and work with developers to resolve them

  • Validate data transformations and mappings to ensure they meet business requirements

  • Perform regression testing to ensure changes do not impact existing ETL processes

  • Document test ...read more

Add your answer

Q10. Add 1 in last array element and make it 10 and add carry to second index element

Ans.

Increment last element of array by 1 and carry over to second last element

  • Iterate through the array in reverse order

  • Increment the last element by 1 and check if it becomes 10

  • If last element becomes 10, set it to 0 and carry over 1 to the second last element

Add your answer

Q11. Foreign key in relational database

Ans.

Foreign key is a field in a relational database table that links to a primary key in another table.

  • Ensures referential integrity between tables

  • Used to establish relationships between tables

  • Prevents orphan records

  • Can be used to enforce constraints

Add your answer

Q12. Mid point of a linked list

Ans.

To find the mid point of a linked list, use two pointers - one moving at double the speed of the other.

  • Initialize two pointers, slow and fast, at the head of the linked list.

  • Move the slow pointer by one node and the fast pointer by two nodes until the fast pointer reaches the end of the list.

  • The node at which the slow pointer is currently pointing is the mid point of the linked list.

Add your answer

Q13. Max sum subarray problem

Ans.

Max sum subarray problem involves finding the subarray with the largest sum within an array.

  • Iterate through the array and keep track of the current sum and maximum sum seen so far.

  • If the current sum becomes negative, reset it to 0 as it won't contribute to the maximum sum.

  • Return the maximum sum found.

  • Example: For array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the max sum subarray is [4, -1, 2, 1] with sum 6.

Add your answer

Q14. what is ai ? tell me the usecases

Ans.

AI stands for Artificial Intelligence, which is the simulation of human intelligence processes by machines.

  • AI is used in healthcare for diagnosing diseases and recommending treatment plans.

  • AI is used in autonomous vehicles for navigation and decision-making.

  • AI is used in customer service for chatbots and virtual assistants.

  • AI is used in finance for fraud detection and algorithmic trading.

Add your answer

Q15. ACID Properties

Ans.

ACID properties are a set of properties that guarantee database transactions are processed reliably.

  • Atomicity: Ensures that all operations in a transaction are completed successfully or none at all.

  • Consistency: Ensures that the database remains in a consistent state before and after the transaction.

  • Isolation: Ensures that the execution of multiple transactions concurrently does not interfere with each other.

  • Durability: Ensures that once a transaction is committed, the changes...read more

Add your answer

Q16. Merge Sort Algorithm

Ans.

Merge Sort is a divide and conquer algorithm that divides the input array into two halves, sorts them separately, and then merges them.

  • Divide the array into two halves recursively

  • Sort each half separately

  • Merge the sorted halves back together

Add your answer

Q17. negative scenarios of pen,

Ans.

Negative scenarios of pen include ink leakage, broken tip, running out of ink, smudging, and losing cap.

  • Ink leakage can ruin documents or clothing

  • Broken tip can make writing difficult

  • Running out of ink can be frustrating in the middle of an important task

  • Smudging can make writing illegible

  • Losing cap can cause ink to dry out

Add your answer

Q18. test plan vs test statergy

Ans.

Test plan outlines the scope, approach, resources, and schedule of testing, while test strategy defines the overall testing approach.

  • Test plan details the specific test cases, test objectives, and test environment.

  • Test strategy defines the testing methods, tools, and techniques to be used.

  • Test plan is more detailed and focuses on individual test cases, while test strategy is high-level and focuses on overall testing approach.

  • Test plan is created by test engineers, while test ...read more

Add your answer

Q19. CRUD commands in API

Ans.

CRUD commands in API refer to Create, Read, Update, and Delete operations for interacting with data.

  • Create - POST request to add new data

  • Read - GET request to retrieve data

  • Update - PUT or PATCH request to modify existing data

  • Delete - DELETE request to remove data

Add your answer

Q20. Second largest no of array

Ans.

The second largest number in an array of strings

  • Convert the array of strings to an array of integers

  • Sort the array in descending order

  • Return the second element in the sorted array

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

Interview Process at HEM Motors

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

Top Interview Questions from Similar Companies

3.8
 • 2k Interview Questions
4.0
 • 376 Interview Questions
4.2
 • 177 Interview Questions
4.0
 • 167 Interview Questions
3.9
 • 157 Interview Questions
3.7
 • 134 Interview Questions
View all
Top Think Future Technologies 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