Jio
30+ Interview Questions and Answers
It was Todd’s Birthday, So Bojack decided to give Todd a Binary tree with ‘N’ nodes. But the binary tree was too big to keep in his house, so Bojack decided to give exactly three nodes from that tree ...read more
The task is to determine if it is possible to select three nodes from a binary tree such that their sum equals a given value.
Traverse the binary tree and store all the node values in an array
Use three nested loops to iterate through all possible combinations of three nodes
Check if the sum of the three nodes equals the given value
If a valid combination is found, return True
If no valid combination is found, return False
You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to find the In-Order traversal of the given binary tree.
For example :
For the given binary tr...read more
The task is to find the in-order traversal of a given binary tree.
Implement a recursive function to perform in-order traversal of the binary tree
Start from the left subtree, then visit the root, and finally visit the right subtree
Use an array to store the values of the nodes in the in-order traversal
You are given a binary tree. Your task is to check whether the given binary tree is a Complete Binary tree or not.
A Complete Binary tree is a binary tree whose every level,...read more
The task is to check whether a given binary tree is a complete binary tree or not.
A complete binary tree is a binary tree where every level, except possibly the last, is completely filled.
All nodes in the last level are placed at the left end.
To check if a binary tree is complete, we can perform a level order traversal and check if any null nodes appear before all non-null nodes in the last level.
If any null nodes appear before all non-null nodes in the last level, then the b...read more
You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a squar...read more
The task is to find all possible paths for a rat to reach its destination in a maze.
The maze is represented as a square matrix of 0s and 1s.
The rat starts at (0, 0) and the destination is at (N-1, N-1).
The rat can move in four directions: up, down, left, and right.
Use backtracking to explore all possible paths.
Print the paths in alphabetical order.
Your house is located at the origin of a 2-D plane. You have 'N' neighbours who live at 'N' different points on the plane. You want to visit exactly 'K' different neighbours who live c...read more
Given a binary tree, return the zigzag level order traversal of the nodes' values of the given tree. Zigzag traversal means starting from left to right, then right to left for the ne...read more
Why is multiple inheritance not allowed in java?
What is time theta?
What are java collections?
Q8. Write a program to store data in a file block by block, each block containing 100 bytes. Reserve first 4 bytes for reading index, second four bytes for writing index. Here index is the block index which is read...
read moreProgram to store data in file block by block with 100 bytes per block and first 4 bytes for reading index and second 4 bytes for writing index.
Use file handling functions to read and write data to file
Use a loop to write data block by block
Use a counter to keep track of block index
Use bitwise operators to extract index from first 4 bytes
Q9. How you can send one file from one system to another using C program?
Use sockets to establish a connection between two systems and transfer the file using file I/O operations.
Create a socket on the sender system using socket() function.
Bind the socket to a port using bind() function.
Establish a connection to the receiver system using connect() function.
Open the file to be transferred using fopen() function.
Read the file contents using fread() function.
Send the file contents using send() function.
Receive the file contents on the receiver system...read more
Q10. What is difference between path and classpath variables
Path variable is used to locate executable files while classpath variable is used to locate Java classes.
Path variable is used by the operating system to locate executable files.
Classpath variable is used by Java to locate classes and resources.
Path variable is system-specific while classpath variable is Java-specific.
Path variable is set by the user while classpath variable is set by the developer.
Example of path variable: C:\Windows\System32
Example of classpath variable: C:...read more
Building a product , best practices
Q12. How does static and extern differ from one another
Static and extern are storage classes in C/C++ with different functionalities.
Static variables have a local scope but retain their value between function calls.
Extern variables are declared outside a function and can be accessed by other files.
Static functions can only be called within the same file they are declared in.
Extern functions are declared in one file and can be used in other files.
Static classes and functions are used to restrict access to certain parts of the code...read more
Q13. Is java completely object oriented?
Yes, Java is completely object oriented.
Java is designed to be completely object oriented.
All code in Java is written inside classes and objects.
Java supports encapsulation, inheritance, and polymorphism.
Java does have some non-object oriented features like primitive data types.
However, even these can be treated as objects using wrapper classes.
Q14. What is half duplex and full duplex ?
Half duplex allows communication in both directions, but only one direction at a time. Full duplex allows simultaneous communication in both directions.
Half duplex is like a walkie-talkie where only one person can speak at a time.
Full duplex is like a phone call where both parties can speak and listen at the same time.
Examples of half duplex devices include Ethernet hubs and some two-way radios.
Examples of full duplex devices include Ethernet switches and telephones.
Q15. What are the storage classes in C.
C has four storage classes: auto, register, static, and extern.
Auto: default storage class for local variables
Register: stores variables in CPU registers for faster access
Static: retains value between function calls
Extern: used to access global variables across multiple files
Q16. Build stack from scratch without using custom data structures
Implementing a stack using arrays without custom data structures
Use an array to store the elements of the stack
Keep track of the top of the stack using a variable
Implement push operation by adding elements to the end of the array
Implement pop operation by removing elements from the end of the array
Q17. Do you know STL. Find loop in linked list.
STL knowledge and finding loop in linked list
STL (Standard Template Library) is a C++ library that provides containers, algorithms, and iterators.
To find a loop in a linked list, we can use Floyd's cycle-finding algorithm.
In this algorithm, we use two pointers, one moving at a slower pace and the other at a faster pace.
If there is a loop in the linked list, the faster pointer will eventually catch up to the slower pointer.
We can then reset one of the pointers to the head of t...read more
Q18. what is different between Mysql Vs sql ?
MySQL is a specific implementation of SQL, which is a standardized language for managing databases.
MySQL is a specific relational database management system (RDBMS) that uses SQL as its query language.
SQL (Structured Query Language) is a standardized language for managing databases, used by various RDBMS like MySQL, Oracle, and SQL Server.
MySQL is open-source and free to use, while some other RDBMS like Oracle may require a license.
MySQL has specific features like InnoDB stor...read more
Q19. what abstraction and interface in java?
Abstraction and interface are key concepts in Java for achieving abstraction and defining contracts for classes.
Abstraction in Java is achieved using abstract classes and interfaces.
Abstract classes can have both abstract and concrete methods, while interfaces can only have abstract methods.
Interfaces define contracts that classes must implement, allowing for polymorphism and loose coupling.
Example: interface Shape { void draw(); }
Example: abstract class Animal { abstract voi...read more
Q20. Linkedlist add and delete node concept with code
Linkedlist add and delete node concept with code
To add a node to a linked list, create a new node and update the next pointer of the current last node to point to the new node
To delete a node from a linked list, update the next pointer of the previous node to skip over the node to be deleted
Q21. What is exception in java?
Exception is an event that occurs during the execution of a program and disrupts the normal flow of instructions.
Exceptions are objects that are thrown at runtime when an abnormal condition occurs
Java provides a set of predefined exceptions that can be used to handle errors
Exceptions can be caught and handled using try-catch blocks
Unchecked exceptions are those that are not checked at compile-time, while checked exceptions are checked at compile-time
Q22. What is binary tree and implement
A binary tree is a data structure where each node has at most two children.
Consists of nodes, each with a left and right child pointer
Root node is the topmost node
Traversal methods include in-order, pre-order, and post-order
Q23. What is 2 phase commit
2 phase commit is a protocol used to ensure distributed transactions are either committed or rolled back.
Used in distributed systems where multiple databases are involved in a transaction
Ensures all databases either commit or rollback the transaction
Involves a coordinator and multiple participants
Coordinator sends a prepare message to participants, who respond with either commit or abort
If all participants respond with commit, the coordinator sends a commit message
If any part...read more
Q24. What is serial protocol?
Serial protocol is a communication protocol used to transmit data between devices one bit at a time.
Serial protocol is used in many applications such as RS-232, SPI, I2C, and USB.
It is a simple and reliable way to transmit data over a long distance.
Serial protocol can be synchronous or asynchronous.
It is commonly used in embedded systems and communication between microcontrollers and sensors.
Q25. How to handle dead locks?
Deadlocks can be handled by using techniques like prevention, avoidance, detection, and recovery.
Use prevention techniques like ensuring a strict ordering of resource requests to avoid circular wait.
Implement avoidance techniques like ensuring that resources are only allocated if they can be used without causing a deadlock.
Detect deadlocks by periodically checking for circular wait conditions and taking appropriate actions.
Recover from deadlocks by aborting one or more proces...read more
Q26. What is race condition?
Race condition is a situation in which the outcome of a program depends on the order of execution of its threads.
Occurs when multiple threads access shared data and try to change it at the same time
Can lead to unpredictable behavior and bugs in the program
Prevented by using synchronization techniques like locks and semaphores
Q27. 1-balance binary tree after deletion of node
To balance a binary tree after deletion of a node, we can use rotations and reordering of nodes.
Perform rotations to maintain balance factor of nodes
Reorder nodes to ensure tree remains balanced
Examples: AVL tree, Red-Black tree
Q28. What is enum in java
Enum is a special data type in Java used to define a set of constants.
Enums are used to represent a fixed number of values that do not change.
They are declared using the enum keyword.
Each enum constant is an object of the enum type.
Enums can have constructors, methods, and fields.
Example: enum Color { RED, GREEN, BLUE }
Enums can also have values associated with them, like Color.RED(255, 0, 0).
Q29. able to handle work pressure?
Yes, I am able to handle work pressure.
I prioritize tasks and manage my time effectively
I communicate with my team and ask for help when needed
I take breaks and practice stress-relieving techniques
I stay organized and focused on the end goal
Q31. what is mean by JSP?
JSP stands for JavaServer Pages, a technology used for creating dynamic web pages.
JSP allows embedding Java code in HTML pages
It simplifies the process of creating dynamic web content
JSP files are compiled into servlets by the server for execution
Q32. What is deadlock
Deadlock is a situation in which two or more processes are unable to proceed because each is waiting for the other to release a resource.
Occurs in multitasking environments
Caused by a circular dependency of resources
Can be resolved by using techniques like resource allocation graph
Example: Process A holds Resource 1 and waits for Resource 2, while Process B holds Resource 2 and waits for Resource 1
More about working at Jio
Top HR Questions asked in null
Interview Process at null
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month