Q. Explain ACID properties in DBMS
asked 10xeasyDBMSTechnical2015-2024
Ans. ACID properties are the guarantees that make database transactions reliable: Atomicity, Consistency, Isolation and Durability. Atomicity means all or nothing, Consistency keeps valid rules, Isolation prevents concurrent transactions interfering, and Durability ensures committed changes survive crashes. They are essential for correctness in systems handling critical data.
Q. Reverse a singly linked list
asked 9xeasyLinked listsTechnical2014-2024
Ans. Reverse it by walking through the list once and redirecting each node’s next pointer to the previous node. Keep three pointers: previous, current, and next, so you do not lose the remaining list. At the end, previous becomes the new head. Time is O(n), space is O(1).
Q. Explain different types of SQL joins
asked 6xeasySQLTechnical2016-2024
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. Check whether a given number is prime
asked 6xeasyMathTechnical2017-2023
Ans. A number is prime if it is greater than 1 and has no divisors other than 1 and itself. Handle n less than or equal to 1 as not prime, then test divisibility only up to the square root of n. This uses constant space and runs in O(sqrt n) time.
Q. Explain the four pillars of Object-Oriented Programming.
asked 6xeasyOOPTechnical2021-2024
Ans. The four pillars of object-oriented programming are encapsulation, abstraction, inheritance, and polymorphism. Encapsulation hides internal state behind methods. Abstraction exposes only essential behaviour. Inheritance lets classes reuse and extend other classes. Polymorphism lets different objects be treated through the same interface while providing their own behaviour.
Q. Find the intersection point of two linked lists
asked 5xmediumLinked listsTechnical2021-2025
Ans. Use two pointers, one on each list, and advance them one node at a time; when a pointer reaches the end, move it to the head of the other list. If the lists intersect, the pointers meet at the intersection node after equalised traversal. This uses constant extra space and runs in O(m + n) time.
Q. What are the differences between C++ and Java?
asked 5xeasyOOPTechnical2013-2021
Ans. C is a procedural, compiled, low-level language with manual memory management, while Java is object-oriented, runs on a virtual machine, and uses garbage collection. C gives more control over memory and hardware, so it is common in systems programming. Java favours portability, safety, and large application development through its standard runtime.
Q. Explain Paging in Operating Systems
asked 4xmediumOperating systemsTechnical2014-2022
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. Find the diameter of a binary tree.
asked 4xmediumTreesTechnical2016-2024
Ans. Use a postorder DFS that returns the height of each subtree and updates a global maximum diameter at every node. For each node, the longest path through it is left height plus right height, measured in edges. Visit each node once, so the time complexity is O(n), with O(h) recursion stack space.
Q. Detect and remove a loop in a linked list
asked 4xmediumLinked listsTechnical2015-2021
Ans. Use Floyd’s slow and fast pointer method to detect the loop, then remove it by finding the node where the cycle starts and setting the previous node’s next pointer to null. After slow and fast meet, move one pointer to head and advance both one step at a time. Time is O(n), space is O(1).
Q. Detect a loop in a linked list
asked 4xeasyLinked listsTechnical2014-2021
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. Aptitude and logical reasoning questions
asked 4xeasyLogical reasoningOnline test2015-2024
Ans. Identify the question type first, then write down the given facts clearly. Convert words into equations, tables, diagrams, or sequences where useful. Eliminate impossible options and check units, order, and conditions carefully. For reasoning puzzles, test one assumption at a time and verify the final answer against every statement.
Q. Print the left view of a binary tree.
asked 3xmediumTreesTechnical2015-2020
Ans. Print the first node visible at each depth when the tree is viewed from the left. Do a level order traversal using a queue, and for each level print the first node removed from the queue. This visits every node once, so the time complexity is O(n), with O(w) space for the queue.
Q. Given a string, find the longest palindromic substring.
asked 3xmediumStringsTechnical2014-2024
Ans. Use expand around centres: for each index, expand once for an odd-length palindrome and once between indices for an even-length palindrome, tracking the best start and length. The key detail is handling both centre types. This uses only a few variables, runs in O(n squared) time, and uses O(1) extra space.
Q. Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.
asked 3xmediumTreesTechnical2019-2024
Ans. Use a recursive depth first search: if the current root is null or equals either target node, return it. Search left and right subtrees. If both return non-null, the current root is the LCA; otherwise return the non-null side. This uses the call stack, with linear time and tree-height space.
Q. Reverse a linked list
asked 3xeasyLinked listsTechnical2015-2021
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. Merge two sorted linked lists
asked 3xeasyLinked listsTechnical2014-2021
Ans. Merge the two sorted linked lists by using a dummy head and a tail pointer, repeatedly attaching the smaller current node from either list. Move that list’s pointer forward each time, then attach the remaining nodes when one list ends. This reuses existing nodes, takes O(n + m) time and O(1) extra space.
Q. Implement stack using a linked list
asked 3xeasyStackTechnical2020-2024
Ans. Use a singly linked list and treat the head node as the top of the stack. To push, create a new node and link it before the current head. To pop, remove the head and return its value. Peek reads the head value. Push, pop and peek are O(1); space is O(n).
Q. What is Object-Oriented Programming?
asked 3xeasyOOPHR, Technical2016-2021
Ans. Object-Oriented Programming is a programming style that organises software around objects, which combine data and behaviour. Objects are created from classes and interact through methods. The key ideas are encapsulation, inheritance, polymorphism and abstraction, with encapsulation being especially important because it hides internal state and exposes a controlled interface.
Q. Check whether a given string is a palindrome
asked 3xeasyStringsTechnical2016-2023
Ans. Use two pointers, one at the start of the string and one at the end, and compare characters while moving inward. If any pair differs, it is not a palindrome; if the pointers meet or cross, it is. This uses no extra data structure and runs in O(n) time with O(1) space.
Q. Explain the Software Development Life Cycle (SDLC).
asked 3xeasySoftware engineeringSystem design, Technical2016-2024
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. Check whether a given string or number is a palindrome.
asked 3xeasyStringsTechnical2016-2023
Ans. Use two pointers, one at the start and one at the end, and compare characters while moving inward. For a number, either convert it to a string or reverse its digits and compare with the original. The string approach uses constant extra data and runs in O(n) time.
Q. Check whether two given strings are anagrams of each other.
asked 3xeasyStringsTechnical2017-2024
Ans. Use character frequency counts to check whether two strings are anagrams. If their lengths differ, return false. Otherwise count each character in the first string, subtract counts using the second string, and ensure no count becomes negative or remains non-zero. A hash map or fixed-size array works. Time complexity is O(n).
Q. Group the anagrams from a list of strings
asked 2xmediumStringsTechnical2017-2020
Ans. Use a hash map where each key represents the character composition of a word, and each value is the list of words with that composition. For each string, sort its characters or build a 26-count signature, then append it to the matching group. Sorting gives O(n k log k) time, with O(n k) space.
Q. Add Two Numbers Represented by Linked Lists
asked 2xmediumLinked listsTechnical2022-2024
Ans. Use a dummy head and add corresponding digits while carrying overflow, creating one result node per digit. Traverse both lists together, treating missing digits as zero, and continue while either list has nodes or carry remains. This handles different lengths and final carry. Time is O(max(m, n)); extra space is the output list.
Q. What is static binding and dynamic binding?
asked 2xmediumOOPTechnical2023-2024
Ans. Static binding resolves which method or variable reference is used at compile time, while dynamic binding resolves the method call at run time. Static binding is used for overloaded methods, private, final, and static methods. Dynamic binding supports overriding and polymorphism, where the actual object type decides which implementation runs.
Q. Explain normalization in DBMS with examples.
asked 2xmediumDBMSTechnical2015-2016
Ans. Normalization in DBMS is the process of organising tables to reduce data redundancy and avoid update, insert and delete anomalies. For example, instead of storing customer details in every order row, create a Customer table and an Order table linked by customer_id. Common forms are 1NF, 2NF and 3NF.
Q. What is the difference between 3NF and BCNF?
asked 2xmediumDBMSTechnical2021-2024
Ans. BCNF is stricter than 3NF: in BCNF, every determinant of a functional dependency must be a superkey. In 3NF, a dependency is still allowed if the dependent attribute is prime, meaning part of some candidate key. So every BCNF table is in 3NF, but not vice versa.
Q. Print all root-to-leaf paths in a binary tree.
asked 2xmediumTreesTechnical2015-2017
Ans. Do a depth first traversal, keeping the current path from the root to the current node. Add each visited node to a list; when you reach a leaf, print the list. After returning from a child, remove the node to backtrack. Time is O(n), excluding output size, and space is O(h).
Q. Explain SQL injection and how it can be prevented
asked 2xmediumDBMSTechnical2020-2024
Ans. SQL injection is an attack where untrusted input is treated as part of an SQL command, allowing an attacker to read, change, or delete data. Prevent it by using parameterised queries or prepared statements, so values are bound separately from SQL code. Also validate input and use least-privilege database accounts.
Q. Convert an infix expression to a postfix expression.
asked 2xmediumStackTechnical2016-2022
Ans. Use a stack to convert infix to postfix by scanning the expression left to right and outputting operands immediately. Push opening brackets, pop until an opening bracket on closing brackets, and for operators pop higher or equal precedence operators before pushing the current one. Finally pop remaining operators. This runs in O(n) time.
Q. Convert a sorted array into a balanced Binary Search Tree
asked 2xmediumTreesTechnical2016-2017
Ans. Choose the middle element of the sorted array as the root, then recursively build the left subtree from the left half and the right subtree from the right half. This keeps the tree height balanced because each split is near equal. Use recursion and tree nodes. Time complexity is O(n), with O(log n) stack space for a balanced tree.
Q. Explain the significance of the volatile keyword in Java.
asked 2xmediumOOPTechnical2021
Ans. volatile makes writes to a variable immediately visible to other threads and prevents certain instruction reordering around that variable. A write to a volatile field happens-before every later read of it. It is useful for flags or simple state, but it does not make compound actions like increment atomic or replace locking.
Q. Find the Longest Increasing Subsequence in a given array.
asked 2xmediumDynamic programmingOnline test, Technical2022-2023
Ans. Use a patience sorting approach: maintain an array tails, where tails[i] is the smallest possible tail value of an increasing subsequence of length i + 1. For each number, binary search its position in tails and replace or append it. The length of tails is the LIS length. Time complexity is O(n log n).
Q. Write SQL queries to retrieve data from relational tables
asked 2xmediumSQLOnline test, Technical2017-2020
Ans. Use SELECT to choose columns, FROM to name tables, WHERE to filter rows, JOIN to combine related tables, GROUP BY for aggregates, and ORDER BY for sorting. The key detail is joining on primary and foreign keys, so results stay correct and avoid accidental Cartesian products. Query cost depends mainly on indexes and row counts.
Q. Explain database normalization and different normal forms.
asked 2xmediumDBMSTechnical2016-2021
Ans. Database normalization structures relational tables to reduce duplication and prevent update, insert, and delete anomalies. 1NF uses atomic values, 2NF removes partial dependency on a composite key, 3NF removes transitive dependency on non-key columns, and BCNF requires every determinant to be a candidate key. Higher forms handle multivalued and join dependencies.
Q. Explain the difference between multithreading and multiprocessing.
asked 2xmediumOperating systemsTechnical2022-2023
Ans. Multithreading runs multiple threads within one process, sharing the same memory space, while multiprocessing runs multiple separate processes, each with its own memory. Threads are lighter and useful for I/O-bound work, but shared state needs careful synchronisation. Processes have more overhead but give better isolation and can use multiple CPU cores more effectively.
Q. Minimum cut puzzle.
asked 2xhardLogical reasoningTechnical2020-2024
Ans. Two cuts are enough. Cut the seven-unit bar into pieces of 1, 2 and 4 units. Then use binary payment: day 1 give 1, day 2 swap for 2, day 3 add 1, day 4 swap for 4, day 5 add 1, day 6 add 2, day 7 add 1.
Q. Find the fastest 3 horses puzzle
asked 2xhardLogical reasoningHR, Managerial2021-2023
Ans. The minimum is 7 races, assuming 25 horses and 5 can race at once. Race five groups of five, then race the five winners. The winner of that race is fastest. Only horses that could still be second or third remain: A2, A3, B1, B2 and C1. Race those five; the top two complete the fastest three.
Q. Find the fastest 3 horses out of 25 horses using minimum number of races.
asked 2xhardLogical reasoningTechnical2021-2024
Ans. Use 7 races. Split 25 horses into 5 groups and race each group, giving 5 races. Race the 5 winners in race 6. The winner is fastest. Only horses that could still be second or third are: second and third from the winner’s group, first and second from the runner-up group, and first from the third-place group. Race those 5; top 2 complete the answer.
Q. Basic SQL queries
asked 2xeasySQLTechnical2016-2020
Ans. Basic SQL queries retrieve and filter data using SELECT, FROM and WHERE, then shape results with JOIN, GROUP BY, HAVING and ORDER BY. The key detail is execution logic: rows are chosen from tables, filtered, grouped, filtered again if needed, projected into columns, then sorted for output.
Q. Explain Quick Sort algorithm
asked 2xeasySortingTechnical2017-2019
Ans. Quick Sort is a divide and conquer sorting algorithm that chooses a pivot, partitions the array so smaller elements go before it and larger elements after it, then recursively sorts both sides. Its key detail is pivot choice: average time is O(n log n), but poor pivots can make it O(n²).
Q. Explain the OSI model layers
asked 2xeasyNetworkingTechnical2020-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. Compare TCP and UDP protocols
asked 2xeasyNetworkingTechnical2020-2021
Ans. TCP is connection-oriented, reliable and ordered, while UDP is connectionless, faster and does not guarantee delivery or order. TCP uses handshakes, acknowledgements, retransmission and flow control, so it suits web pages, file transfer and email. UDP has lower overhead and latency, so it suits streaming, gaming, DNS and real-time voice or video.
Q. Sort an array of 0s, 1s and 2s
asked 2xeasySortingManagerial, Technical2021-2022
Ans. Use the Dutch National Flag algorithm with three pointers: low, mid and high. Scan once: put 0s before low, leave 1s in the middle, and put 2s after high by swapping. This sorts in place with no extra data structure, taking O(n) time and O(1) space.
Q. Find the height of a binary tree
asked 2xeasyTreesTechnical2016
Ans. Find the height by doing a depth first traversal and returning 1 plus the maximum height of the left and right subtrees. Use recursion, or an explicit stack if recursion depth is a concern. With height measured in nodes, an empty tree has height 0 and a leaf has height 1. Time is O(n).
Q. Reverse a number using recursion.
asked 2xeasyRecursionTechnical2015-2024
Ans. Reverse a number recursively by taking its last digit, appending it to a result, and recursing on the remaining number. Pass the current reversed value as an argument, or return it through recursive calls. No extra data structure is needed beyond the call stack. Time complexity is O(d), where d is the number of digits.
Q. Explain Java Collections framework
asked 2xeasyOOPTechnical2017-2023
Ans. The Java Collections Framework is a standard set of interfaces and classes for storing, retrieving and processing groups of objects. Its core interfaces are Collection, List, Set, Queue and Map. The key detail is that you choose an implementation, such as ArrayList, HashSet or HashMap, based on ordering, uniqueness and performance needs.
Q. Reverse the words in a given string
asked 2xeasyStringsTechnical2016-2020
Ans. Split the string into words, then output the words in reverse order joined by a single space. The key detail is to ignore leading, trailing, and repeated spaces while collecting words. Use an array or list to store words. This takes O(n) time and O(n) extra space.
Q. Print all prime numbers from 1 to n.
asked 2xeasyMathTechnical2022-2023
Ans. Use the Sieve of Eratosthenes to print all primes from 1 to n. Create a boolean array of size n + 1, mark 0 and 1 as non-prime, then for each prime p mark multiples from p squared. Print remaining true indices. Time is O(n log log n), space is O(n).
Q. Difference between calloc and malloc?
asked 2xeasyOperating systemsTechnical2016-2021
Ans. malloc allocates a single block of memory of a given size, while calloc allocates memory for an array of elements and initialises all bytes to zero. malloc takes one size argument and leaves contents uninitialised. calloc takes element count and element size, and can be safer for arrays because it computes the total size.
Q. Explain the concept of Virtual Memory.
asked 2xeasyOperating systemsTechnical2020-2024
Ans. Virtual memory is an operating system technique that gives each process the illusion of a large, private, continuous memory space. It maps virtual addresses to physical RAM using page tables. The key detail is paging: inactive pages can be kept on disk and loaded into RAM when needed, enabling isolation and efficient memory use.
Q. Basic English grammar and spell check questions
asked 2xeasyVerbalOnline test2020
Ans. Check the sentence for one issue at a time: subject verb agreement, tense, pronouns, articles, prepositions, punctuation and word order. Read it aloud to spot awkward grammar. For spelling, look for commonly confused words, missing letters and wrong homophones. Choose the option that is grammatically correct and keeps the meaning unchanged.
Q. Grammar correction, sentence reordering, reading comprehension, vocabulary and word replacement questions
asked 2xeasyVerbalOnline test2017-2019
Ans. Read the full sentence or passage first to understand meaning and tone. Check grammar using subject verb agreement, tense, articles, prepositions and pronouns. For reordering, find the opening idea, connectors and logical sequence. In comprehension, answer only from the passage. For vocabulary, use context to choose the closest meaning, not just a familiar word.
Q. Design a distributed job scheduler.
asked 1xmediumDistributed systemsSystem design2024
Ans. Use a replicated control plane to store jobs, leases and state, and many workers that poll or receive assigned work. Keep job metadata in a strongly consistent store, shard by queue or tenant, and use time based leases with heartbeats so failed workers release jobs safely. Make execution idempotent and retries explicit.
Q. Low-level design of a Task Scheduler
asked 1xmediumLldTechnical2021
Ans. Design it around a durable task store, a scheduler loop, and a worker pool. Store tasks with id, payload, runAt time, priority, status, retry policy and lease expiry. Keep runnable tasks in a min-heap by runAt, dispatch to workers when due, and use leases plus idempotency to handle crashes and retries safely.
Q. High-level design of a Task Scheduler
asked 1xmediumHldTechnical2021
Ans. Design it as an API service storing tasks with run time, a scheduler that scans due tasks, a durable queue, and worker pools that execute them. The key detail is reliability: use persistent state, idempotent task execution, leases or locks to prevent double processing, retries with backoff, and monitoring for missed or failed jobs.
Q. How would you handle a stressful situation at work?
asked 1xmediumStress managementHR2024
Ans. Choose a real example with pressure, deadlines, conflict, or uncertainty, but not a crisis you caused through poor planning. Emphasise staying calm, prioritising, communicating early, asking for help when needed, and following through. Interviewers listen for self-control, judgement, teamwork, accountability, and evidence that you learned from the situation.
Q. What would you do if a team member is not contributing to work?
asked 1xmediumTeamworkHR2024
Ans. Pick a real example where you noticed the issue early, spoke privately, and tried to understand the cause before escalating. Emphasise clear expectations, offering support, redistributing work fairly, and protecting team delivery. Interviewers listen for maturity, empathy, accountability, and the ability to address poor contribution without blame or avoidance.
Q. How would you handle a difficult team member in a project setting?
asked 1xmediumTeamworkHR2023
Ans. Choose a real example where the issue affected delivery, not just personality. Emphasise staying calm, understanding their concerns, setting clear expectations, and focusing on the project goal. Show that you tried direct communication before escalating. Interviewers listen for maturity, accountability, conflict resolution, and evidence that you protect team performance without creating more tension.
Showing 60 of 2,470 questions. Ranked by how often the same question came back across interviews.