Add office photos
Buyhatke logo
Employer?
Claim Account for FREE

Buyhatke

3.8
based on 12 Reviews
Filter interviews by

Buyhatke Interview Questions and Answers

Updated 17 Nov 2024

Q1. Shortest Route Problem Statement

You want to visit your friend’s house located at some position in an infinite grid starting from origin (0, 0). You can move in four directions: East (E), West (W), North (N), a...read more

Ans.

Given a directional string representing a route to a friend's house in an infinite grid, find the shortest lexicographically smallest route to reach the destination.

  • Iterate through the directional string and keep track of the movements in each direction (E, W, N, S).

  • Calculate the final position based on the movements and find the shortest lexicographically smallest route to reach that position.

  • Consider the constraints and optimize the solution to handle large inputs efficient...read more

Add your answer
right arrow

Q2. 0/1 Knapsack Problem Statement

A thief is planning to rob a store and can carry a maximum weight of 'W' in his knapsack. The store contains 'N' items where the ith item has a weight of 'wi' and a value of 'vi'....read more

Ans.

Yes, the 0/1 Knapsack problem can be solved using dynamic programming with a space complexity of not more than O(W).

  • Use a 1D array to store the maximum value that can be stolen for each weight capacity from 0 to W.

  • Iterate through each item and update the array based on whether including the item would increase the total value.

  • The final value in the array at index W will be the maximum value that can be stolen.

Add your answer
right arrow
Buyhatke Interview Questions and Answers for Freshers
illustration image

Q3. Time to Burn Tree Problem

You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely burn th...read more

Ans.

Calculate the time in minutes required to completely burn a binary tree starting from a given node.

  • Start burning from the given node and spread fire to adjacent nodes each minute

  • Track the time taken for each node to burn completely

  • Return the maximum time taken to burn the entire tree

Add your answer
right arrow

Q4. Find LCA of a binary tree, standard dsa medium problem

Ans.

LCA of a binary tree is the lowest common ancestor of two nodes in the tree.

  • Traverse the tree from the root node to find the paths from root to the two given nodes.

  • Compare the paths to find the last common node, which is the LCA.

  • Use recursion to solve the problem efficiently.

  • Handle edge cases like if one of the nodes is the ancestor of the other.

Add your answer
right arrow
Discover Buyhatke interview dos and don'ts from real experiences

Q5. Why did you use Swift over React Native?

Ans.

Swift was chosen for its performance, native iOS support, and better integration with Apple's ecosystem.

  • Swift offers better performance compared to React Native due to its native code execution.

  • Swift provides seamless integration with Apple's ecosystem, allowing for better utilization of iOS features.

  • Swift is the preferred choice for developing iOS apps as it is the native language for iOS development.

  • React Native may have limitations in accessing certain iOS features or APIs...read more

Add your answer
right arrow

Q6. What is Observable in Swift?

Ans.

Observable in Swift is a property wrapper that allows for automatic notifications when the value changes.

  • Observable is a property wrapper introduced in Swift 5.1.

  • It can be used with any property that needs to be observed for changes.

  • When the value of the property changes, any views using that property will be automatically updated.

  • Example: @Published var score: Int = 0

Add your answer
right arrow

Q7. implement depth first search in tree

Ans.

Depth first search in tree is implemented using recursion to explore each branch fully before moving to the next.

  • Start at the root node and recursively visit each child node before moving to the next sibling node.

  • Use a stack to keep track of nodes to visit, pushing children onto the stack before siblings.

  • Base case is when the current node is null or a leaf node, then backtrack to the parent node.

Add your answer
right arrow

Q8. what are foreign keys

Ans.

Foreign keys are columns in a database table that reference the primary key of another table, establishing a relationship between the two tables.

  • Foreign keys ensure referential integrity in a database by enforcing relationships between tables.

  • They help maintain data consistency by preventing actions that would violate the relationships between tables.

  • For example, in a database with tables for 'orders' and 'customers', the 'customer_id' column in the 'orders' table would be a ...read more

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

Interview Process at Buyhatke

based on 8 interviews
Interview experience
3.4
Average
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

JSW Steel Logo
3.9
 • 414 Interview Questions
KEC International Logo
4.0
 • 166 Interview Questions
ABB Logo
4.1
 • 160 Interview Questions
Bajaj Auto Logo
3.9
 • 152 Interview Questions
Statestreet HCL Services Logo
3.3
 • 142 Interview Questions
View all
Recently Viewed
INTERVIEWS
Prodesk
No Interviews
INTERVIEWS
Genpact
No Interviews
INTERVIEWS
Prodesk
No Interviews
INTERVIEWS
CGS
No Interviews
REVIEWS
Kohler
No Reviews
SALARIES
StoneX Group
REVIEWS
Wingman Partners
No Reviews
INTERVIEWS
Amazon
No Interviews
SALARIES
Kohler
INTERVIEWS
BYJU'S
No Interviews
Top Buyhatke Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
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