Premium Employer

ServiceNow

4.1
based on 387 Reviews
Filter interviews by

20+ Tau's Cafe And Lassi Bar Interview Questions and Answers

Updated 15 Nov 2024
Popular Designations

Q1. Given a container and 3 shapes of balls small , medium , large using each type of ball at least once how do you fit these balls so that the space wasted is minimized he was looking for a programmatic way of sol...

read more
Ans.

Programmatically fit small, medium, and large balls in a container to minimize wasted space.

  • Start by calculating the volume of the container.

  • Calculate the volume of each type of ball.

  • Use a loop to try all possible combinations of balls.

  • Calculate the total volume of each combination and keep track of the one with the least wasted space.

  • Return the combination with the least wasted space.

Add your answer

Q2. If a variable is protected in parent class and another variable with same name with public is declared in child class is this allowed is the reverse also allowed and how would you access parents variable in chi...

read more
Ans.

Yes, it is allowed. Access parent's variable using 'super' keyword.

  • Child class can have a variable with the same name as parent's protected variable.

  • Access parent's variable in child class using 'super' keyword.

  • Reverse is not allowed i.e. parent cannot have a public variable with the same name as child's protected variable.

Add your answer

Q3. There are 9 balls one ball is lighter out of them and we have a balance how would you find lighter ball in 2 weightings? (I told i knew this question so he moved on)

Ans.

Find the lighter ball among 9 balls in 2 weightings using a balance.

  • Divide the balls into 3 groups of 3 each.

  • Weigh any 2 groups against each other.

  • If they balance, the lighter ball is in the third group.

  • If they don't balance, the lighter ball is in the lighter group.

  • Take 2 balls from the lighter group and weigh them against each other.

  • If they balance, the lighter ball is the remaining one.

  • If they don't balance, the lighter ball is the lighter one.

Add your answer

Q4. what is the difference between microprocessor and microcontroler ? give an example for each and what is intel i7 ?

Add your answer
Discover Tau's Cafe And Lassi Bar interview dos and don'ts from real experiences

Q5. How do we find count of numbers between (a,b) both inclusive with no consecutive ones in the binary representation? They asked me 3 different approaches for this problem

Ans.

Count numbers between (a,b) with no consecutive ones in binary representation.

  • Use dynamic programming to count numbers with no consecutive ones.

  • Calculate count of numbers with no consecutive ones up to b and a-1.

  • Subtract the counts to get the final answer.

Add your answer

Q6. Difference between abstract class and interface what is the problem if I use abstract class when there are no implemented methods?

Ans.

Abstract class can have implemented methods, interface cannot. Using abstract class without implemented methods is unnecessary.

  • Abstract class can have constructors, fields, and implemented methods, while interface cannot.

  • Abstract class can be used to provide default implementations for methods that subclasses can override.

  • Interface is used to define a contract that implementing classes must follow.

  • Using abstract class without implemented methods is unnecessary and can be repl...read more

Add your answer
Are these interview questions helpful?

Q7. In a circularly linked list how would you ensure at least one node is left always even if you remove all the nodes ?

Ans.

To ensure at least one node is left in a circularly linked list, we can use a sentinel node.

  • Create a sentinel node and point it to the last node in the list.

  • When removing a node, check if it is the last node. If it is, remove it and point the sentinel node to the new last node.

  • If all nodes are removed, the sentinel node will still be present.

  • Example: If we have a circularly linked list with nodes A, B, and C, we can create a sentinel node S and point it to C. If we remove nod...read more

Add your answer

Q8. How to reduce the time of booting of the processor where we have no control on hardware devices but can only modify software (he was looking for more points here)?

Ans.

To reduce booting time of processor with no control on hardware, modify software by disabling unnecessary services and programs.

  • Disable unnecessary services and programs

  • Optimize startup programs

  • Remove malware and viruses

  • Update drivers and software

  • Defragment hard drive

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

Q9. Detecting a loop in a singly linked list what are the stopping condition if there is no loop?

Ans.

Stopping conditions for detecting a loop in a singly linked list if there is no loop.

  • If the current node or the next node is null, then there is no loop.

  • If the current node is the last node in the list, then there is no loop.

  • If the list has only one node, then there is no loop.

Add your answer

Q10. difference between functional and oo approach of problem solving . why oops is best

Add your answer

Q11. Difference between object oriented programming, functional programming, logic programming ?

Ans.

Object-oriented programming focuses on objects and their interactions, functional programming emphasizes on functions and their composition, and logic programming uses logical rules to solve problems.

  • Object-oriented programming uses classes and objects to encapsulate data and behavior.

  • Functional programming uses pure functions and immutable data to avoid side effects.

  • Logic programming uses logical rules and constraints to solve problems.

  • Examples of object-oriented programming...read more

Add your answer

Q12. Executable Code to Detect a Loop in a Singly Linked List without any mistake in first time with all boundry cases if any

Ans.

Use Floyd's Cycle Detection Algorithm to detect a loop in a singly linked list.

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

  • If there is a loop, the two pointers will eventually meet.

  • Handle boundary cases like an empty list or a list with only one node.

Add your answer

Q13. Space and time complexity to “Detecting a Loop in a Singly Linked List ”

Ans.

Space complexity O(1), time complexity O(n)

  • Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time

  • If there is a loop, the two pointers will eventually meet at the same node

  • Space complexity is O(1) as only two pointers are used, time complexity is O(n) as worst case is traversing the entire list

Add your answer

Q14. Design a system for putting newspapers using classes and functions taking different aspects into account

Add your answer

Q15. Find product of each element of an array except that element in O(N) time complexity without using / operation

Add your answer

Q16. Median of 2 sorted arrays in O(log N) time complexity and O(1) space complexity

Ans.

Use binary search to find the median of two sorted arrays in O(log N) time complexity and O(1) space complexity.

  • Use binary search to partition both arrays into two halves

  • Ensure that elements on the left side of the partition are smaller than elements on the right side

  • Calculate the median based on the partitioned arrays

Add your answer

Q17. Shortest path between 2 points in 2-D space in O(log N) time

Ans.

Using Dijkstra's algorithm, the shortest path between 2 points in 2-D space can be found in O(log N) time.

  • Dijkstra's algorithm is a popular algorithm for finding the shortest path between nodes in a graph.

  • In a 2-D space, the points can be represented as nodes in a graph with edges connecting them.

  • By applying Dijkstra's algorithm to this graph, the shortest path between the 2 points can be determined efficiently.

  • Example: Given points A(0,0) and B(3,4), the shortest path betwee...read more

Add your answer

Q18. Reverse level order traversal of a tree using Queue

Ans.

Reverse level order traversal of a tree using Queue

  • Start by pushing the root node into a queue

  • While the queue is not empty, dequeue a node, push its children into the queue, and add the node to a stack

  • Once the queue is empty, pop elements from the stack to get the reverse level order traversal

Add your answer

Q19. Level order traversal of a tree using Queue

Ans.

Level order traversal of a tree using Queue

  • Create an empty queue and enqueue the root node

  • While the queue is not empty, dequeue a node and print its value

  • Enqueue the left and right child nodes of the dequeued node

  • Continue this process until the queue is empty

Add your answer

Q20. Program to convert a given number into words

Ans.

A program to convert a given number into words.

  • Use a switch statement or if-else conditions to handle different cases for each digit

  • Break down the number into individual digits and convert each digit into its corresponding word

  • Handle special cases like numbers between 10 and 19 separately

  • Consider adding support for negative numbers and decimal places if required

Add your answer

Q21. Recursively deleting linked list from end

Ans.

To recursively delete a linked list from the end, traverse to the end of the list and delete nodes one by one.

  • Start by recursively moving to the end of the linked list

  • Delete the last node and update the previous node's next pointer to null

  • Repeat the process until the entire linked list is deleted

Add your answer

Q22. Difference between Floyd Warshall and Djikstra

Add your answer

Q23. what is microcontroller ?

Ans.

A microcontroller is a small computer on a single integrated circuit that contains a processor core, memory, and programmable input/output peripherals.

  • Microcontrollers are used in various applications such as embedded systems, robotics, and automation.

  • They are designed to execute specific tasks and are often used in devices that require real-time control.

  • Examples of microcontrollers include Arduino boards, PIC microcontrollers, and STM32 microcontrollers.

Add your answer

Q24. what is microprocessor ?

Add your answer

Q25. Strings Anagram in O(1) space complexity

Ans.

Check if two strings are anagrams by sorting and comparing them

  • Sort both strings and compare if they are equal

  • Use a hashmap to count characters in each string and compare the counts

Add your answer

Q26. Recursively deleting linked list

Ans.

Recursively delete a linked list by freeing memory of each node

  • Create a recursive function to delete nodes one by one

  • Update the next pointer of each node to NULL after freeing memory

  • Base case should be when the current node is NULL

Add your answer

Q27. BFS and DFS Difference

Ans.

BFS and DFS are two popular graph traversal algorithms with different approaches.

  • BFS explores nodes level by level, while DFS explores nodes depth by depth.

  • BFS uses a queue data structure, while DFS uses a stack or recursion.

  • BFS is optimal for finding shortest paths, while DFS is more memory efficient.

  • Example: BFS is used in finding the shortest path in a maze, while DFS is used in topological sorting.

Add your answer

Q28. Recursively deleting from end

Ans.

Recursively delete elements from the end of an array

  • Start by checking if the array is empty, if so return the array as is

  • If the array is not empty, recursively call the function with a smaller array each time

  • Base case: when the array is empty, return an empty array

Add your answer

Q29. Recursively deleting tree

Ans.

Recursively deleting a tree involves deleting all nodes starting from the leaves up to the root.

  • Start by deleting all child nodes of a parent node before deleting the parent node itself.

  • Use a recursive function to traverse the tree and delete nodes in a bottom-up manner.

  • Ensure to properly handle memory deallocation to avoid memory leaks.

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

Interview Process at Tau's Cafe And Lassi Bar

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

Top Interview Questions from Similar Companies

3.6
 • 4.6k Interview Questions
3.1
 • 686 Interview Questions
4.4
 • 433 Interview Questions
3.5
 • 384 Interview Questions
4.2
 • 223 Interview Questions
3.8
 • 157 Interview Questions
View all
Top ServiceNow 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