Q. Explain Kadane’s Algorithm.
asked 1xmediumArraysTechnical2018
Ans. Kadane’s Algorithm finds the maximum sum of a contiguous subarray in linear time. It scans the array while keeping the best sum ending at the current position and the best sum seen overall. At each element, either extend the previous subarray or start a new one. It runs in O(n) time and O(1) space.
Q. Explain Dijkstra’s Algorithm.
asked 1xmediumGraphsTechnical2018
Ans. Dijkstra’s algorithm finds the shortest path from a source node to all other nodes in a weighted graph with non-negative edge weights. It keeps tentative distances, repeatedly picks the unvisited node with the smallest distance using a priority queue, and relaxes its neighbours. With an adjacency list, it runs in O((V + E) log V).
Q. How are maps implemented internally?
asked 1xmediumData structuresTechnical2018
Ans. Maps are usually implemented as either hash tables or balanced search trees. A hash map stores key value pairs in buckets chosen by a hash function, handling collisions by chaining or probing, giving average constant time lookup. Tree maps keep keys ordered, often with a red black tree, giving logarithmic operations.
Q. Explain cache memory and its implementation
asked 1xmediumOperating systemsTechnical2023
Ans. Cache memory is a small, very fast memory between the CPU and main memory that stores recently or frequently used data and instructions. It is implemented with SRAM in levels such as L1, L2 and L3, using cache lines, tags, valid bits, replacement policies, and write policies to manage access efficiently.
Q. Explain different types of graphs and trees
asked 1xmediumData structures basicsTechnical2023
Ans. Graphs can be directed or undirected, weighted or unweighted, cyclic or acyclic, connected or disconnected, and sparse or dense. A tree is a connected acyclic graph, commonly rooted, binary, binary search, balanced, heap, trie, or B-tree. The key distinction is that graphs are general relationships, while trees enforce hierarchy without cycles.
Q. Implement stack and queue using linked lists
asked 1xmediumStack queueTechnical2023
Ans. Use singly linked nodes and keep the right pointers for each structure. For a stack, keep a top pointer; push inserts at the head and pop removes from the head. For a queue, keep front and rear pointers; enqueue adds at rear and dequeue removes from front. All main operations are O(1).
Q. Linked list fundamentals and related questions
asked 1xmediumLinked listsTechnical2023
Ans. A linked list is a linear data structure where each node stores a value and a reference to the next node, and sometimes the previous node. The key trade-off is fast insertion or deletion when you already have the node, but slow random access because you must traverse from the head. Common questions use two pointers.
Q. Design an unmanned parking lot management system.
asked 1xmediumScalable systemsTechnical2014
Ans. Design it as gate controllers, sensors, payment terminals and a central service that tracks spaces, tickets, pricing and access. Cars receive a ticket or are recognised by number plate, spaces are allocated by type, occupancy updates come from sensors, and exit is allowed after payment. The key detail is keeping occupancy state strongly consistent.
Q. Explain the merge sort algorithm and implement it.
asked 1xmediumSortingTechnical2016
Ans. Merge sort is a divide and conquer sorting algorithm that splits the array into halves, sorts each half recursively, then merges the sorted halves. The key step is merging by comparing the smallest remaining elements. It runs in O(n log n) time and usually needs O(n) extra space.
Q. What are semaphores and what is a critical section?
asked 1xmediumOperating systemsTechnical2018
Ans. Semaphores are synchronisation primitives used to control access to shared resources, and a critical section is the part of a program that accesses shared data and must not be executed by multiple conflicting threads at once. A semaphore is changed using wait and signal operations, commonly to enforce mutual exclusion or limit concurrency.
Q. Implement a custom collection class using a HashMap.
asked 1xmediumHashingTechnical2024
Ans. Implement it by wrapping a HashMap inside the collection class and exposing methods such as add, remove, contains and size. Store each element as a key and a dummy value, or store keys to counts if duplicates are allowed. Add, remove and lookup are average constant time, with linear space.
Q. What are processes and how do processes communicate?
asked 1xmediumOperating systemsTechnical2018
Ans. Processes are independent running instances of programs, each with its own virtual address space, resources and execution state. They communicate using inter-process communication such as pipes, sockets, message queues, signals, files or shared memory. The key detail is isolation: normal memory is not shared, so shared memory needs explicit synchronisation such as locks or semaphores.
Q. Solve numerical problems based on data interpretation
asked 1xmediumData interpretationOnline test2023
Ans. Read the table, chart, or graph carefully, noting units, totals, and time periods. Identify exactly what is being asked, then extract only the relevant figures. Use standard calculations such as percentage change, ratios, averages, or differences. Estimate first to avoid impossible answers, then calculate accurately and check units before choosing the answer.
Q. How is inter-process communication (IPC) accomplished?
asked 1xmediumOperating systemsManagerial2016
Ans. Inter-process communication is accomplished through operating system mechanisms that let separate processes exchange data and coordinate actions. Common methods include pipes, message queues, shared memory, sockets, signals, and files. The key detail is synchronisation: shared memory is fast, but processes must use locks, semaphores, or similar controls to avoid races.
Q. An application is slow. What can be the possible reasons?
asked 1xmediumOperating systemsManagerial2016
Ans. An application is slow because some resource or dependency is the bottleneck. Common reasons include inefficient algorithms, slow database queries, missing indexes, excessive network calls, high CPU or memory use, disk I/O, lock contention, too much logging, poor caching, or overloaded servers. The key is to measure with profiling and monitoring, not guess.
Q. Design an ER diagram for an attendance management system.
asked 1xmediumDBMSTechnical2016
Ans. Model the ER diagram with Student, Course, Teacher, ClassSession and Attendance as the main entities. Student enrols in Course, Teacher teaches Course, Course has many ClassSessions, and Attendance links one Student to one ClassSession with status, time and remarks. The key detail is making Attendance an associative entity to support many-to-many tracking.
Q. Explain Naive Bayes and Support Vector Machine algorithms
asked 1xmediumMachine learningTechnical2023
Ans. Naive Bayes is a probabilistic classifier using Bayes’ theorem with an assumption that features are independent. Support Vector Machine is a classifier that finds the best separating boundary by maximising the margin between classes. The key detail is that Naive Bayes is fast and simple, while SVMs handle high-dimensional data well, especially with kernels.
Q. Explain STL in C++ and discuss how lists work internally.
asked 1xmediumOOPTechnical2024
Ans. The STL is C++’s generic library of containers, algorithms, iterators and function objects. A std::list is usually implemented as a doubly linked list: each node stores a value plus pointers to previous and next nodes. Insert and erase are constant time with an iterator, but indexing and search are linear.
Q. Find the jar with contaminated pills using minimum tests.
asked 1xmediumLogical reasoningTechnical2019
Ans. Use one weighing test, assuming contaminated pills have a known different weight. Number the jars 1 to n. Take 1 pill from jar 1, 2 from jar 2, and so on, then weigh all sampled pills together. The excess or shortfall from the expected weight identifies the jar number directly.
Q. Implement Dijkstra’s shortest path algorithm for a graph.
asked 1xmediumGraphsTechnical2016
Ans. Use Dijkstra by keeping the best known distance to each vertex, starting with the source at 0, and repeatedly expanding the unvisited vertex with the smallest distance. Store adjacency lists for the graph and use a min-priority queue. Relax each outgoing edge when a vertex is popped. Time complexity is O((V + E) log V).
Q. Find the Longest Common Subsequence (LCS) between two strings
asked 1xmediumDynamic programmingTechnical2024
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. Given a 2D grid, find the number of islands using DFS and BFS
asked 1xmediumGraphsTechnical2024
Ans. Scan every cell, and when you find unvisited land, count one island and traverse all connected land using DFS or BFS. DFS uses recursion or a stack, while BFS uses a queue. Mark visited cells to avoid recounting. Check four directions unless diagonals are specified. Time is O(rows × cols), space is O(rows × cols).
Q. How would you delete duplicate entries from a database table?
asked 1xmediumDBMSTechnical2014
Ans. I would identify duplicates using the columns that define uniqueness, keep one row from each group, and delete the rest. In SQL, this is commonly done with a window function such as row number over the duplicate key. The important detail is to run it in a transaction, verify first, then add a unique constraint to prevent recurrence.
Q. Implement a Binary Tree and perform In-order Traversal on it.
asked 1xmediumTreesTechnical2022
Ans. Implement a binary tree using nodes that store a value, a left child reference, and a right child reference, then perform in-order traversal by visiting left subtree, current node, then right subtree. This is usually done recursively with a base case for null nodes. Time complexity is O(n), and space is O(h).
Q. Answer verbal ability questions based on passage comprehension
asked 1xmediumVerbalOnline test2023
Ans. Read the questions first, then scan the passage for the relevant lines. Base every answer only on what the passage states or clearly implies, not outside knowledge. Note keywords, tone, comparisons and conclusions. For inference questions, choose the option most directly supported. Eliminate choices that are extreme, unrelated or only partly true.
Q. Explain multiprogramming, multiprocessing, and multithreading.
asked 1xmediumOperating systemsTechnical2014
Ans. Multiprogramming runs several programs by sharing one CPU, multiprocessing uses multiple CPUs or cores to run work in parallel, and multithreading runs multiple threads within one process. The key difference is the unit and hardware involved: programs share CPU time, processes can run on separate cores, and threads share the same process memory.
Q. How will you design and implement a dictionary data structure?
asked 1xmediumData structuresTechnical2018
Ans. I would implement a dictionary as a hash table: store key value pairs in an array of buckets, compute a hash from the key, and map it to a bucket index. Handle collisions with chaining or open addressing. Keep the load factor bounded by resizing. Average lookup, insert, and delete are constant time.
Q. Maximize the probability of drawing a white ball from two boxes.
asked 1xmediumProbabilityTechnical2019
Ans. Put one white ball alone in one box, and put all remaining balls in the other box. If there are 50 white and 50 black balls, the chance is 1/2 times 1 plus 1/2 times 49/99, which is about 74.7%. This works because one box gives certain success while the other remains nearly half white.
Q. Numerical reasoning questions involving quantitative problem solving
asked 1xmediumLogical reasoningOnline test2018
Ans. Convert the wording into numbers, identify what is being asked, and choose the relevant operation or formula. Work step by step, keeping units consistent. Estimate first to spot unreasonable answers, then calculate accurately. For percentages, ratios, rates, averages, and tables, write the relationship clearly before solving. Double-check the final value against the question.
Q. Verbal reasoning questions (comprehension, logic-based verbal ability)
asked 1xmediumVerbalOnline test2018
Ans. Read the passage or statement carefully, then base every answer only on the information given, not outside knowledge. Identify key facts, qualifiers, negatives, and comparisons. For logic questions, translate statements into simple relationships and test each option. Eliminate answers that are too broad, unsupported, or contradict the text.
Q. How would you handle a fraudulent debit transaction reported by a user?
asked 1xmediumProblem solvingTechnical2018
Ans. Choose a situation involving a distressed customer, financial risk, and clear process. Emphasise empathy, identity verification, immediate card or account protection, accurate dispute logging, escalation to fraud teams, regulatory timelines, and follow-up. Interviewers listen for calm judgement, customer care, attention to detail, confidentiality, and balancing speed with compliance.
Q. Data interpretation problems based on bar graphs, pie charts, and tables
asked 1xmediumLogical reasoningOnline test2016
Ans. Read the title, units, scale, and labels first. Identify exactly what is being asked, then extract only the needed values from the graph, chart, or table. Use ratios, percentages, averages, differences, or totals as required. Keep calculations organised, watch for changing units, and check whether the answer should be approximate or exact.
Q. Explain all searching and sorting algorithms you have studied in detail.
asked 1xmediumSorting searchingTechnical2019
Ans. Common searching algorithms are linear search, which checks each item in O(n), and binary search, which halves a sorted array in O(log n). Common sorting algorithms include bubble, selection and insertion sort in O(n²), merge sort and heap sort in O(n log n), and quicksort, usually O(n log n) but worst-case O(n²).
Q. How will you implement a dictionary application using Trie? Write the code.
asked 1xmediumTreesTechnical2018
Ans. Implement it with a Trie where each node stores child links and a flag marking the end of a valid word. Insert each word character by character, search by following characters, and support prefix lookup by stopping at the prefix node. Insert and search take O(L) time, where L is word length.
Q. Explain the diamond problem in inheritance and write C++ code to resolve it.
asked 1xmediumOOPTechnical2024
Ans. The diamond problem occurs when a class inherits from two classes that both inherit from the same base, creating two base subobjects and ambiguity. Resolve it in C++ with virtual inheritance: make both intermediate classes virtually inherit the base. No special data structure or algorithm is involved, and runtime complexity is unchanged.
Q. Estimate the time and cost required to paint a building (placement block) blue.
asked 1xmediumEstimationTechnical2018
Ans. Estimate wall area first. If the block is 30 m by 20 m, 4 floors high, height 12 m, exterior area is about 1,200 m² after openings. With two coats at 8 m² per litre, paint needed is 300 litres. At £5 per litre plus labour, total is about £3,000 to £5,000 and 5 to 7 days.
Q. How does MongoDB differ from other databases (especially relational databases)?
asked 1xmediumDBMSTechnical2024
Ans. MongoDB is a document-oriented NoSQL database, while relational databases store data in tables with fixed schemas and relationships. MongoDB stores JSON-like BSON documents, so related data is often embedded together and schemas can vary between records. This makes it flexible, but data modelling and joins differ from SQL-based systems.
Q. Solve data interpretation problems involving numerical data, charts, or tables.
asked 1xmediumData interpretationOnline test2024
Ans. Read the chart or table title, units, labels, and time period first. Identify exactly what is being asked, then pick only the relevant figures. Use simple arithmetic such as totals, differences, averages, percentages, ratios, or growth rates. Estimate where possible, but calculate accurately when options are close. Check units and rounding before answering.
Q. Design a system to count the number of people in a city at any given point in time.
asked 1xmediumScalabilityTechnical2018
Ans. Use an event driven system that ingests signals from mobile networks, transport gates, road cameras, and official check-ins, then maintains a real time estimated population per city. The key detail is avoiding double counting: assign probabilistic anonymous device or person IDs, deduplicate within time windows, and publish counts with confidence intervals rather than exact numbers.
Q. In the same marble process, what will be the color of the final marble left in the bag?
asked 1xmediumLogical reasoningTechnical2018
Ans. The final colour is determined by the parity of the initial number of white marbles, for the common rule where two different colours return a white marble and two same colours return a black marble. Each move preserves whether the number of white marbles is odd or even. Odd means final white, even means final black.
Q. How will you handle a database showing memory full issues in the short term and long term?
asked 1xmediumDBMSTechnical2018
Ans. Short term, I would stabilise the database by reducing load, killing runaway queries, freeing temporary space, increasing memory if possible, and restarting only if safe. Long term, I would find the cause using metrics, optimise queries and indexes, tune memory settings, archive old data, fix leaks, and plan capacity before demand grows.
Q. Numerical aptitude problems involving profit and loss, percentages, and data interpretation
asked 1xmediumNumerical abilityOnline test2020
Ans. Convert all figures to a common base first, usually cost price or total value. For profit and loss, use profit percent equals profit divided by cost price times 100. For percentages, translate words into equations. In data interpretation, read units carefully, compare like with like, and calculate ratios, differences, or percentage change as required.
Q. Explain the concept of the String Pool in Java and how memory is managed for String objects.
asked 1xmediumOOPTechnical2024
Ans. The String Pool is a special area in the Java heap that stores unique String literals so identical values can share the same object. When a literal is created, Java reuses an existing pooled String if present. Using new String creates a separate object, while intern() can add or return the pooled instance.
Q. Explain how collisions are handled in a HashMap and describe the internal working of buckets.
asked 1xmediumOOPTechnical2024
Ans. Collisions in a HashMap are handled by storing multiple entries in the same bucket, usually as a linked list or, in Java, a tree when collisions grow large. A key’s hash is converted to a bucket index. Within that bucket, keys are compared using equals to find, update, or insert the correct entry.
Q. Is it Finite? (Determine whether a given fraction results in a finite decimal representation)
asked 1xmediumNumber theoryOnline test2020
Ans. Reduce the fraction to its simplest form. Then check the denominator. If its only prime factors are 2 and 5, the decimal terminates. If any other prime factor remains, it is recurring. This works because finite decimals are fractions whose denominators can divide a power of 10.
Q. Answer verbal reasoning questions based on comprehension and logical interpretation of passages.
asked 1xmediumVerbalOnline test2024
Ans. Read the passage carefully and base every answer only on what it states or clearly implies. Identify key facts, qualifiers, comparisons and cause-effect links. For each option, check whether it is true, false, or cannot be determined from the text. Do not use outside knowledge or assumptions, even if they seem reasonable.
Q. Given power consumption constraints, determine after how many units of time an engine stops working.
asked 1xmediumMathOnline test2024
Ans. The engine stops after the largest time t for which cumulative power used is still within the available power. Compute the running sum of consumption per time unit and stop when it first exceeds the capacity. No special data structure is needed. The time complexity is O(n) and space is O(1).
Q. Analyze the given data set (tables/graphs) and answer questions related to ratios, percentages, or trends.
asked 1xmediumProbabilityOnline test2024
Ans. Read the table or graph carefully, noting units, scales, and categories. Identify exactly what is being compared. For ratios, put values in the same units and simplify. For percentages, use part divided by whole times 100. For trends, compare changes over time and note increases, decreases, peaks, and exceptions.
Q. Given initial velocity and angle, compute required unknown parameters based on projectile motion equations
asked 1xmediumPhysics based problem solvingOnline test2024
Ans. Resolve the initial velocity into horizontal and vertical components: ux = u cos θ and uy = u sin θ. Use horizontal motion x = ux t and vertical motion y = uy t minus half gt squared. Choose the equation containing the unknown, apply given conditions, then solve algebraically, using g ≈ 9.8 m/s².
Q. Explain different data structures you know, differences between them, and when to use which data structure.
asked 1xmediumData structuresTechnical2019
Ans. Arrays give fast indexed access, linked lists make insertions easier, stacks and queues control order, hash tables give fast key lookup, trees keep data ordered, heaps find priorities, and graphs model relationships. Choose by access pattern: random access, frequent updates, lookup by key, sorted traversal, priority retrieval, or connected entities.
Q. Given a short paragraph, answer True/False/Cannot Say questions based strictly on the information provided.
asked 1xmediumVerbalOnline test2018
Ans. Base every answer only on the paragraph, not on outside knowledge or assumptions. Mark True if the statement is directly supported, False if it directly contradicts the text, and Cannot Say if the paragraph does not give enough information. Read qualifiers carefully, such as all, some, always, before, after, and may.
Q. Implement and explain the four pillars of OOP (Inheritance, Polymorphism, Abstraction, Encapsulation) in Python
asked 1xmediumOOPTechnical2023
Ans. Implement them with classes: inheritance by subclassing, polymorphism by overriding methods and calling the same interface, abstraction by defining essential behaviour with base or abstract classes, and encapsulation by keeping state inside objects with controlled access. The key detail is designing clear interfaces; runtime cost is usually just normal method dispatch.
Q. Verbal reasoning questions based on short paragraphs where answers must be derived strictly from the given text
asked 1xmediumVerbalOnline test2020
Ans. Read the passage carefully and treat only its stated facts as true. For each statement, check whether it is directly supported, directly contradicted, or cannot be decided from the text. Do not use outside knowledge or assumptions. Watch for qualifiers such as all, some, usually, never, and compare wording exactly.
Q. Given pseudocode written in mixed programming language syntax (C/C++/Java/Python etc.), predict the final output.
asked 1xmediumLogical reasoningOnline test2024
Ans. Trace the code manually, not by guessing the language. Identify initial values, loop bounds, update steps, and operator precedence. Build a small table for changing variables. Watch for integer division, post and pre-increment, scope, and off-by-one errors. Follow the given pseudocode rules consistently until the final print statement.
Q. Explain Python concepts like decorators, xrange vs range, pass by reference, __init__, namespaces, *args vs **kwargs
asked 1xmediumPythonTechnical2023
Ans. Decorators wrap functions or classes to add behaviour; range creates sequences in Python 3 while xrange was Python 2’s lazy iterator. Python passes object references by assignment, so mutables can be changed. __init__ initialises new objects. Namespaces map names to objects. *args collects extra positional arguments, **kwargs collects extra named arguments.
Q. If given a laptop without an OS, explain how you would program on it and which programming language you would choose
asked 1xmediumOperating systemsTechnical2023
Ans. I would first boot it from a USB drive with a Linux installer or live environment, then install an OS and development tools. I would choose C initially, because it is close to the hardware, works well with minimal runtime support, and helps if I need to write or understand low-level system code.
Q. Explain all OOP concepts and demonstrate method overloading and method overriding with code using a real-life example.
asked 1xmediumOOPTechnical2019
Ans. OOP uses encapsulation, abstraction, inheritance and polymorphism to model real entities as objects. In a payment system, Payment hides card details, exposes pay, and CardPayment inherits it. Overloading means pay(amount) and pay(amount, currency) in one class. Overriding means CardPayment changes the parent pay behaviour. Method choice is constant time.
Q. Write code to demonstrate the four pillars of Object-Oriented Programming using a real-world example like a car system.
asked 1xmediumOOPTechnical2024
Ans. Model a car system with a Car class encapsulating speed and fuel, a Vehicle base class for inheritance, a start method overridden by ElectricCar for polymorphism, and an abstract Serviceable interface for abstraction. Use objects holding fields and method tables. Operations like start, accelerate, and refuel are O(1).
Q. How would you manage a team?
asked 1xeasyLeadershipHR2023
Ans. Pick an example where you set direction, clarified roles, supported people, and handled a problem without taking over. Emphasise communication, trust, accountability, feedback, and adapting your style to different team members. Interviewers listen for calm leadership, fairness, measurable outcomes, and evidence that you develop people rather than just control tasks.
Q. How do you handle conflicts within a team?
asked 1xeasyConflict resolutionHR2024
Ans. Choose a real example where the conflict affected delivery, not just personalities. Emphasise that you listened to both sides, clarified facts, kept focus on the shared goal, and helped agree a practical next step. Interviewers listen for maturity, calm communication, accountability, and a positive outcome or lesson learned.
Showing 60 of 115 questions. Ranked by how often the same question came back across interviews.