Times Internet
20+ Fabcare And Facade Interview Questions and Answers
There are 20 red balls and 16 blue balls in a bag. Any 2 balls are removed at each step and are replaced with a new ball on the basis of the following conditions:
If they are of the same color, then they a...read more
You are given an array 'ARR' of integers of length N. Your task is to find the first missing positive integer in linear time and constant space. In other words, find the lowest positive in...read more
Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of th...read more
A binary array is an array consisting of only 0s and 1s.
You are given a binary array "arr" of size ‘N’. Your task is to sort the given array and return this array after sorting.
Input Forma...read more
You are given a positive integer ‘n’. Your task is to find the largest prime factor of this given positive integer.
Note :
If there is no prime factor of a given integer, then print -1.
Inp...read more
You have been given a Binary Search Tree of integers with ‘N’ nodes. You are also given data of a node of this tree. Your task is to delete the given node from the BST.
A binary search tree (B...read more
Q7. 20 red balls and 16 blue balls are present in a bag. 2 balls are removed, if they are of the same color, then they are replaced by a red ball. If they are of different color, then they are replaced with a blue ...
read moreBalls are removed and replaced based on color. Find the last ball remaining.
Start with 20 red and 16 blue balls
Remove 2 balls and replace based on color
Repeat until only one ball remains
You have been given a root node of the binary search tree and a positive integer value. You need to perform an insertion operation i.e. inserting a new node with the given value ...read more
You are provided with 8 identical balls and a measuring instrument. 7 of the eight balls are equal in weight and one of the eight given balls is defective and weighs heavier. The task is to find the defec...read more
Q10. Find the second largest prime number from a given array of positive integers. Also return it's index in most optimal way
Find the second largest prime number and its index from an array of positive integers.
Iterate through the array and check if each number is prime
Store the largest and second largest prime numbers found so far
Also store their indices
Return the second largest prime number and its index
Q11. If a person travels from point A to point B at 20 km/h and returns at 30 km/h, calculate the average speed without using pen and paper.
The average speed can be calculated by taking the harmonic mean of the two speeds.
To calculate the harmonic mean, divide the sum of the speeds by the reciprocal of the sum of their reciprocals.
In this case, the harmonic mean can be calculated as 2/(1/20 + 1/30) = 24 km/h.
Q12. Which data structure would i use to program a jigsaw puzzle program and what methods would i use to solve the puzzle
The data structure to program a jigsaw puzzle program would be a graph.
Use a graph data structure to represent the puzzle pieces and their connections.
Each puzzle piece can be represented as a node in the graph.
Edges between nodes represent the connections between puzzle pieces.
To solve the puzzle, use graph traversal algorithms like depth-first search or breadth-first search.
Apply puzzle-solving strategies like finding corner pieces first or matching edge colors.
Q13. Given 8 balls of the same properties and one of these balls is defective and is heavier than the others. Calculate the minimum no. of steps to find the defective ball
The minimum number of steps to find the defective ball is 2.
Divide the 8 balls into 3 groups of 3, 3, and 2 balls.
Compare the weights of the two groups of 3 balls.
If one group is heavier, divide it into 2 balls and compare their weights.
If the two balls have different weights, the heavier ball is the defective one.
If the two balls have the same weight, the remaining ball in the first group of 3 is the defective one.
Q14. Given an array of positive and negative integers, find the first missing positive number in the most optimal way
Find the first missing positive number in an array of positive and negative integers.
Sort the array in ascending order
Iterate through the sorted array and find the first positive number that is missing
If no positive number is missing, return the next positive number after the largest positive number in the array
If a person travels from point A to point B at 20 km/h and returns at 30 km/h, calculate the average speed without using pen and paper.
Q16. What is operator overloading?. Give an example
Operator overloading is the ability to redefine operators for custom classes.
Allows operators to be used with custom classes
Example: '+' operator can be used to concatenate strings
Can improve readability and simplify code
What is operator overloading?
Differentiate between method overloading and method overriding
What is Polymorphism?
Q20. Differentiate between method overloading and method overriding
Method overloading is having multiple methods with the same name but different parameters. Method overriding is having a method in a subclass with the same name, return type, and parameters as a method in its superclass.
Method overloading is achieved within the same class.
Method overriding occurs in a subclass that inherits from a superclass.
Method overloading is determined at compile-time based on the number, type, and order of parameters.
Method overriding is determined at r...read more
Q22. What is polymorphism with examples
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.
Polymorphism is achieved through method overriding and method overloading.
Method overriding allows a subclass to provide a specific implementation of a method that is already defined in its superclass.
Method overloading allows multiple methods with the same name but different parameters to be defined in a class.
Polymorphism enables code reusabi...read more
Q23. Delete a Node in Linked list.
To delete a node in a linked list, we need to find the node and update the pointers of its previous and next nodes.
Find the node to be deleted by traversing the linked list
Update the pointers of the previous and next nodes to skip the node to be deleted
Free the memory occupied by the node to be deleted
Top HR Questions asked in Fabcare And Facade
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month