Add office photos
Engaged Employer

MakeMyTrip

3.7
based on 847 Reviews
Filter interviews by

100+ Heritage Foods Interview Questions and Answers

Updated 26 Dec 2024
Popular Designations

Q1. Minimum Jumps Problem Statement

Bob and his wife are in the famous 'Arcade' mall in the city of Berland. This mall has a unique way of moving between shops using trampolines. Each shop is laid out in a straight...read more

Add your answer

Q2. 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
Add your answer

Q3. Tower of Hanoi Problem Statement

You have three rods numbered from 1 to 3, and 'N' disks initially stacked on the first rod in increasing order of their sizes (largest disk at the bottom). Your task is to move ...read more

Add your answer

Q4. Cycle Detection in a Singly Linked List

Determine if a given singly linked list of integers forms a cycle or not.

A cycle in a linked list occurs when a node's next points back to a previous node in the list. T...read more

Add your answer
Discover Heritage Foods interview dos and don'ts from real experiences

Q5. Smallest Window Problem Statement

Given two strings, S and X, your task is to find the smallest substring in S that contains all the characters present in X.

Example:

Input:
S = "abdd", X = "bd"
Output:
"bd"
Ex...read more
Add your answer

Q6. Smallest Integer Not Representable as Subset Sum

Given a non-decreasing sorted array ARR of N positive numbers, determine the smallest positive integer that cannot be expressed as the sum of elements from any p...read more

Add your answer
Are these interview questions helpful?

Q7. Minimum Steps for a Knight to Reach Target

Given a square chessboard of size 'N x N', determine the minimum number of moves a Knight requires to reach a specified target position from its initial position.

Expl...read more

Add your answer

Q8. Minimum Operations Problem Statement

You are given an array 'ARR' of size 'N' consisting of positive integers. Your task is to determine the minimum number of operations required to make all elements in the arr...read more

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

Q9. Rat in a Maze Problem Statement

You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more

Add your answer

Q10. Combination Sum Problem Statement

Given an array of distinct positive integers ARR and a non-negative integer 'B', find all unique combinations in the array where the sum is equal to 'B'. Numbers can be chosen ...read more

Add your answer

Q11. Maximum Distance Problem Statement

Given an integer array 'A' of size N, your task is to find the maximum value of j - i, with the restriction that A[i] <= A[j], where 'i' and 'j' are indices of the array.

Inpu...read more

Add your answer

Q12. Count Inversions Problem Statement

Given an integer array ARR of size N, your task is to find the total number of inversions that exist in the array.

An inversion is defined for a pair of integers in the array ...read more

Add your answer

Q13. Next Greater Number Problem Statement

Given a string S which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequency from...read more

Add your answer

Q14. Make Array Elements Equal Problem Statement

Given an integer array, your objective is to change all elements to the same value, minimizing the cost. The cost of changing an element from x to y is defined as |x ...read more

Add your answer

Q15. find out the subset of an array of continuous positive numbers from a larger array whose sum of of the elements is larger in comparision to other subset. eg: {1,2 5 -7, 2 5} .The two subarrays are {1,2,5} {2,5}...

read more
Ans.

Find the subset of an array with the largest sum of continuous positive numbers.

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

  • If the current element is positive, add it to the current sum. If it is negative, reset the current sum to 0.

  • Also keep track of the start and end indices of the maximum sum subset.

  • Return the subset using the start and end indices.

Add your answer

Q16. Maximum Consecutive Ones Problem Statement

Given a binary array 'ARR' of size 'N', your task is to determine the maximum length of a sequence consisting solely of 1’s that can be obtained by converting at most ...read more

Add your answer

Q17. Number of Islands II Problem Statement

You have a 2D grid of dimensions 'N' rows by 'M' columns, initially filled with water. You are given 'Q' queries, where each query contains two integers 'X' and 'Y'. Durin...read more

Add your answer

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

Add your answer

Q19. Sub Sort Problem Statement

You are given an integer array ARR. Determine the length of the shortest contiguous subarray which, when sorted in ascending order, results in the entire array being sorted in ascendi...read more

Add your answer

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

Add your answer

Q21. Validate Binary Search Tree (BST)

You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).

BST Definition:

A Binary Search Tree (BST)...read more

Add your answer

Q22. Shortest Path in a Binary Matrix Problem Statement

Given a binary matrix of size N * M where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only of 1s...read more

Add your answer

Q23. Square Root with Decimal Precision Problem Statement

You are provided with two integers, 'N' and 'D'. Your objective is to determine the square root of the number 'N' with a precision up to 'D' decimal places. ...read more

Add your answer

Q24. Reach the Destination Problem Statement

You are given a source point (sx, sy) and a destination point (dx, dy). Determine if it is possible to reach the destination point using only the following valid moves:

    ...read more
Add your answer

Q25. Maximum Sum of Products for Array Rotations

You are given an array ARR consisting of N elements. Your task is to determine the maximum value of the summation of i * ARR[i] among all possible rotations of ARR. R...read more

Add your answer

Q26. Delete Node in Binary Search Tree Problem Statement

You are provided with a Binary Search Tree (BST) containing 'N' nodes with integer data. Your task is to remove a given node from this BST.

A BST is a binary ...read more

Add your answer

Q27. Longest Duplicate Substring Problem Statement

You are provided with a string 'S'. The task is to determine the length of the longest duplicate substring within this string. Note that duplicate substrings can ov...read more

Add your answer

Q28. In a normal e-commerce user flow, how will you determine the points at which the drop-off rates are high and what to do about them? (Take any e-commerce website and walk through the steps. You can use A/B Testi...

read more
Ans.

To determine high drop-off rates in e-commerce user flow, use analytics tools and A/B testing to identify and fix issues.

  • Use analytics tools like Google Analytics to track user behavior and identify points of drop-off

  • Conduct A/B testing to experiment with different solutions and determine which is most effective

  • Address issues such as slow page load times, confusing navigation, and lack of trust signals

  • Offer incentives such as free shipping or discounts to encourage users to c...read more

Add your answer

Q29. Given an integer array of size n, find the maximum circular subarray sum. A circular array means that the end of the array connects back to the beginning. The solution should consider both the non-circular maxi...

read more
Ans.

Find the maximum circular subarray sum in an integer array.

  • Calculate the non-circular maximum subarray sum using Kadane's algorithm.

  • Calculate the circular maximum subarray sum by subtracting the minimum subarray sum from the total sum.

  • Compare the non-circular and circular maximum subarray sums to get the overall maximum sum.

Add your answer
Q30. What are the types of polymorphism in Object-Oriented Programming?
Add your answer

Q31. You are given two strings s1 and s2.Now, find the smallest substring in s1 containing all characters of s2

Ans.

Find smallest substring in s1 containing all characters of s2.

  • Create a hash table of characters in s2

  • Use sliding window technique to find smallest substring in s1

  • Check if all characters in s2 are present in the substring

  • Update the smallest substring if a smaller one is found

Add your answer
Q32. What are the different OOP concepts?
Add your answer
Q33. How do you copy files in Linux?
Add your answer
Q34. What is a virtual function?
Add your answer

Q35. Guess estimate: How many people are there in ISB's cafeteria right now?

Ans.

It is not possible to accurately guess the number of people in ISB's cafeteria without available data.

  • Without available data, it is impossible to estimate the number of people in the cafeteria.

  • The number of people in the cafeteria can vary greatly depending on the time of day and other factors.

  • To provide an accurate estimate, data such as the cafeteria's capacity and current occupancy would be needed.

View 1 answer

Q36. Design a minimum stack that supports the following operations: push, pop, top, and retrieving the minimum element in constant time.

Ans.

Design a stack that supports push, pop, top, and retrieving minimum element in constant time.

  • Use two stacks - one to store the actual elements and another to store the minimum values encountered so far

  • When pushing an element, check if it is smaller than the current minimum and if so, push it to the minimum stack

  • When popping an element, check if it is the current minimum and if so, pop from the minimum stack as well

  • Top operation can be implemented by returning the top element ...read more

Add your answer

Q37. How ajax works? Difference between angular js and jquery?

Ans.

Ajax is a technique for creating fast and dynamic web pages. AngularJS is a framework for building dynamic web applications, while jQuery is a library for simplifying HTML DOM traversal and manipulation.

  • Ajax stands for Asynchronous JavaScript and XML

  • It allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes

  • AngularJS is a JavaScript framework that extends HTML with new attributes and makes it more responsive to user actions

  • It provid...read more

Add your answer

Q38. What is lazy loading? Advantages and disadvantages of the same?

Ans.

Lazy loading is a technique used to defer the loading of non-critical resources until they are needed.

  • Advantages: faster initial page load, reduced bandwidth usage, improved user experience

  • Disadvantages: increased complexity, potential for slower subsequent page loads, difficulty with SEO

  • Examples: images, videos, and other media files can be loaded only when they are visible on the screen

Add your answer

Q39. Program to find all possible combinations of elements from two sets of arrays such that the sum of elements is equal to one of the elements in the array itself.

Ans.

Program to find all possible combinations of elements from two sets of arrays such that the sum of elements is equal to one of the elements in the array itself.

  • Create two arrays of integers

  • Loop through both arrays and find all possible combinations

  • Check if the sum of elements is equal to any element in the array

  • Return all combinations that meet the criteria

Add your answer

Q40. What features will you add for WhatsApp and what features will you remove/improve in WhatsApp?

Ans.

I would add a feature for scheduling messages and improve the privacy settings while removing the 'forwarded' label.

  • Add a scheduling feature for messages to be sent at a later time

  • Improve privacy settings by allowing users to control who can add them to groups

  • Remove the 'forwarded' label to reduce the spread of misinformation

Add your answer

Q41. Given n starting with all 1 find the kth number example: n = 3, k= 4 1 1 1

Ans.

Given n starting with all 1, find the kth number.

  • The kth number is obtained by incrementing the binary representation of n.

  • Repeat until k-1 increments are done.

  • Return the final value of n.

Add your answer
Q42. What are the port numbers of protocols such as FTP and SMTP?
Add your answer
Q43. What is the difference between deep copy and shallow copy?
Add your answer

Q44. Program to find the next bigger number for the given number by just interchanging it's digits.ex- for 533224, answer is 533242

Ans.

Program to find the next bigger number for the given number by interchanging its digits.

  • Convert the number to a string to access individual digits

  • Start from the rightmost digit and find the first digit that is smaller than the digit to its right

  • Swap this digit with the smallest digit to its right that is greater than it

  • Sort the digits to the right of the swapped digit in ascending order

  • Convert the string back to a number and return

Add your answer

Q45. How your work will increase our revenue? By sharing the data we can improve our services.

Ans.

Sharing data insights can help improve services and identify revenue opportunities.

  • Analyzing customer behavior can help identify areas for improvement

  • Identifying trends in sales data can help optimize pricing strategies

  • Using data to personalize marketing efforts can increase customer engagement

  • Predictive modeling can help identify potential revenue opportunities

  • Tracking key performance indicators can help optimize business operations

Add your answer

Q46. Smallest window in a string containing all the characters of another string.(GFG)

Ans.

Find the smallest window in a string containing all characters of another string.

  • Use a sliding window approach to find the smallest window

  • Create a frequency map of characters in the second string

  • Slide the window and update the frequency map until all characters are found

  • Track the minimum window size and indices

View 1 answer
Q47. How would you design a traffic light system?
Add your answer
Q48. How does AJAX work?
Add your answer

Q49. Algorithm to find if any 5 numbers add up to the value of the Sum

Ans.

Use a hash set to store seen numbers and check if the complement of current number is in the set.

  • Iterate through the array and for each number, check if the complement of the current number is in the hash set.

  • If the complement is found, return true. Otherwise, add the current number to the hash set.

  • Repeat this process for all numbers in the array.

  • Example: Array [1, 2, 3, 4, 5] and Sum 9 should return true as 4 + 5 = 9.

Add your answer

Q50. Design a business plan for RedBus if it wants to enter into Indonesian market (Market Sizing, 4Ps, Competition etc.)

Ans.

RedBus can enter Indonesian market by targeting the growing middle class and partnering with local bus operators.

  • Conduct market research to identify target audience and competition

  • Partner with local bus operators to expand network and gain local expertise

  • Offer competitive pricing and promotions to attract customers

  • Invest in marketing and advertising to increase brand awareness

  • Ensure seamless user experience through website and mobile app

  • Consider offering additional services s...read more

Add your answer
Q51. What is the difference between AngularJS and jQuery?
Add your answer
Q52. Can you explain the OSI Model?
Add your answer

Q53. What is Redux state management? What is event loop, call back queue and call stack? Difference between let, const, var output questions based on set timeout, this, scoping. Coding question - zigzag string conve...

read more
Ans.

Redux is a predictable state container for JavaScript apps. Event loop, call stack, and callback queue manage asynchronous operations. let, const, var differ in variable scoping and reassignment. setTimeout delays execution. 'this' refers to the current context. Scoping determines variable accessibility.

  • Redux is a state management tool for JavaScript apps, ensuring predictable state changes.

  • Event loop manages the execution of callback functions, while call stack keeps track o...read more

Add your answer

Q54. What qualities should one have in sales?

Ans.

Salespeople should have good communication skills, be persistent, knowledgeable, and empathetic.

  • Excellent communication skills

  • Persistence and determination

  • Product and industry knowledge

  • Empathy and emotional intelligence

  • Ability to build relationships

  • Negotiation skills

  • Time management and organization

  • Adaptability and flexibility

Add your answer

Q55. 3. what is function overloading and overriding (difference between them)

Ans.

Function overloading and overriding are concepts in object-oriented programming that involve the use of multiple functions with the same name.

  • Function overloading refers to the ability to have multiple functions with the same name but different parameters in a class.

  • Function overriding refers to the ability to have a derived class provide a different implementation of a method that is already defined in its base class.

  • Overloading is resolved at compile-time based on the numbe...read more

Add your answer

Q56. Deadlocks,4 conditions of Deadlocks and ways of preventing Deadlock

Ans.

Deadlocks occur when two or more processes are waiting for each other to release resources, leading to a standstill.

  • 4 conditions of Deadlocks: mutual exclusion, hold and wait, no preemption, circular wait

  • Preventing Deadlocks: using a proper resource allocation strategy, implementing timeouts, avoiding circular wait, using deadlock detection and recovery algorithms

  • Example: Two processes each holding a resource and waiting for the other to release the resource, causing a deadlo...read more

Add your answer

Q57. Design a digital video streaming service. GTM and Monetization as well.

Ans.

A digital video streaming service with GTM and monetization.

  • Develop a user-friendly platform with a wide range of video content.

  • Implement a robust content delivery network (CDN) for seamless streaming.

  • Offer personalized recommendations based on user preferences and viewing history.

  • Integrate social sharing features to enhance user engagement.

  • Implement a subscription-based model with tiered pricing options.

  • Leverage targeted advertising to generate additional revenue.

  • Collaborate...read more

View 1 answer
Q58. Can you explain the concepts of multithreading and semaphore in operating systems?
Add your answer

Q59. Given a linked list with next and arbitrary pointers, clone it

Add your answer

Q60. Reverse the second half of the linked list in the most efficient way

Ans.

Reverse the second half of a linked list efficiently.

  • Find the middle node of the linked list

  • Reverse the second half of the linked list using a pointer

  • Update the pointers to connect the reversed second half with the first half

Add your answer

Q61. How will you increase the revenue of Netflix by 10x.

Ans.

To increase Netflix's revenue by 10x, we can focus on expanding the subscriber base, increasing subscription prices, and diversifying revenue streams.

  • Expand the subscriber base by targeting new markets and demographics

  • Increase subscription prices for premium features or exclusive content

  • Diversify revenue streams through partnerships, merchandise sales, or live events

Add your answer

Q62. Check whether linked list is Pallindrome or not

Ans.

To check if a linked list is a palindrome, compare the first half of the list with the reversed second half.

  • Traverse the linked list to find the middle element using slow and fast pointers.

  • Reverse the second half of the linked list.

  • Compare the first half with the reversed second half to check for palindrome.

Add your answer

Q63. Write algo for reversing a linked list

Ans.

Algorithm to reverse a linked list

  • Create a new empty linked list

  • Traverse the original linked list and insert each node at the beginning of the new list

  • Return the new list

Add your answer

Q64. Given a string a="aabbfaffb"; &amp; b="ab", write a code to replace given string and print "faffb"

Ans.

Replace substring in a given string and print the remaining string

  • Use string.replace() method to replace the substring

  • Print the remaining string using string slicing

Add your answer

Q65. Do you know something about google ad-words?

Ans.

Yes, Google AdWords is an online advertising platform developed by Google.

  • Google AdWords allows businesses to create and display ads on Google's search engine results pages and other websites.

  • It works on a pay-per-click model, where advertisers bid on keywords and pay for each click on their ads.

  • AdWords also offers various targeting options, such as location, language, device, and audience demographics.

  • It has now been rebranded as Google Ads and includes additional advertisin...read more

Add your answer

Q66. How will you measure the success of Google Pay?

Ans.

The success of Google Pay can be measured through user adoption rates, transaction volume, customer satisfaction, and revenue generated.

  • User adoption rates: Tracking the number of users who have downloaded and actively use the Google Pay app.

  • Transaction volume: Monitoring the total value and frequency of transactions processed through Google Pay.

  • Customer satisfaction: Conducting surveys or analyzing feedback to gauge user satisfaction with the app's features and performance.

  • R...read more

Add your answer

Q67. What is DNS(Domain Name System)

Ans.

DNS is a system that translates domain names to IP addresses, allowing users to access websites using human-readable names.

  • DNS is like a phone book for the internet, translating domain names (e.g. google.com) to IP addresses (e.g. 172.217.3.206).

  • DNS servers store records that map domain names to IP addresses, helping users navigate the internet.

  • DNS also helps with email delivery by translating domain names in email addresses to IP addresses for routing purposes.

Add your answer

Q68. What is meaning of customer service for you?

Ans.

Customer service is the provision of assistance and support to customers before, during, and after purchase.

  • Customer service involves actively listening to customers and addressing their concerns

  • It is important to provide timely and accurate information to customers

  • Going above and beyond to exceed customer expectations is a key aspect of customer service

  • Customer service can help build long-term relationships with customers and increase customer loyalty

  • Examples of good custome...read more

Add your answer

Q69. find the min steps to convert string a to b, you can use deletion, insertion and replace any number of times.

Ans.

Use dynamic programming to find the minimum steps to convert string a to b by deletion, insertion, or replacement.

  • Create a 2D array to store the minimum steps required to convert substrings of a to substrings of b.

  • Initialize the array with base cases for empty strings and iterate through the rest of the array to fill in the values based on previous calculations.

  • The final value in the bottom right corner of the array will be the minimum steps required to convert the entire str...read more

Add your answer

Q70. dba differnce/explain mysql or nosql databse

Ans.

MySQL is a relational database management system, while NoSQL databases are non-relational databases.

  • MySQL is a traditional relational database that uses tables to store data and SQL for querying.

  • NoSQL databases are non-relational and can be document-based, key-value pairs, wide-column stores, or graph databases.

  • MySQL is ACID-compliant and suitable for complex queries and transactions.

  • NoSQL databases are often used for large-scale distributed data storage and processing.

  • Examp...read more

Add your answer

Q71. Develop a 5-year strategy for MakeMyTrip.

Ans.

Develop a 5-year strategy for MakeMyTrip.

  • Expand into new markets and increase customer base

  • Invest in technology to improve user experience and streamline operations

  • Offer personalized travel packages and loyalty programs

  • Partner with airlines and hotels to offer exclusive deals

  • Focus on sustainability and responsible tourism

  • Explore opportunities in emerging technologies like AI and blockchain

Add your answer

Q72. Design a traffic light system?

Ans.

A traffic light system controls the flow of traffic at intersections.

  • The system consists of three lights: red, yellow, and green.

  • Each light has a specific duration for which it stays on.

  • The system also includes sensors to detect the presence of vehicles and pedestrians.

  • The duration of each light can be adjusted based on traffic patterns.

  • The system can be connected to a central control system for remote monitoring and management.

Add your answer

Q73. How do you think it aligns with MMT

Add your answer

Q74. Find the merging point of two linked list

Add your answer

Q75. What is GST and GST on commission?

Ans.

GST stands for Goods and Services Tax, a tax levied on the supply of goods and services in India.

  • GST is a comprehensive indirect tax that has replaced many indirect taxes in India.

  • It is levied on the value-added to goods and services at each stage of the supply chain.

  • GST on commission refers to the tax levied on the commission earned by a person or entity for providing services.

  • The rate of GST on commission varies depending on the type of service provided.

  • For example, the GST...read more

Add your answer

Q76. One java string question merge two strings diagonally.

Ans.

Merge two strings diagonally in a Java array of strings.

  • Iterate through each row and column to merge characters diagonally

  • Keep track of the diagonal position to insert characters from both strings

  • Handle cases where strings have different lengths

  • Example: String 1: 'hello', String 2: 'world', Merged: 'hweolrllod'

  • Example: String 1: 'abc', String 2: '123', Merged: 'a1b2c3'

Add your answer

Q77. How to teach a about computer?

Ans.

Teach computer basics through hands-on activities and interactive lessons.

  • Start with the basics of hardware and software

  • Introduce programming concepts through block-based coding

  • Encourage exploration and experimentation with different programs and tools

  • Teach internet safety and responsible use

  • Provide opportunities for students to collaborate and problem-solve

  • Use real-world examples to demonstrate the practical applications of computer science

Add your answer

Q78. What is Google's revenue model?

Ans.

Google's revenue model is primarily based on advertising through its search engine and other platforms.

  • Google earns revenue through its AdWords program, where advertisers bid on keywords to display their ads in search results and other Google platforms.

  • Google also earns revenue through its AdSense program, where website owners can display Google ads on their sites and earn a share of the revenue.

  • Other sources of revenue for Google include cloud services, hardware sales, and a...read more

Add your answer

Q79. create autosuggest debounce, pollyfill

Ans.

Autosuggest debounce is a feature that delays the search suggestions until the user stops typing, and a polyfill is a piece of code that provides functionality that is not natively supported by the browser.

  • Implement a debounce function to delay the autosuggest feature until the user stops typing.

  • Use a polyfill to provide support for the autosuggest feature in browsers that do not natively support it.

  • Example: Implement a debounce function that waits for 300ms after the user st...read more

Add your answer

Q80. Design an app similar to Uber but for Kids.

Ans.

An app similar to Uber for kids, providing safe and reliable transportation services for children.

  • Parents can schedule rides for their children through the app

  • Drivers are thoroughly vetted and background checked for safety

  • Real-time tracking and notifications for parents to monitor their child's journey

  • Option for parents to set restrictions on drop-off locations and who can pick up the child

  • Emergency contact feature for parents and drivers to communicate in case of any issues

Add your answer

Q81. If you get 500 error how to debug.

Ans.

To debug a 500 error, check server logs, review code changes, test API endpoints, and use debugging tools.

  • Check server logs for error details

  • Review recent code changes that may have caused the error

  • Test API endpoints using tools like Postman

  • Use debugging tools like Chrome DevTools or Firebug

Add your answer

Q82. What keyskills you have so we will select you.

Ans.

I have excellent communication skills, strong leadership abilities, and extensive experience in the travel industry.

  • Strong communication skills, both verbal and written

  • Leadership abilities and experience managing teams

  • Extensive knowledge and experience in the travel industry

  • Ability to analyze data and make informed decisions

  • Excellent customer service skills

  • Proficiency in relevant software and technology

  • Flexibility and adaptability to changing situations

  • Multilingual abilities

  • A...read more

Add your answer

Q83. 2. Can one edit standard libraries of C?

Add your answer

Q84. Detect loop in a LinkedList,

Ans.

Detect loop in a LinkedList

  • Use two pointers, one moving at twice the speed of the other

  • If there is a loop, the faster pointer will eventually catch up to the slower one

  • If there is no loop, the faster pointer will reach the end of the list

Add your answer

Q85. Reverse a linked list in groups of n

Ans.

Reverse a linked list in groups of n

  • Create a function that takes a linked list and a group size as input

  • Iterate through the linked list, reversing each group of nodes

  • Keep track of the previous and current node to update the pointers

  • Handle cases where the group size is larger than the remaining nodes

  • Return the head of the reversed linked list

Add your answer

Q86. Vertical level order traversal of a tree

Ans.

Vertical level order traversal of a tree involves traversing the tree level by level from left to right in vertical order.

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

  • Maintain a map to store nodes at each vertical level.

  • Start with root at vertical level 0 and update the vertical level for each node.

  • Example: For a tree with root 1, left child 2, and right child 3, the vertical level order traversal would be ['2', '1', '3'].

Add your answer

Q87. Do you have any idea how is it working

Ans.

Understanding how the role functions and the responsibilities involved.

  • The role involves providing support to customers, addressing their queries and concerns.

  • Requires strong communication skills to effectively interact with customers.

  • Involves troubleshooting technical issues and providing solutions.

  • May require working in a team to ensure customer satisfaction.

  • Understanding company products/services to better assist customers.

  • Continuous learning and updating knowledge to stay...read more

Add your answer

Q88. How is Uber pool beneficial?

Ans.

Uber pool is beneficial as it reduces traffic congestion, lowers transportation costs, and promotes social interaction.

  • Reduces traffic congestion by allowing multiple passengers to share a ride

  • Lowers transportation costs for passengers as they split the fare

  • Promotes social interaction by bringing people together who may not have otherwise met

  • Increases efficiency by reducing the number of cars on the road

  • Helps to reduce carbon emissions by reducing the number of cars on the ro...read more

Add your answer

Q89. When would Uber pool fail?

Ans.

Uber pool would fail if the demand for shared rides decreases or if the cost of providing the service becomes too high.

  • Decrease in demand for shared rides

  • Increase in cost of providing the service

  • Competition from other ride-sharing services

  • Regulatory changes affecting ride-sharing services

  • Safety concerns or incidents

  • Technological disruptions affecting the ride-sharing industry

Add your answer

Q90. 1. Difference between C and C++

Add your answer

Q91. tell me end to end operation

Ans.

End to end operation refers to the complete process from start to finish in a particular operation or project.

  • Start with understanding client requirements

  • Research and plan the trip itinerary

  • Book flights, accommodations, and activities

  • Provide necessary travel documents and information to the client

  • Ensure smooth travel experience and handle any issues that may arise

  • Follow up with the client for feedback and future bookings

Add your answer

Q92. Find element in sorted rotated array

Ans.

Search for an element in a sorted rotated array

  • Use binary search to find the pivot point where the array is rotated

  • Then perform binary search on the appropriate half of the array to find the element

  • Handle cases where the element is not found in the array

Add your answer

Q93. elevator system design

Ans.

Designing an elevator system involves considering factors like capacity, speed, efficiency, and safety.

  • Consider the number of floors in the building and the expected traffic flow to determine the number of elevators needed.

  • Choose between different elevator types such as hydraulic, traction, or machine-room-less based on building requirements.

  • Implement a control system to optimize elevator movement and reduce wait times for passengers.

  • Include safety features like emergency sto...read more

Add your answer

Q94. get a maximum sum from picking corner elements

Ans.

Find the maximum sum by picking corner elements of a matrix

  • Start by selecting the four corner elements of the matrix

  • Compare the sum of the diagonally opposite corners and choose the pair with the higher sum

  • Repeat the process with the remaining elements until all corners are picked

Add your answer

Q95. Kadanes algorithm

Ans.

Kadane's algorithm is used to find the maximum subarray sum in an array of integers.

  • Iterate through the array and keep track of the maximum sum ending at each index.

  • At each index, choose between extending the previous subarray or starting a new subarray.

  • Example: For array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the maximum subarray sum is 6 (from index 3 to 6).

Add your answer

Q96. calculate no of rows after join

Ans.

Calculate the number of rows after joining two datasets.

  • Count the number of rows in each dataset

  • Perform the join operation

  • Count the number of rows in the resulting dataset

Add your answer

Q97. How to handle pressure

Add your answer

Q98. number of buildings from n coins

Ans.

The number of buildings that can be built using n coins can be calculated using a mathematical formula.

  • Use the formula: number of buildings = floor(sqrt(2 * n + 0.25) - 0.5)

  • For example, if n = 5, then number of buildings = floor(sqrt(2 * 5 + 0.25) - 0.5) = floor(sqrt(10.25) - 0.5) = floor(3.2) = 3

Add your answer

Q99. Journal entry for acquisitions

Ans.

Journal entry for acquisitions

  • Debit the assets acquired account for the fair value of the assets acquired

  • Credit the cash or liabilities assumed account for the fair value of the consideration given

  • Record any goodwill or bargain purchase gain or loss

  • Example: Debit Assets Acquired for $500,000, Credit Cash for $400,000 and Credit Liabilities Assumed for $100,000

Add your answer

Q100. Db design in depth for spotify

Ans.

Designing a database for Spotify involves creating tables for users, songs, playlists, and interactions.

  • Create tables for users, songs, playlists, interactions

  • Use relational database management system like MySQL or PostgreSQL

  • Implement indexes for faster query performance

  • Normalize data to reduce redundancy

  • Consider sharding for scalability

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

Interview Process at Heritage Foods

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

Top Interview Questions from Similar Companies

4.0
 • 185 Interview Questions
3.8
 • 168 Interview Questions
4.0
 • 158 Interview Questions
3.7
 • 140 Interview Questions
3.8
 • 135 Interview Questions
3.8
 • 135 Interview Questions
View all
Top MakeMyTrip 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
70 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