Zomato
TSK Hospitality Interview Questions and Answers
You have been given a binary tree of 'N' unique nodes and a Start node from where the tree will start to burn. Given that the Start node will always exist in the tree, your task is to print the...read more
Q2. 1. bitwise OR of the sum of all the subsequence of the array [Hard] 2. course schedule II (leetcode question)
Two software development questions: bitwise OR of array subsequences and course schedule II.
Question 1 requires finding the bitwise OR of the sum of all subsequences of an array.
Question 2 is a LeetCode question about scheduling courses with prerequisites.
For question 1, we can use dynamic programming to find all subsequences and then calculate the bitwise OR.
For question 2, we can use a topological sort to determine the order in which courses should be taken.
Q3. A hash function was written to convert a string into a hash. Write a un-hash function to revert it(from hash to string)?
To un-hash a string, use a reverse algorithm to convert the hash back to the original string.
Create a reverse algorithm that takes the hash as input and outputs the original string
Use the same logic as the hash function but in reverse order
If the hash function used a specific algorithm, use the inverse of that algorithm to un-hash the string
Q4. Find angle between hour hand and minute hand in clock if time is given? Write a program or pseudo code?
Find angle between hour and minute hand in a clock given the time.
Calculate the angle made by the hour hand with respect to 12 o'clock position
Calculate the angle made by the minute hand with respect to 12 o'clock position
Find the difference between the two angles and take the absolute value
If the angle is greater than 180 degrees, subtract it from 360 degrees to get the smaller angle
Q5. Puzzle – 25 horses – 5 lanes, find fastest 3 horses?
25 horses in 5 lanes, find fastest 3 horses.
Divide horses into groups of 5 and race them, record the top 3 from each group.
Race the top 3 horses from each group and record the fastest 3.
Total of 7 races required to find the fastest 3 horses.
Q6. Print prime numbers in a given range and optimize the solution?
Print prime numbers in a given range and optimize the solution.
Use Sieve of Eratosthenes algorithm to generate prime numbers efficiently
Start with a boolean array of size n+1, mark all as true
Loop through the array and mark all multiples of each prime as false
Print all the indexes that are still marked as true
What is transaction? Why is it required ?
Q8. Write a regex for email validation?
Regex for email validation
Start with a string of characters followed by @ symbol
Followed by a string of characters and a period
End with a string of characters with a length of 2-6 characters
Allow for optional subdomains separated by periods
Disallow special characters except for . and _ in username
Q9. Given an array of n numbers , find the kth largest find the sum from a th largest to bth largest n can be huge
Find the sum of kth to bth largest numbers in a huge array efficiently.
Sort the array in descending order to easily find the kth and bth largest numbers.
Use a priority queue or min heap to efficiently find the kth and bth largest numbers without sorting the entire array.
Once you have the kth and bth largest numbers, iterate through the array and sum the numbers between them.
Interview Process at TSK Hospitality
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month