Q. Logical reasoning problems
asked 2xmediumLogical reasoningOnline test2015-2016
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. Explain the difference between String, StringBuffer, and StringBuilder in Java
asked 2xmediumOOPManagerial, Technical2017-2019
Ans. String is immutable, while StringBuffer and StringBuilder are mutable classes for changing text. String creates a new object on each modification. StringBuffer is synchronised, so it is thread-safe but slower. StringBuilder is not synchronised, so it is faster and preferred for most single-threaded string construction.
Q. Explain the Software Development Life Cycle (SDLC).
asked 2xeasyOOPTechnical2017-2019
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. Difference between an Interface and an Abstract Class
asked 2xeasyOOPTechnical2019
Ans. An abstract class is a base class that can share state and implemented behaviour, while an interface defines a contract that classes agree to implement. The key detail is inheritance: a class usually extends one abstract class, but can implement multiple interfaces, making interfaces better for capabilities across unrelated classes.
Q. Find the sum of all proper divisors of a given natural number
asked 2xeasyMathOnline test2019
Ans. Compute the sum by iterating i from 1 to square root of n and adding divisors in pairs. If i divides n, add i, and add n / i if it is different from i and not equal to n. For n = 1, the sum is 0. Time complexity is O(sqrt n).
Q. Explain cascade update in DBMS
asked 1xmediumDBMSTechnical2017
Ans. Cascade update is a referential integrity action where changes to a referenced key in a parent table are automatically applied to matching foreign keys in child tables. It is usually defined with ON UPDATE CASCADE. This keeps related records consistent and prevents broken references when a primary or unique key value changes.
Q. Explain how a ROC curve works.
asked 1xmediumMachine learningTechnical2017
Ans. A ROC curve shows how a binary classifier performs as its decision threshold changes. It plots true positive rate against false positive rate for many thresholds. A curve closer to the top left is better, and the AUC summarises this performance, with 1 meaning perfect separation and 0.5 meaning random guessing.
Q. Quantitative aptitude problems
asked 1xmediumQuantitativeOnline test2015
Ans. Identify what is being asked, list the given values, and choose the right formula or concept, such as percentage, ratio, time and work, speed, profit, or probability. Convert units if needed, form a simple equation, solve step by step, and check whether the answer is reasonable.
Q. Explain SQL joins and transactions
asked 1xmediumDBMSTechnical2015
Ans. SQL joins combine rows from related tables, while transactions group database operations into one reliable unit of work. Common joins include inner join for matching rows, left join for all left-table rows, and right or full joins for broader inclusion. Transactions follow ACID principles, especially commit to save changes and rollback to undo failures.
Q. Implement a stack using two queues
asked 1xmediumQueuesTechnical2021
Ans. Use two queues by making push costly: enqueue the new element into the empty helper queue, move all elements from the main queue into it, then swap the queue names. The front of the main queue is always the stack top. Push is O(n), while pop, top, and empty are O(1).
Q. Logical reasoning aptitude questions
asked 1xmediumLogical reasoningOnline test2017
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. Find the factorial of a large number.
asked 1xmediumArraysTechnical2015
Ans. Use an array or vector to store the factorial digits in reverse order and simulate multiplication digit by digit. Start with 1, multiply the stored number by each integer from 2 to n, carrying overflow across digits. This avoids fixed integer limits. Time complexity is roughly O(n × number of digits).
Q. Write code for file handling in Java.
asked 1xmediumOOPTechnical2017
Ans. Use try-with-resources with BufferedReader to read and BufferedWriter or Files.write to write, so streams close automatically. Read each line into a String or process it immediately; use a List<String> only if all lines must be stored. Time complexity is O(n), where n is file size.
Q. Puzzle: Prisoner and Policeman Puzzle.
asked 1xmediumLogical reasoningTechnical2015
Ans. The prisoner should say, “You will shoot me.” If the policeman shoots him, the statement was true, so he should have been hanged instead. If the policeman hangs him, the statement was false, so he should have been shot instead. Both punishments break the rule, so he cannot be punished consistently.
Q. What is IPC? What is a race condition?
asked 1xmediumOperating systemsTechnical2016
Ans. IPC is inter-process communication, the ways separate processes exchange data or signals, and a race condition is a bug where the result depends on unpredictable timing between concurrent operations. IPC uses mechanisms such as pipes, sockets, shared memory or message queues. Race conditions are prevented with synchronisation such as locks, semaphores or atomic operations.
Q. What is partial functional dependency?
asked 1xmediumDBMSTechnical2017
Ans. Partial functional dependency is when a non-key attribute depends on only part of a composite candidate key, rather than on the whole key. It matters in database normalisation because it causes redundancy and update anomalies. A relation with partial dependencies is not in Second Normal Form.
Q. What are semaphores in Operating Systems?
asked 1xmediumOperating systemsTechnical2015
Ans. Semaphores are synchronisation primitives used by an operating system to control access to shared resources between processes or threads. A semaphore is usually an integer counter changed only by atomic wait and signal operations. Binary semaphores act like locks, while counting semaphores allow a fixed number of concurrent users.
Q. What is a semaphore in operating systems?
asked 1xmediumOperating systemsManagerial2019
Ans. A semaphore is a synchronisation primitive used by an operating system to control access to shared resources between threads or processes. It maintains a counter that is changed only by atomic wait and signal operations. A binary semaphore acts like a lock, while a counting semaphore allows a fixed number of concurrent users.
Q. Why do we use paging in operating systems?
asked 1xmediumOperating systemsTechnical2017
Ans. We use paging to let each process have a virtual address space while physical memory is managed in fixed-size blocks. Pages can be placed in any free frame, so memory need not be contiguous and external fragmentation is avoided. It also supports isolation, sharing, and moving pages between RAM and disk.
Q. English language and comprehension questions
asked 1xmediumVerbalOnline test2017
Ans. Read the question first, then read the passage or sentence carefully for meaning, tone and context. Identify keywords and eliminate options that are clearly wrong. For vocabulary, use surrounding words to infer meaning. For grammar, check subject-verb agreement, tense, articles, prepositions and sentence structure before choosing the best answer.
Q. Explain OOPS concepts with real-life examples
asked 1xmediumOOPTechnical2016
Ans. OOPS is a way to model software as objects that combine data and behaviour. A class is a blueprint, like Car, and an object is a specific car. Encapsulation hides engine details behind controls. Inheritance lets ElectricCar reuse Car features. Polymorphism lets different vehicles respond to start differently. Abstraction shows only essential details.
Q. Puzzle: Find the jar with contaminated pills.
asked 1xmediumLogical reasoningTechnical2015
Ans. Number the jars 1 to n. Take 1 pill from jar 1, 2 from jar 2, and so on, then weigh the combined sample once. Compare with the expected weight if all were normal. The weight difference, divided by the contamination weight difference per pill, gives the contaminated jar number.
Q. How would you handle noisy and incomplete data?
asked 1xmediumMachine learningTechnical2017
Ans. I would first profile the data, quantify missing values and noise, then choose cleaning rules based on the use case. Missing values can be imputed, flagged, or removed, while noisy values can be capped, smoothed, corrected, or treated as outliers. The key detail is to document assumptions and avoid introducing bias.
Q. Explain cosine similarity and TF-IDF vectorization.
asked 1xmediumMachine learningTechnical2017
Ans. Cosine similarity measures how similar two vectors are by the cosine of the angle between them, while TF-IDF vectorization converts text into weighted term vectors. TF-IDF gives high weight to words frequent in one document but rare across the corpus, and cosine similarity then compares documents independent of their length.
Q. Explain the layers of the OSI model and the HTTP protocol.
asked 1xmediumNetworkingTechnical2019
Ans. The OSI model has seven layers: physical, data link, network, transport, session, presentation and application. Each layer abstracts part of communication, from bits on a wire to user-facing protocols. HTTP is an application-layer protocol using a request-response model, usually over TCP, or over TLS as HTTPS, to transfer web resources.
Q. Explain memory allocation and deallocation in C++ and Java.
asked 1xmediumMemory managementManagerial2020
Ans. C++ uses stack allocation for local objects and heap allocation with new, usually released with delete or managed safely by RAII and smart pointers. Java allocates objects on the heap and deallocates them automatically using garbage collection when they are no longer reachable. The key difference is explicit lifetime control in C++ versus managed memory in Java.
Q. How do you decide when to use a stack, linked list, or array?
asked 1xmediumData structuresTechnical2017
Ans. Use an array when you need fast indexed access and mostly fixed size data, a linked list when you need frequent insertions or deletions in the middle, and a stack when access is last in, first out. The key trade off is access versus update cost: arrays index in constant time, linked lists do not.
Q. Write a Java program to implement a stack using a linked list
asked 1xmediumLinked listsTechnical2017
Ans. Implement the stack with a singly linked list and keep a top reference to the first node. Each node stores the value and a next pointer. Push creates a new node and links it before top. Pop removes top and returns its value. Peek reads top. Push, pop and peek are O(1).
Q. Quantitative aptitude problems (speed, arithmetic, basic math)
asked 1xmediumQuantitativeOnline test2016
Ans. Start by identifying what is being asked, then write down the given values and the relevant formula or operation. Convert units if needed, simplify the arithmetic, and estimate the answer to check reasonableness. For speed questions, use distance equals speed times time. For basic maths, work step by step and avoid mental shortcuts that cause errors.
Q. How many times do the hands of a clock cross each other in a day?
asked 1xmediumProbabilityManagerial2019
Ans. 22 times. The minute hand gains on the hour hand at a relative speed of 11 hours’ worth of angle every 12 hours, so it catches it 11 times in each 12-hour period. Over a full 24-hour day, that happens twice, giving 11 × 2 = 22 crossings.
Q. Find duplicates in an array in O(n) time and constant extra space.
asked 1xmediumArraysTechnical2017
Ans. Use the array itself as a marker: for each value x, look at index abs(x) minus one, and negate the value there if it is positive. If it is already negative, x is a duplicate. This works in O(n) time and O(1) extra space, assuming values are in 1 to n.
Q. Solve the given logical puzzle related to switching and observation
asked 1xmediumLogical reasoningTechnical2019
Ans. Turn switch A on for several minutes, then turn it off. Turn switch B on and enter the room. If the bulb is on, B controls it. If it is off but warm, A controls it. If it is off and cold, C controls it. Heat gives the extra observation needed.
Q. Explain Bubble Sort and write its implementation using a Linked List
asked 1xmediumSortingTechnical2019
Ans. Bubble Sort repeatedly traverses the linked list, compares adjacent nodes, and swaps them if they are in the wrong order. For a linked list, it is usually simpler to swap node data rather than relink nodes. Repeat passes until no swaps occur. It uses the existing linked list, runs in O(n²) time and O(1) extra space.
Q. Explain operating system scheduling algorithms and context switching.
asked 1xmediumOperating systemsTechnical2024
Ans. Operating system scheduling algorithms decide which ready process or thread runs on the CPU next, using policies such as First Come First Served, Shortest Job First, Round Robin, priority scheduling, and multilevel queues. Context switching is the mechanism that saves the current task’s CPU state and loads another’s, enabling multitasking but adding overhead.
Q. Explain Matrix Factorization using Singular Value Decomposition (SVD).
asked 1xmediumMachine learningTechnical2017
Ans. Matrix factorisation using SVD decomposes a matrix A into three matrices: U, Σ, and Vᵀ, where U and V contain orthogonal singular vectors and Σ contains singular values. The most important use is low-rank approximation: keeping only the largest singular values captures the main structure while reducing noise, storage, and computation.
Q. English language aptitude questions (grammar, comprehension, vocabulary)
asked 1xmediumVerbalOnline test2015
Ans. Read the question carefully and identify whether it tests grammar, meaning, tone, or inference. For grammar, check subject verb agreement, tense, articles, prepositions, and sentence structure. For vocabulary, use context clues and word roots. For comprehension, read the passage first, then match each option to evidence in the text.
Q. Estimate how many 2-wheelers and 4-wheelers are present in a small town.
asked 1xmediumLogical reasoningTechnical2020
Ans. About 15,000 two-wheelers and 4,000 four-wheelers. Assume a small town has 50,000 people, or 12,500 households at four people each. If 80% of households own one two-wheeler and 30% own a car, that gives 10,000 two-wheelers and 3,750 cars. Add commercial and extra vehicles, giving roughly these totals.
Q. In a single-core CPU with two processes, how does the OS scheduler work?
asked 1xmediumOperating systemsManagerial2021
Ans. On a single-core CPU, the scheduler lets only one process run at a time and switches between the two by time-slicing or when one blocks. A timer interrupt or system call returns control to the kernel, which saves the current process state, chooses the next ready process, restores its state and resumes it.
Q. Write code to run two tasks simultaneously in Java (thread implementation)
asked 1xmediumMultithreadingTechnical2017
Ans. Create two Runnable tasks, wrap each in a Thread, call start on both threads, then optionally call join to wait for both to finish. Use Thread objects as the core structure. The important detail is to call start, not run, because start creates concurrent execution. Time complexity is the combined work of both tasks.
Q. Explain how variables are allocated memory in Java, including stack and heap usage
asked 1xmediumMemory managementTechnical2017
Ans. In Java, local variables and method call frames are stored on the stack, while objects created with new are stored on the heap. Primitive local variables hold their values on the stack, but reference variables hold addresses to heap objects. Object fields live with the object on the heap, and heap memory is garbage collected.
Q. Insert a node at the second last position of a singly linked list in only one traversal
asked 1xmediumLinked listsTechnical2019
Ans. Traverse once to the last node while keeping the previous node, then insert the new node between previous and last. If the list has zero or one node, insert the new node at the head. This uses only pointers, needs no extra data structure, and runs in O(n) time with O(1) space.
Q. When should different sorting algorithms be used, and what are their time complexities?
asked 1xmediumSortingTechnical2020
Ans. Use quicksort for general in-memory sorting, mergesort when stability or linked lists matter, heapsort when worst-case memory is tight, insertion sort for small or nearly sorted data, and counting or radix sort for bounded keys. Quicksort averages O(n log n) but worst O(n²); merge and heap are O(n log n); insertion is O(n²); counting is O(n + k).
Q. Check whether a file exists in a directory given its path, including all child directories
asked 1xmediumOperating systemsTechnical2019
Ans. Traverse the given directory recursively and return true when any encountered file matches the target path or name. Use depth first search with the call stack, or an explicit stack, to visit each child directory. The key detail is to handle permission errors and symbolic links safely. Time complexity is O(n), where n is entries visited.
Q. Computer ability questions covering data structures, C output, basic DBMS and OOP concepts
asked 1xmediumOOPOnline test2015
Ans. Focus on core definitions, trace logic carefully, and explain trade-offs clearly. For data structures, know arrays, linked lists, stacks, queues, trees and hashing with time complexities. For C output, follow operator precedence and memory behaviour. For DBMS, revise keys, normalisation, joins and transactions. For OOP, know encapsulation, inheritance, polymorphism and abstraction.
Q. Explain Object-Oriented Programming (OOP) concepts and write sample code demonstrating them
asked 1xmediumOOPTechnical2017
Ans. OOP models software as objects that combine state and behaviour. Encapsulation hides internal data, abstraction exposes only useful operations, inheritance reuses and extends existing classes, and polymorphism lets different objects respond to the same method call differently. For example, Animal can define speak, while Dog and Cat override it. Method dispatch is typically constant time.
Q. What is a trigger? What is a stored procedure? Difference between trigger and stored procedure
asked 1xmediumDBMSTechnical2016
Ans. A trigger is database code that runs automatically when an event occurs, such as an insert, update, or delete; a stored procedure is a saved database program that is run explicitly by a user, application, or job. The key difference is control: triggers are event driven, while stored procedures are called deliberately.
Q. Given 3 bulbs and 3 switches in another room, how do you determine which switch controls which bulb?
asked 1xmediumLogical reasoningTechnical2019
Ans. Turn switch 1 on for several minutes, then turn it off. Turn switch 2 on and leave switch 3 off. Go to the bulb room. The lit bulb is controlled by switch 2. Of the two unlit bulbs, the warm one is controlled by switch 1, and the cold one by switch 3.
Q. How can you represent days of a month (1 to 31) using two six-sided dice labeled with digits 0 to 9?
asked 1xmediumLogical reasoningHR2016
Ans. Label the dice 0, 1, 2, 3, 4, 5 and 0, 1, 2, 6, 7, 8, using 6 upside down as 9. Both dice need 0 for 01 to 09, and both need 1 and 2 for 11 and 22. This covers every date from 01 to 31.
Q. Given a real-world situation, design a class and demonstrate the use of OOP concepts to solve the problem.
asked 1xmediumOOPManagerial2019
Ans. Design a LibraryItem class with fields like title, id and availability, and methods such as borrow and returnItem. Book and DVD can inherit from it and override loanPeriod. A LibraryMember class borrows items through public methods, keeping data encapsulated. This shows abstraction, inheritance, polymorphism and encapsulation in a practical system.
Q. Estimate how many people in a city (e.g., Bhopal) are having tea at 4:30 PM using assumptions and demographics
asked 1xmediumLogical reasoningHR2017
Ans. About 1 to 2 lakh people. Start with population, say 20 lakh. Exclude small children and some non-tea drinkers, leaving about 12 lakh potential tea drinkers. Estimate what share drinks tea in the evening, perhaps 40 percent, and what share specifically at 4:30 PM, say 25 to 30 percent. That gives roughly 1.2 to 1.5 lakh.
Q. Given a run-length encoded string like a3b5c3 (which expands to aaabbbbbccc), find the k-th character in the expanded string.
asked 1xmediumStringsOnline test2020
Ans. Scan the encoded string left to right, reading each character and its following full number, and keep a running total of expanded length. When the running total becomes at least k, return that character. This avoids building the expanded string, uses constant extra space, and runs in O(n) time over the encoded input.
Q. Design an HTML form with a textbox to enter a room number and write backend connectivity code and a query to find the student name for that room
asked 1xmediumDBMSTechnical2019
Ans. Create an HTML form with one text input named room_number and submit it to a backend endpoint such as /findStudent. The backend reads room_number, validates it, and runs a parameterised SQL query: select student_name from students where room_number = ?. Store data in a students table. With an index on room_number, lookup is efficient.
Q. Given an N-floor building with a threshold floor where eggs start breaking, what is the minimum number of eggs required to determine the threshold floor?
asked 1xmediumLogical reasoningTechnical2015
Ans. One egg is sufficient, if the aim is only to guarantee finding the threshold and there is no limit on drops. Start at floor 1 and move up one floor at a time. The first floor where the egg breaks is the threshold. This may take N drops, but uses only one egg.
Q. Given 2 eggs and a 100-floor building, find the minimum number of trials needed in the worst case to find the highest floor from which an egg can be dropped without breaking.
asked 1xmediumLogical reasoningTechnical2015
Ans. The minimum worst-case number is 14 trials. Drop the first egg at floors 14, 27, 39, 50, and so on, reducing the gap by one each time. If it breaks, use the second egg to search linearly in the previous gap. Since 14 + 13 + ... + 1 = 105, 14 covers 100 floors.
Q. Explain Markov Chain Clustering including the algorithm and equations.
asked 1xhardMachine learningTechnical2017
Ans. Markov Chain Clustering finds graph clusters by simulating random walks, where flow becomes trapped in dense regions. Build a column-stochastic adjacency matrix M with self-loops. Iterate expansion M = M^e, usually e = 2, then inflation Mij = Mij^r / sum_k Mkj, usually r > 1. Prune small values and read clusters from the final matrix.
Q. Explain the working of the Expectation Maximization (EM) algorithm with equations.
asked 1xhardMachine learningTechnical2017
Ans. EM iteratively estimates hidden variables and parameters by alternating expectation and maximisation. For data X, latent Z and parameters θ, E-step computes Q(θ|θᵗ)=E_Z|X,θᵗ[log p(X,Z|θ)]. M-step updates θᵗ⁺¹=argmax_θ Q(θ|θᵗ). It increases or leaves unchanged the data likelihood p(X|θ) until convergence to a local optimum.
Q. What improvements would you suggest to enhance a booking ticket portal?
asked 1xeasyApplication designManagerial2019
Ans. I would improve reliability, fairness, and user experience by adding a virtual waiting room, real-time seat locking, idempotent payments, better search, and clear booking status updates. The most important detail is preventing overselling: reserve selected seats with a short TTL, confirm them only after successful payment, and release them automatically on timeout.
Q. How do you handle a badly behaving co-worker?
asked 1xunknownConflict resolutionManagerial2021
Ans. Choose a situation where you stayed professional, addressed the behaviour early, and focused on the work rather than personalities. Emphasise listening first, setting clear boundaries, documenting serious issues, and escalating only when needed. Interviewers listen for maturity, discretion, conflict handling, and whether you protect team performance without creating more drama.
Q. What are the best qualities you look for in a manager?
asked 1xunknownLeadershipManagerial2021
Ans. Pick two or three qualities linked to your best work, such as clear priorities, honest feedback, trust, and support when blockers appear. Ground them in a real example of a manager who helped you deliver. Emphasise how you respond to that style. Interviewers listen for self-awareness, maturity, and fit with their management culture.
Q. How would you motivate your juniors if you were a team lead?
asked 1xunknownLeadershipHR2017
Ans. Choose a real example where a junior was disengaged, underconfident, or struggling to grow. Emphasise understanding their goals, giving clear expectations, regular feedback, ownership, and recognition. Show you adapt your style to individuals. Interviewers listen for empathy, structure, accountability, and whether you motivate through support rather than pressure.
Showing 60 of 139 questions. Ranked by how often the same question came back across interviews.