Q. Detect a loop in a linked list
asked 2xmediumLinked listsTechnical2015-2017
Ans. Use Floyd’s cycle detection with two pointers, slow and fast, starting at the head. Move slow one node at a time and fast two nodes at a time. If they ever meet, there is a loop. If fast reaches null, there is no loop. This runs in O(n) time and O(1) space.
Q. Explain the OSI model and its layers.
asked 2xeasyNetworkingTechnical2016-2021
Ans. The OSI model has seven layers: physical, data link, network, transport, session, presentation and application. They describe how data moves from raw bits on a medium, through framing, routing and reliable delivery, up to user-facing protocols. The key idea is separation of concerns, so each layer provides services to the one above.
Q. Explain the Software Development Life Cycle (SDLC)
asked 2xeasySoftware engineeringTechnical2016-2023
Ans. SDLC is a structured process for planning, building, testing, deploying, and maintaining software. It gives teams a clear path from requirements to release, reducing risk and improving quality. Common stages include requirement analysis, design, implementation, testing, deployment, and maintenance, often repeated in agile or iterative models.
Q. Logical reasoning problems
asked 1xmediumLogical reasoningOnline test2016
Ans. Break the problem into facts, rules, and conclusions. Translate each statement into simple conditions, then test what must be true, what could be true, and what cannot be true. Use tables, diagrams, or symbols if helpful. Eliminate answers that break a rule, and choose the option supported by all information.
Q. Implement a doubly linked list
asked 1xmediumLinked listsTechnical2016
Ans. Implement it with a Node holding value, previous, and next references, and a list holding head, tail, and optionally size. Insert by relinking neighbouring pointers, delete by reconnecting previous and next, and update head or tail at boundaries. Search is O(n), while insert or delete with a known node is O(1).
Q. What is static binding in C++?
asked 1xmediumOOPTechnical2015
Ans. Static binding in C++ means the compiler decides at compile time which function or operation a call refers to. It applies to non-virtual functions, overloaded functions, operators, and object types known at compile time. The key point is that it is faster than dynamic binding but does not support runtime polymorphic dispatch.
Q. Implement a linked list in Java
asked 1xmediumLinked listsTechnical2015
Ans. Implement it with a Node class holding data and a next reference, and a LinkedList class holding the head, optionally the tail and size. Insertion at the head is O(1), insertion at the tail is O(1) with a tail pointer, and search or deletion by value is O(n).
Q. Explain exception handling in Java
asked 1xmediumJava basicsTechnical2015
Ans. Exception handling in Java is a mechanism for dealing with runtime errors without abruptly stopping normal program flow. Risky code is placed in a try block, errors are handled in catch blocks, and cleanup goes in finally. Java has checked exceptions, which must be caught or declared, and unchecked exceptions.
Q. Explain all layers of the OSI model
asked 1xmediumNetworkingTechnical2016
Ans. The OSI model has seven layers: physical moves raw bits, data link handles frames and MAC addressing, network routes packets with IP, transport provides end-to-end delivery with TCP or UDP, session manages conversations, presentation handles encoding and encryption, and application provides network services to user-facing programs. Each layer abstracts the one below it.
Q. What are CPU scheduling algorithms?
asked 1xmediumOperating systemsTechnical2017
Ans. CPU scheduling algorithms decide which ready process gets the CPU next. Common algorithms include First Come First Served, Shortest Job First, Round Robin, Priority Scheduling and Multilevel Queue. The key trade-off is between throughput, response time, waiting time and fairness, with pre-emptive algorithms allowing the OS to interrupt a running process.
Q. What is BFS? Explain the BFS algorithm.
asked 1xmediumGraphsTechnical2023
Ans. BFS, or Breadth First Search, is a graph traversal algorithm that visits nodes level by level from a starting node. It uses a queue: mark the start as visited, enqueue it, then repeatedly dequeue a node and enqueue each unvisited neighbour. Its time complexity is O(V + E).
Q. Explain aggregation and association in Java
asked 1xmediumOOPTechnical2015
Ans. Association is any relationship between Java objects, while aggregation is a specific has-a association where one object contains or refers to another, but the contained object can exist independently. In Java, both are usually represented with fields or collections of references. Aggregation is weaker than composition because ownership is not exclusive.
Q. Explain abstract classes and interfaces in Java
asked 1xmediumOOPTechnical2015
Ans. Abstract classes define a partial base implementation, while interfaces define a contract a class agrees to fulfil. An abstract class can have fields, constructors, concrete methods, and abstract methods, but a class can extend only one. A class can implement multiple interfaces, which mainly specify behaviours and may include default or static methods.
Q. What is paging? Explain different types of paging
asked 1xmediumOperating systemsTechnical2016
Ans. Paging is a memory management technique that divides a process into fixed-size pages and physical memory into equal-size frames. The OS maps pages to frames using a page table, allowing non-contiguous allocation and avoiding external fragmentation. Main types include simple paging, demand paging where pages load only when needed, and prepaging where likely-needed pages load in advance.
Q. Explain deadlock prevention and recovery techniques
asked 1xmediumOperating systemsTechnical2016
Ans. Deadlock prevention avoids deadlocks by ensuring at least one Coffman condition cannot hold, such as denying hold and wait, allowing preemption, or imposing a strict resource ordering. Recovery allows deadlocks to occur, detects them using a wait-for graph or similar method, then breaks them by aborting processes, preempting resources, or rolling back work.
Q. What are the two ways to implement threads in Java?
asked 1xmediumMultithreadingTechnical2015
Ans. The two common ways are extending the Thread class or implementing the Runnable interface. In both cases, the work goes in the run method, and execution starts by calling start on a Thread object. Runnable is usually preferred because Java supports only single inheritance and it separates the task from the thread.
Q. Delete a node from the middle of a singly linked list.
asked 1xmediumLinked listsTechnical2015
Ans. Copy the value from the next node into the given node, then change the given node’s next pointer to skip that next node. This deletes the logical node without needing the head pointer. It only works if the node is not the tail. Time is O(1) and space is O(1).
Q. Given a case study, how would you approach and solve it?
asked 1xmediumProblem solvingHR2021
Ans. Pick a case that shows structured problem solving under uncertainty. Emphasise clarifying the objective, identifying constraints, forming hypotheses, prioritising analysis, using evidence, and making a practical recommendation. Interviewers listen for clear thinking, commercial judgement, sensible assumptions, communication, and whether you can explain trade-offs rather than jump to an unsupported answer.
Q. What is deadlock? Explain avoidance and prevention techniques
asked 1xmediumOperating systemsTechnical2016
Ans. Deadlock prevention stops deadlock by ensuring at least one necessary condition can never hold, while deadlock avoidance only grants requests that keep the system in a safe state. Prevention may remove mutual exclusion, hold-and-wait, no pre-emption, or circular wait. Avoidance commonly uses Banker’s algorithm with declared maximum resource needs.
Q. Design the layout and basic architecture of the IRCTC website.
asked 1xmediumWeb system designSystem design2015
Ans. Design IRCTC with a simple search-first layout and a scalable service architecture behind it. The UI should have login, train search, availability, fare, booking, payment, PNR status and cancellation flows. Backend services should cover users, trains, inventory, booking and payments, with caching, queues, locking and read replicas to handle peak traffic safely.
Q. Find the Longest Common Subsequence (LCS) between two strings.
asked 1xmediumDynamic programmingTechnical2023
Ans. Use dynamic programming with a 2D table where dp[i][j] stores the LCS length for the first i characters of one string and first j of the other. If characters match, add one from dp[i-1][j-1]; otherwise take the maximum of top or left. Time and space are O(nm).
Q. Implement Validate.php for input validation in a web application.
asked 1xmediumWeb developmentSystem design2015
Ans. Implement Validate.php as a reusable validator that accepts input data and a rules map, then returns cleaned values plus field-level errors. Store rules in an associative array keyed by field name, such as required, type, length, pattern and allowed values. Validate server-side only as trusted enforcement. Time complexity is O(nr), for fields times rules.
Q. Write code to insert a node in the middle of a doubly linked list
asked 1xmediumLinked listsTechnical2016
Ans. Insert by finding the middle node with a slow and fast pointer, then link the new doubly linked list node after that middle node. Set newNode.prev to middle, newNode.next to middle.next, update middle.next.prev if it exists, then set middle.next to newNode. This takes O(n) time and O(1) space.
Q. Draw an ER diagram for a database system and explain the tables used
asked 1xmediumDBMSTechnical2016
Ans. An ER diagram for a library system has Member, Book, Loan and Author entities. Member to Loan is one-to-many, Book to Loan is one-to-many, and Book to Author is many-to-many through BookAuthor. Tables are Member(member_id, name), Book(book_id, title), Loan(loan_id, member_id, book_id, dates), Author(author_id, name), and BookAuthor(book_id, author_id).
Q. What is multithreading and how is it different from multiprocessing?
asked 1xmediumOperating systemsTechnical2017
Ans. Multithreading means running multiple threads within the same process, sharing the same memory space, while multiprocessing means running multiple separate processes, each with its own memory. Threads are lighter and cheaper to create, but need careful synchronisation. Processes are more isolated and robust, but communication between them is usually slower and more expensive.
Q. What are dangling pointers in C/C++ and how can this error be removed?
asked 1xmediumOOPTechnical2016
Ans. Dangling pointers are pointers that still hold the address of memory that is no longer valid, such as memory freed with free or delete, or a local variable after its scope ends. Remove this risk by clearing pointers after release, avoiding addresses of locals, and preferably using RAII and smart pointers in C++.
Q. Quantitative aptitude problems (mixed arithmetic and reasoning questions)
asked 1xmediumQuantitativeOnline test2016
Ans. Solve mixed quantitative aptitude questions by first identifying the topic, such as percentages, ratios, time and work, averages, profit and loss, or number series. Write down the given values, choose the shortest formula or logical relation, and calculate step by step. Estimate first where possible to eliminate unlikely options and avoid lengthy arithmetic.
Q. Explain inheritance in Java and whether Java supports multiple inheritance
asked 1xmediumOOPTechnical2015
Ans. Inheritance in Java lets a class acquire fields and methods from another class using extends, enabling code reuse and polymorphism. Java does not support multiple inheritance of classes, so a class can extend only one class. However, it can implement multiple interfaces, which provides multiple type inheritance without the ambiguity of shared implementation.
Q. Implement Insert.php for handling database insertion in a web application.
asked 1xmediumWeb developmentSystem design2015
Ans. Implement Insert.php by accepting POST data, validating and sanitising required fields, then inserting with a parameterised prepared statement using PDO or MySQLi. Store incoming fields in an associative array mapped to column names. Return a clear success or error response. The insert is typically O(1), excluding database indexing and constraint checks.
Q. Print all combinations of balanced parentheses for a given number of pairs
asked 1xmediumBacktrackingTechnical2022
Ans. Use backtracking to build each valid string by adding an opening bracket if fewer than n are used, and a closing bracket if it would not exceed openings. Keep the current sequence in a string or character array, with open and close counts. Time is O(Cn times n), where Cn is the nth Catalan number.
Q. Answer questions on Operating Systems, Data Structures, and DBMS fundamentals
asked 1xmediumOs dbms dsOnline test2015
Ans. Operating systems manage processes, memory, files, and hardware resources. Data structures organise data for efficient access and updates, such as arrays, linked lists, stacks, queues, trees, and hash tables. A DBMS stores, retrieves, secures, and manages structured data, usually using SQL, transactions, indexing, and normalisation.
Q. Explain foreign keys, different types of SQL joins, and normal forms in DBMS.
asked 1xmediumDBMSTechnical2017
Ans. A foreign key links a child table column to a parent table key, enforcing referential integrity; joins combine rows across tables; normal forms reduce redundancy and anomalies. Common joins are inner, left, right, full outer, cross, and self join. 1NF removes repeating groups, 2NF removes partial dependency, and 3NF removes transitive dependency.
Q. Write client and server programs for socket communication (one-way and two-way)
asked 1xmediumNetworkingTechnical2016
Ans. Use TCP sockets: the server creates a socket, binds to an address and port, listens, accepts a client, then reads and optionally writes; the client creates a socket, connects, then writes and optionally reads. One-way uses a single send and receive path. Two-way loops on both sides. Data is held in byte buffers. Cost is O(n) for n bytes transferred.
Q. Explain normalization and how to minimize the number of tables using foreign keys
asked 1xmediumDBMSTechnical2016
Ans. Normalization organises data to reduce duplication and update errors by splitting related facts into well designed tables and linking them with foreign keys. To minimise tables, normalise only until each table represents one clear entity or relationship, then avoid unnecessary lookup or junction tables unless they remove real redundancy or model many to many relationships.
Q. Compare semaphore and mutex locks and explain which one is better in different scenarios.
asked 1xmediumOperating systemsTechnical2017
Ans. A mutex is better for protecting one shared resource with exclusive ownership, while a semaphore is better for controlling access to a limited number of identical resources or signalling between threads. The key difference is ownership: a mutex should be unlocked by the thread that locked it, but a semaphore can be released by another thread.
Q. What is database normalization? Explain anomalies, types of anomalies, and different normal forms.
asked 1xmediumDBMSTechnical2016
Ans. Database normalization organises relational tables to reduce duplication and dependency problems. Anomalies are errors caused by poor design: insertion anomalies prevent adding facts, update anomalies require changing repeated data, and deletion anomalies lose facts accidentally. Common normal forms are 1NF atomic values, 2NF no partial dependency, 3NF no transitive dependency, and BCNF stricter determinant rules.
Q. Explain the difference between process and thread, parent and child processes, and the SIGINT signal.
asked 1xmediumOperating systemsTechnical2017
Ans. A process is an independent running program with its own address space, while a thread is a lighter execution path inside a process that shares that process’s memory. A parent process creates a child process, which gets its own process ID and usually inherits resources. SIGINT is the interrupt signal, commonly sent by Ctrl+C, requesting termination.
Q. You are standing in a dark room with no source of light. How would you find the exact center of the floor?
asked 1xmediumLogical reasoningHR2020
Ans. Use the room’s geometry: find the corners by touch, then stretch a string or rope between opposite corners. Do the same for the other diagonal. In a rectangular floor, the diagonals always cross at the exact centre, so the intersection point is the answer. Without that shape assumption, it is not guaranteed.
Q. Given two integers n and k, determine whether k infinite areas can be formed using n distinct straight lines.
asked 1xmediumLogical reasoningOnline test2017
Ans. Check only two possible counts. If all n distinct lines are parallel, they form n + 1 infinite areas. If at least two lines are not parallel, the number of infinite areas is 2n. Therefore answer yes only when k equals n + 1 or k equals 2n, otherwise no.
Q. Given two circles with centers (x1, y1), radius r1 and (x2, y2), radius r2, find the area of intersection of the two circles.
asked 1xmediumGeometryOnline test2020
Ans. Compute the distance d between centres. If d >= r1 + r2, area is 0. If d <= |r1 - r2|, area is π times the smaller radius squared. Otherwise use the lens formula: r1²cos⁻¹((d²+r1²-r2²)/(2dr1)) + r2²cos⁻¹((d²+r2²-r1²)/(2dr2)) - 0.5√((-d+r1+r2)(d+r1-r2)(d-r1+r2)(d+r1+r2)).
Q. Given an array of n integers, find the minimum length of a subset whose bitwise OR value is maximum among all possible subsets.
asked 1xmediumBit manipulationOnline test2017
Ans. The maximum possible OR is the OR of all array elements, so find the smallest subset whose OR equals that target. Use dynamic programming with a map from OR value to minimum subset size, updating it for each number. The answer is the map value for the target. Time is O(n times distinct OR states).
Q. Given a table with students, subjects, and marks, write an SQL query to find the maximum marks for each student in each subject.
asked 1xmediumSQLTechnical2023
Ans. Group the rows by student and subject, then select the maximum marks from each group using the MAX aggregate function. The essential SQL idea is to return student, subject, and MAX(marks), with a GROUP BY on student and subject. This gives one result row per student per subject.
Q. Describe a situation where your opinion differed from your team leader’s. What was the outcome and how did you handle the situation?
asked 1xmediumConflict resolutionHR2020
Ans. Pick a real, low-drama work example where you disagreed on approach, priority, or risk. Emphasise that you listened first, used evidence, stayed respectful, and focused on the team goal. Show whether you adapted, compromised, or influenced the decision. Interviewers listen for maturity, judgement, collaboration, and no blame.
Q. Explain client-server communication, connection-oriented vs connection-less protocols, and their advantages. Discuss basics of socket programming.
asked 1xmediumNetworkingTechnical2017
Ans. Client-server communication has clients send requests to a server, which processes them and returns responses. Connection-oriented protocols like TCP establish a reliable ordered connection, useful for web, email and file transfer. Connection-less protocols like UDP send independent packets, faster with lower overhead for streaming or gaming. Socket programming creates endpoints, binds, listens, connects, sends and receives data.
Q. There are 1000 coins and 10 bags. One bag contains fake coins with different weight. How do you identify the bag with fake coins using minimum measurements?
asked 1xmediumLogical reasoningTechnical2020
Ans. Number the bags 1 to 10. Take 1 coin from bag 1, 2 from bag 2, and so on, then weigh these 55 coins once. Compare the result with the expected weight if all were genuine. The weight difference divided by the per-coin fake difference gives the bag number. Minimum measurements: one.
Q. Reverse a linked list
asked 1xeasyLinked listsTechnical2015
Ans. Reverse a linked list by iterating through it and changing each node’s next pointer to point to the previous node. Keep three pointers: previous, current, and next, so you do not lose the rest of the list. At the end, previous is the new head. Time complexity is O(n), space complexity is O(1).
Q. What is a Binary Search Tree?
asked 1xeasyTreesTechnical2023
Ans. A Binary Search Tree is a binary tree where each node’s left subtree contains smaller values and its right subtree contains larger values. This ordering lets search, insert, and delete compare at each node and move left or right. Operations take O(h) time, which is O(log n) if balanced, but O(n) if skewed.
Q. Insert a node in a linked list
asked 1xeasyLinked listsTechnical2015
Ans. Insert by creating a new node, setting its next pointer to the correct successor, then updating the previous node’s next pointer to the new node. If inserting at the head, update the head pointer instead. In a singly linked list, insertion is O(1) once the position is found, but finding it is O(n).
Q. Delete a node from a linked list
asked 1xeasyLinked listsTechnical2015
Ans. To delete a node from a linked list, relink the previous node’s next pointer to skip the target node. In a singly linked list, first handle the empty list and deletion of the head separately, then traverse to find the node and its previous node. Time complexity is O(n), space complexity is O(1).
Q. Differentiate between TCP and UDP
asked 1xeasyNetworkingTechnical2016
Ans. TCP is connection oriented and reliable, while UDP is connectionless and best effort. TCP guarantees ordered delivery, retransmits lost data, and uses flow and congestion control, so it has more overhead. UDP does not guarantee delivery or order, but is faster and simpler, making it useful for streaming, gaming, DNS, and voice calls.
Q. Explain dynamic memory allocation
asked 1xeasyOOPTechnical2017
Ans. Dynamic memory allocation is allocating memory while a program is running, rather than fixing its size at compile time. It is usually taken from the heap and used for data whose size or lifetime is not known in advance. The key detail is that this memory must be released or managed properly to avoid leaks.
Q. Explain client-server architecture
asked 1xeasyNetworkingTechnical2016
Ans. Client-server architecture is a model where clients request services or data, and servers process those requests and return responses. The client usually handles the user interface, while the server manages shared resources, business logic, storage, or security. This separation makes systems easier to scale, maintain, and manage centrally.
Q. What is a 64-bit operating system?
asked 1xeasyOperating systemsTechnical2021
Ans. A 64-bit operating system is an OS designed to run on a 64-bit processor and use 64-bit memory addresses and registers. The main practical benefit is that it can address far more memory than a 32-bit OS, so it can support more than 4 GB of RAM and run 64-bit applications efficiently.
Q. What is a virtual function in C++?
asked 1xeasyOOPTechnical2015
Ans. A virtual function in C++ is a member function declared with virtual so calls are resolved at runtime based on the actual object type. This enables polymorphism: a base class pointer or reference can call an overridden derived class method. Destructors should often be virtual in polymorphic base classes.
Q. Explain paging in operating systems
asked 1xeasyOperating systemsTechnical2017
Ans. Paging is a memory management technique where a process’s virtual address space is split into fixed-size pages, and physical memory is split into same-size frames. The OS maps pages to frames using a page table, allowing non-contiguous allocation. The key benefit is avoiding external fragmentation while supporting virtual memory.
Q. Explain different types of SQL joins
asked 1xeasyDBMSTechnical2016
Ans. SQL joins combine rows from related tables using a matching condition, usually a key. INNER JOIN returns only matching rows. LEFT JOIN returns all rows from the left table plus matches from the right. RIGHT JOIN is the reverse. FULL OUTER JOIN returns all rows from both sides. CROSS JOIN returns every combination of rows.
Q. What are DDL and DML commands in DBMS?
asked 1xeasyDBMSTechnical2020
Ans. DDL commands define and change the database structure, while DML commands work with the data stored in that structure. DDL includes CREATE, ALTER, DROP and TRUNCATE. DML includes SELECT, INSERT, UPDATE and DELETE. The key difference is that DDL changes schemas or objects, whereas DML reads or modifies rows.
Q. Demonstrate exception handling in Java.
asked 1xeasyOOPTechnical2015
Ans. Exception handling in Java is done by putting risky code in a try block, handling specific failures in catch blocks, and using finally for cleanup that must run. For example, file reading may catch IOException. Checked exceptions must be caught or declared with throws, while unchecked exceptions usually indicate programming errors.
Q. Explain the three-way handshaking protocol
asked 1xeasyNetworkingTechnical2016
Ans. The three-way handshake is TCP’s connection setup using SYN, SYN-ACK, and ACK messages. The client sends a SYN with its initial sequence number, the server replies with SYN-ACK and its own sequence number, then the client sends ACK. This confirms both sides can send and receive reliably.
Q. How do you deal with conflict in college team projects?
asked 1xunknownConflict resolutionHR2022
Ans. Pick a real project where the disagreement affected quality, deadlines, or workload, not a personal clash. Emphasise listening first, clarifying roles, using evidence, agreeing actions, and keeping the group focused on the outcome. Interviewers listen for maturity, accountability, calm communication, and proof that you helped resolve the issue professionally.
Showing 60 of 113 questions. Ranked by how often the same question came back across interviews.