
Infibeam

20+ Infibeam Interview Questions and Answers
Q1. Which language do you prefer to code in? "Have you read The C Programming Language book by Dennis Retchie?" Which technical book have you read recently?.-So you like C, have you ever thought of bringing up the...
read moreYes, I prefer coding in C and have read The C Programming Language book. I have also explored the concept of Inheritance in C.
I find C to be a powerful and efficient language for system programming.
Yes, I have read The C Programming Language book by Dennis Retchie and found it to be a great resource.
Recently, I have been exploring the concept of Inheritance in C through various online resources and tutorials.
While C does not have built-in support for Inheritance, it is possib...read more
Q2. How to optimize the code that you had written in aptitude test - It was a discussion, he helped me in solving the problem
Optimizing code involves identifying and removing bottlenecks to improve performance.
Identify the parts of the code that are taking the most time to execute
Use efficient algorithms and data structures
Minimize the number of function calls and loops
Avoid unnecessary calculations or operations
Use caching or memoization to avoid repeating calculations
Profile the code to measure performance improvements
Q3. What is the reason behind inventing the concept of inheritance? Write a program and explain
Inheritance allows a class to inherit properties and methods from another class.
Inheritance promotes code reusability and saves time and effort in programming.
It allows for the creation of a hierarchy of classes with shared characteristics.
For example, a class Animal can be inherited by classes such as Dog, Cat, and Bird, which share common properties and methods.
Inheritance can be implemented using the 'extends' keyword in Java and the ':' symbol in Python.
Q4. How to deploy web application on apache tomcat?-What is Collections in Java?
To deploy a web application on Apache Tomcat, the application needs to be packaged as a WAR file and then deployed to the Tomcat server.
Create a WAR file of the web application
Copy the WAR file to the Tomcat webapps directory
Start the Tomcat server
Access the web application using the URL http://localhost:8080/
Collections in Java are classes that implement collections of objects, such as lists, sets, and maps
Q5. Gave a puzzle (find the heaviest ball amongst 8 balls in an optimized way). Tell the logic and write code for it.-write Create, Update, Delete, Insert, Select, Join SQL queries for a given problem
Optimized way to find the heaviest ball amongst 8 balls puzzle and SQL queries
Use binary search approach to divide the balls into groups and weigh them
Repeat the process with the heavier group until the heaviest ball is found
For SQL queries, use appropriate syntax for each operation and join tables based on common columns
Example SQL queries: INSERT INTO table_name (column1, column2, column3) VALUES (value1, value2, value3), SELECT column1, column2 FROM table_name WHERE condit...read more
Q6. What is the drawback of global variables?
Global variables can lead to unexpected changes and make debugging difficult.
Global variables can be accessed and modified from any part of the code, making it difficult to track changes.
They can cause naming conflicts if multiple variables with the same name are used in different parts of the code.
Using global variables can make it harder to test and debug code, as it can be difficult to isolate the cause of errors.
They can also lead to security vulnerabilities if sensitive ...read more
Q7. Why using 'goto' is a bad programming practice?
Using 'goto' can make code hard to read, maintain and debug.
Goto statements can create spaghetti code that is difficult to follow.
It can make it harder to understand the flow of the program.
It can also make debugging more difficult.
There are usually better alternatives to using goto, such as using loops or functions.
Some programming languages, such as Java and Python, do not even have a goto statement.
Using goto can also make it harder to reuse code in other parts of the prog...read more
Q8. Program to find the lowest common ancestor of two nodes in binary search tree as well as binary tree. I was also asked to give the brute force approach for the same
Program to find lowest common ancestor of two nodes in binary search tree and binary tree with brute force approach.
For binary search tree, traverse from root to both nodes and store the path. Then compare paths to find LCA.
For binary tree, traverse from root to both nodes and store the path. Then compare paths to find LCA.
Brute force approach involves checking each node's descendants to see if they contain both nodes.
Time complexity for brute force approach is O(n^2) for wor...read more
Q9. Given an unsorted array of numbers, find two numbers which add up to the given sum in O(n)
Find two numbers in an unsorted array that add up to a given sum in O(n)
Use a hash table to store the difference between the sum and each element in the array
Iterate through the array and check if the current element is in the hash table
If it is, return the current element and the corresponding difference
If not, add the current element to the hash table
Q10. What are implicit objects in JSP?
Implicit objects are pre-defined objects in JSP that can be accessed without being explicitly declared.
Implicit objects are created by the JSP container during the translation phase.
They can be accessed using predefined names such as request, response, session, application, out, pageContext, config, and exception.
For example, the request object can be used to retrieve parameters from a form or URL.
The session object can be used to store and retrieve user-specific data across ...read more
Q11. What is Liskov substitution principle?
Liskov substitution principle is a principle in object-oriented programming that states that objects of a superclass should be able to be replaced with objects of its subclasses without affecting the correctness of the program.
Subtypes must be substitutable for their base types
Derived classes must not change the behavior of the base class
Violating the principle can lead to unexpected behavior and errors
Example: A square is a rectangle, but if the Square class overrides the se...read more
Q12. Explain OOPs concepts with a program for each
Explanation of OOPs concepts with programs
Encapsulation: Wrapping data and functions into a single unit. Example: Class in Java
Abstraction: Hiding implementation details and showing only necessary information. Example: Abstract class in C#
Inheritance: Acquiring properties and behavior of a parent class. Example: Child class extending parent class in Python
Polymorphism: Ability of an object to take many forms. Example: Method overloading in Java
Q13. Name a web server and an application server
Apache is a popular web server and Tomcat is a widely used application server.
Apache is an open-source web server that supports multiple operating systems and is known for its stability and security.
Tomcat is a Java-based application server that is used to deploy Java web applications and supports servlets and JSPs.
Other popular web servers include Nginx and Microsoft IIS.
Other popular application servers include JBoss and WebSphere.
Web servers handle HTTP requests and respon...read more
Q14. Now write an optimized version of that code
Optimized version of given code
Use efficient data structures and algorithms
Avoid unnecessary loops and conditions
Minimize function calls and variable assignments
Q15. Program to print the elements of a matrix in spiral order recursively
Program to print matrix elements in spiral order recursively
Create a recursive function to print the elements in spiral order
Define the boundaries of the matrix and traverse the matrix in spiral order
Call the recursive function to print the elements in spiral order
Handle edge cases such as empty matrix or matrix with only one row/column
Q16. Program to print all ancestors of a node in a binary tree
Program to print all ancestors of a node in a binary tree
Create a recursive function to traverse the binary tree
Check if the current node is the target node
If yes, print all the nodes in the call stack
If not, recursively call the function for left and right subtrees
Q17. Write a code for dynamic polymorphism
Dynamic polymorphism is achieved through virtual functions and inheritance in object-oriented programming.
Create a base class with virtual functions
Create derived classes that override the virtual functions
Use pointers or references of the base class to call the virtual functions
The appropriate derived class function will be called based on the object being pointed to or referred to
Q18. Program to implement Dijkstra’s algorithm
Dijkstra's algorithm finds shortest path between nodes in a graph
Create a graph with nodes and edges
Initialize distances from source node to all other nodes as infinity
Set distance from source node to itself as 0
Create a set of unvisited nodes
While unvisited set is not empty, select node with minimum distance
For each neighbor of selected node, calculate distance from source node
If calculated distance is less than current distance, update distance
Mark selected node as visited
R...read more
Q19. Program to implement FloydWarshall’s agorithm
Floyd-Warshall's algorithm is used to find the shortest path between all pairs of vertices in a weighted graph.
Create a 2D array to store the distances between all pairs of vertices.
Initialize the array with the weights of the edges in the graph.
Use nested loops to iterate over all pairs of vertices and update the distances if a shorter path is found through a third vertex.
The final array will contain the shortest distances between all pairs of vertices.
Q20. Program to swap two pointers
A program to swap two pointers.
Declare two pointers of the same data type
Assign the first pointer to a temporary variable
Assign the second pointer to the first pointer
Assign the temporary variable to the second pointer
Q21. Explain indexing in DBMS
Indexing is a technique used in DBMS to improve the performance of queries.
Indexing creates a separate data structure that allows faster retrieval of data.
It works by creating a pointer to the location of data in the table.
Indexes can be created on one or more columns of a table.
Types of indexing include B-tree, hash, and bitmap indexing.
Indexes can also be clustered or non-clustered.
Clustered indexes determine the physical order of data in a table.
Non-clustered indexes creat...read more
Q22. Explain B and B+ trees
B and B+ trees are data structures used for efficient searching and sorting of large datasets.
B trees are balanced trees used for disk-based storage systems.
B+ trees are similar to B trees but have all data stored in the leaf nodes for faster searching.
B trees have a variable number of keys per node, while B+ trees have a fixed number.
B trees have a higher fanout than B+ trees, making them more efficient for smaller datasets.
B+ trees are commonly used in databases and file sy...read more
Interview Process at Infibeam

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

