Q. What is Agile software development?
asked 2xeasySoftware engineeringTechnical2021-2024
Ans. Agile software development is an iterative approach where teams deliver small, working increments of software and adapt based on feedback. The key idea is to value collaboration, customer feedback, and responding to change over rigid upfront planning, often using short cycles such as sprints to plan, build, test, and review features.
Q. Swap two numbers without using a third variable
asked 2xeasyMathTechnical2019-2023
Ans. Swap them using arithmetic: set the first number to the sum of both, set the second to the new first minus the second, then set the first to the new first minus the new second. This uses constant space and constant time. The key caveat is integer overflow, so a temporary variable is usually safer.
Q. Explain the difference between a thread and a process.
asked 2xeasyOperating systemsTechnical2021
Ans. A process is an independent running program with its own memory space, while a thread is a smaller unit of execution within a process that shares that process’s memory. Processes are more isolated and cost more to create or switch between. Threads are lighter, but shared memory makes synchronisation and race conditions important.
Q. Explain ACID properties in DBMS.
asked 1xmediumDBMSTechnical2022
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. Explain paging in operating systems.
asked 1xmediumOperating systemsTechnical2019
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. What are software design principles?
asked 1xmediumSoftware engineeringTechnical2021
Ans. Software design principles are guidelines for structuring code so it is easier to understand, change, test and maintain. They include ideas such as separation of concerns, low coupling, high cohesion, encapsulation and the SOLID principles. The key point is that they reduce complexity and help systems evolve safely over time.
Q. Can you override the main function in Java?
asked 1xmediumOOPTechnical2024
Ans. No, you cannot override the main function in Java because main is static, and static methods are not overridden. They can only be hidden in a subclass if the same signature is declared. You can overload main with different parameters, but the JVM starts only public static void main(String[] args).
Q. What is static binding and dynamic binding?
asked 1xmediumOOPTechnical2020
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. Can we store custom objects in a Set in Java?
asked 1xmediumJavaTechnical2022
Ans. Yes, we can store custom objects in a Set in Java. The key detail is how uniqueness is decided: for HashSet or LinkedHashSet, override equals and hashCode correctly. For TreeSet, provide Comparable or a Comparator, because it uses ordering to detect duplicates.
Q. Explain Router, Switch, Hub, and the OSI model
asked 1xmediumNetworkingTechnical2023
Ans. A hub broadcasts traffic to all ports, a switch forwards frames to the correct device on a LAN, and a router forwards packets between networks. In the OSI model, hubs are layer 1, switches usually layer 2, and routers layer 3. The OSI layers are physical, data link, network, transport, session, presentation, and application.
Q. What is multithreading and when should it be used?
asked 1xmediumOperating systemsTechnical2020
Ans. Multithreading is running multiple threads within the same process so work can progress concurrently while sharing the same memory space. It should be used for independent tasks, especially I/O-bound work or responsive applications, and sometimes CPU-bound work on multiple cores. The key concern is safely managing shared state to avoid race conditions and deadlocks.
Q. What is deadlock and how can deadlocks be resolved?
asked 1xmediumOperating systemsTechnical2021
Ans. Deadlock is a state where two or more processes wait forever because each holds a resource the others need. It is usually handled by preventing one of the necessary conditions, avoiding unsafe allocation with algorithms like Banker’s algorithm, or detecting cycles in a wait-for graph and recovering by aborting or rolling back processes.
Q. Explain multithreading and the sleep method in Java.
asked 1xmediumOperating systemsTechnical2022
Ans. Multithreading in Java means running multiple threads within one process so tasks can execute concurrently and share the same memory. The sleep method, Thread.sleep(milliseconds), pauses the currently running thread for at least that time. It does not release locks, and it can throw InterruptedException if interrupted.
Q. What are the different inheritance styles in Django?
asked 1xmediumOOPTechnical2020
Ans. Django model inheritance has three main styles: abstract base classes, multi-table inheritance, and proxy models. Abstract bases share fields without creating a parent table. Multi-table inheritance creates a table for each model and links them. Proxy models keep the same table but change Python behaviour, such as managers or ordering.
Q. Write SQL queries using GROUP BY and HAVING clauses.
asked 1xmediumSQLTechnical2019
Ans. Use GROUP BY to aggregate rows by one or more columns, and HAVING to filter the aggregated groups after calculation. For example, group orders by customer and count them, then use HAVING to keep only customers with more than five orders. WHERE filters rows before grouping, while HAVING filters groups after aggregation.
Q. Given an array of numbers, sort them in zig zag order.
asked 1xmediumArraysOnline test2021
Ans. Rearrange the array so elements alternate as a[0] < a[1] > a[2] < a[3] and so on. Scan once, keeping a flag for the expected relation; if the current pair violates it, swap them. This uses the array in place, needs no extra data structure, and runs in O(n) time.
Q. Explain OOP concepts such as interfaces and abstraction.
asked 1xmediumOOPTechnical2024
Ans. OOP organises software around objects that combine data and behaviour, while abstraction hides unnecessary detail and exposes only what users need. An interface defines a contract of methods a class must provide, without saying how. This lets code depend on capabilities rather than concrete classes, improving flexibility, testing, and maintainability.
Q. Explain web application architecture and protocols used.
asked 1xmediumWeb architectureTechnical2022
Ans. A typical web application uses a client, a web server or API layer, application services, caching, storage, and external services. The browser communicates over HTTPS using HTTP methods, often exchanging HTML, JSON, CSS, and JavaScript. The key detail is separation of concerns, so presentation, business logic, and data storage can scale and change independently.
Q. Find the longest palindromic substring in a given string.
asked 1xmediumStringsOnline test2019
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. Implement operator overloading to add two complex numbers
asked 1xmediumOOPTechnical2023
Ans. Define a Complex class with two numeric fields, real and imaginary, then overload the addition operator to return a new Complex object whose real part is the sum of both real parts and whose imaginary part is the sum of both imaginary parts. This uses a simple object data structure and runs in constant time.
Q. Reverse a string without reversing the special characters
asked 1xmediumStringsTechnical2023
Ans. Use two pointers from the start and end, swapping only normal characters and skipping special characters. Convert the string to a character array, move the left pointer until it finds a non-special character, do the same from the right, then swap. Special characters stay fixed. Time complexity is O(n), space is O(n).
Q. Find k pairs with the smallest sums from two sorted arrays.
asked 1xmediumArraysOnline test2024
Ans. Use a min heap of candidate pairs, ordered by sum. Push pairs using the first element of the second array with up to min(k, n) elements from the first array. Repeatedly pop the smallest pair, add it to the answer, then push the same first index with the next second index. Time is O(k log min(k, n)).
Q. Describe how you would handle a challenging situation at work
asked 1xmediumConflict resolutionManagerial2023
Ans. Choose a real situation with pressure, conflict, ambiguity, or a setback, but avoid blaming others. Emphasise your role, the action you took, how you communicated, and the outcome. Interviewers listen for calm judgement, ownership, collaboration, and learning. A strong answer shows you solved the issue professionally and improved something afterwards.
Q. Explain OOPS concepts and demonstrate polymorphism with code.
asked 1xmediumOOPTechnical2022
Ans. OOPS is based on encapsulation, abstraction, inheritance and polymorphism. Encapsulation hides state, abstraction exposes essentials, inheritance reuses behaviour, and polymorphism lets the same interface call different implementations. For example, a Shape reference can point to Circle or Rectangle, and calling area uses the correct overridden method. Dispatch is constant time in typical implementations.
Q. What is unit testing and what are software design principles?
asked 1xmediumSoftware engineeringTechnical2021
Ans. Unit testing is testing small, isolated parts of code, usually individual functions or classes, to check they behave correctly. Software design principles are guidelines for building maintainable systems, such as separation of concerns, loose coupling, high cohesion, and SOLID. The key detail is that good design makes unit testing easier and more reliable.
Q. Explain Hibernate SessionFactory and compare JDBC vs Hibernate
asked 1xmediumDBMSTechnical2021
Ans. Hibernate SessionFactory is a heavyweight, thread-safe factory that creates Session objects for database operations and is usually built once per application. JDBC is low-level and requires manual SQL, connection handling and result mapping. Hibernate is an ORM that maps objects to tables, manages caching, transactions and dirty checking, but adds complexity and less direct control.
Q. Given an array of integers, find all subarrays whose sum is 0.
asked 1xmediumArraysTechnical2020
Ans. Use prefix sums and a hash map from prefix sum value to all indices where it appeared. If the same prefix sum appears at indices i and j, the subarray i + 1 to j sums to 0. Store prefix sum 0 at index -1. Time is O(n + k), where k is the number of answers, space is O(n).
Q. How would you work on a website that is already in production?
asked 1xmediumSoftware engineeringTechnical2021
Ans. I would never make direct changes on the live site. I would work in a local or development environment, use version control, test the change, then deploy through staging to production. The most important detail is to have a rollback plan, such as a backup or previous release, in case something breaks.
Q. Explain binary trees, binary search trees, heaps and max heaps.
asked 1xmediumTreesTechnical2022
Ans. A binary tree is a tree where each node has at most two children. A binary search tree keeps left values smaller and right values larger, enabling average O(log n) search, insert and delete if balanced. A heap is a complete binary tree with heap order. A max heap keeps each parent greater than or equal to its children.
Q. How do you ensure that a program follows good coding practices?
asked 1xmediumOOPTechnical2021
Ans. I ensure good coding practices by following agreed style guidelines, writing simple and readable code, and reviewing changes before they are merged. The most important detail is using automated checks, such as linters, formatters, static analysis, and tests, so standards are enforced consistently rather than relying only on individual judgement.
Q. Write a Java program to sort an array using binary search logic.
asked 1xmediumSortingTechnical2022
Ans. Use binary insertion sort: iterate from the second element, use binary search on the already sorted left part to find the correct insertion index, then shift larger elements right and insert the value. The array itself is the data structure. Search is O(log n), but shifting makes total time O(n²).
Q. Explain Java Collections framework and its commonly used classes.
asked 1xmediumOOPTechnical2019
Ans. The Java Collections framework is a set of interfaces and classes for storing, accessing and manipulating groups of objects. Common interfaces are List, Set, Queue and Map. Common classes include ArrayList, LinkedList, HashSet, TreeSet, HashMap and PriorityQueue. The key detail is choosing by behaviour, such as ordering, uniqueness, key lookup and performance.
Q. Write code to convert a given number into its word representation.
asked 1xmediumStringsTechnical2023
Ans. Convert the number by splitting it into three digit groups, translating each group, and appending scale words like thousand, million, and billion. Use arrays for ones, teens, tens, and scales. Handle zero separately, skip empty groups, and join parts with spaces. Time complexity is O(d), where d is the number of digits.
Q. Find the number of distinct palindromic substrings of a given string
asked 1xmediumStringsOnline test2020
Ans. Build a palindromic tree, also called an Eertree, and the number of distinct palindromic substrings is the number of non-root nodes. Insert characters one by one, following suffix links to find the longest palindromic suffix that can be extended. This gives O(n) time and O(n) space.
Q. How do you handle challenging situations or ethical dilemmas at work?
asked 1xmediumConflict resolutionHR2022
Ans. Choose a real situation where the stakes were clear, such as pressure to hide an error, misuse data, or bypass a process. Emphasise staying calm, gathering facts, considering policy and impact, seeking advice when appropriate, and acting transparently. Interviewers listen for judgement, integrity, accountability, and respect for people affected.
Q. Divide the number 17 into three parts in the ratios 1:9, 1:3, and 1:5.
asked 1xmediumLogical reasoningHR2023
Ans. Treat the given ratios as fractions: 1/9, 1/3, and 1/5. Add them: 1/9 + 1/3 + 1/5 = 29/45. Each part is 17 multiplied by its fraction divided by 29/45. The three parts are 85/29, 255/29, and 153/29.
Q. Explain the usage of HashMap and solve a related DSA problem using it.
asked 1xmediumHashingTechnical2023
Ans. A HashMap stores key value pairs and gives average O(1) lookup, insertion and deletion. For Two Sum, scan the array once, and for each number check whether target minus number is already in the map. If yes, return both indices. Otherwise store the number with its index. Time is O(n), space is O(n).
Q. What is Agile methodology and what do you know about low-level design?
asked 1xmediumSoftware engineeringTechnical2021
Ans. Agile is an iterative software development approach where teams deliver small increments, get feedback early, and adapt quickly to change. Low-level design is the detailed design of components, classes, interfaces, methods, data structures, and interactions before coding. The key point is that Agile guides delivery, while low-level design guides implementation.
Q. How do you handle workload and adapt to fast-paced, changing technologies?
asked 1xmediumAdaptabilityHR2021
Ans. Pick a situation where priorities changed, a deadline was tight, or a new tool had to be learned quickly. Emphasise how you prioritised, communicated trade-offs, learned efficiently, and stayed calm. Interviewers listen for organisation, curiosity, flexibility, ownership, and evidence that speed did not reduce quality or teamwork.
Q. What techniques can be used for database optimization in a web application?
asked 1xmediumDBMSTechnical2019
Ans. Use proper indexing, efficient queries, caching, pagination, connection pooling, normalised schema design, and database profiling. The most important detail is to measure first using slow query logs and execution plans, because indexes and query changes should target real bottlenecks rather than guesses. For larger systems, consider denormalisation, partitioning, and read replicas.
Q. Explain searching and sorting techniques along with their time complexities.
asked 1xmediumAlgorithmsTechnical2022
Ans. Searching finds an item in a collection, while sorting arranges items in order. Linear search checks each element and takes O(n). Binary search works on sorted data and takes O(log n). Common sorts include bubble, selection and insertion at O(n²), merge sort and heap sort at O(n log n), and quicksort average O(n log n), worst O(n²).
Q. Write an SQL query to find the second highest salary from an employee table.
asked 1xmediumSQLTechnical2022
Ans. Select the distinct salaries, sort them in descending order, and return the second row using an offset. The key detail is using distinct, so duplicate top salaries do not hide the true second highest salary. This approach sorts the salary values, so its typical time complexity is O(n log n).
Q. What happens internally when you type a URL like www.google.com in a browser?
asked 1xmediumNetworkingTechnical2021
Ans. The browser resolves the domain to an IP address, opens a connection to that server, sends an HTTP or HTTPS request, receives a response, and renders the page. The key step is DNS lookup: www.google.com is translated into an IP address, often using cache first, then recursive DNS servers if needed.
Q. Explain JavaScript asynchronous behavior and how async/await works internally.
asked 1xmediumJavaScriptTechnical2023
Ans. JavaScript is single threaded, but it handles asynchronous work through the event loop, callback queues and browser or runtime APIs. Timers, I/O and promises run outside the call stack, then resume later. Async functions always return a Promise. Await pauses that function, schedules the continuation as a microtask, and lets other code run.
Q. Generate all distinct subsequences of a string in lexicographic (sorted) order
asked 1xmediumStringsOnline test2020
Ans. Use backtracking to build every subsequence, store each result in a sorted set, then output the set in order. The sorted set removes duplicates caused by repeated characters and maintains lexicographic order. This generates 2^n candidates, with insertion costs, so time is about O(2^n n log k) and space O(kn).
Q. How can data be stored efficiently in databases when high traffic is expected?
asked 1xmediumDBMSTechnical2021
Ans. Store data using a schema designed for the main access patterns, with proper indexing, partitioning, and controlled denormalisation where reads are heavy. The most important detail is to avoid full table scans under load, so frequently queried fields should be indexed and large tables split by key, range, or time.
Q. Describe a difficult or challenging situation you faced and how you resolved it.
asked 1xmediumProblem solvingHR2021
Ans. Choose a recent work situation with real stakes, such as a missed deadline, conflict, outage, or demanding client. Emphasise your specific actions, judgement, communication, and ownership. Show how you stayed calm, involved others appropriately, made trade-offs, and achieved a measurable result. Interviewers listen for resilience, accountability, and learning.
Q. How would you design a scalable web application and handle scalability concerns?
asked 1xmediumScalabilityTechnical2019
Ans. I would design it as stateless application services behind a load balancer, backed by scalable data stores, caching, queues, and strong observability. The most important detail is separating read, write, and background work so each can scale independently, with horizontal scaling, database indexing, read replicas, rate limiting, auto-scaling, and clear failure handling.
Q. What is multithreading? Write a simple program demonstrating the use of threads.
asked 1xmediumOperating systemsTechnical2019
Ans. Multithreading is running multiple threads within one process so tasks can progress concurrently while sharing the same memory. A simple demonstration is a program that creates two Thread objects, each printing numbers from 1 to 5, starts both, then joins them. It uses no special data structure, and each thread runs in O(n) time.
Q. Convert real-life scenarios into Object-Oriented design using classes and objects.
asked 1xmediumOOPTechnical2021
Ans. Model the main real-world things as classes, their individual examples as objects, their data as attributes, and their actions as methods. For example, in a library system, Book, Member, and Librarian are classes; a specific copy of a book is an object. The key is defining clear responsibilities and relationships between classes.
Q. Solve the Josephus Problem to determine the position of the last remaining person.
asked 1xmediumRecursionOnline test2024
Ans. Compute the survivor with the recurrence survivor = (survivor + k) mod i for i from 1 to n, starting survivor at 0. This gives the 0-indexed position; add 1 for a 1-indexed answer. Use an iterative approach with constant storage, taking O(n) time and O(1) space.
Q. What are the ways to create a String in Java and where are string literals stored?
asked 1xmediumJavaTechnical2022
Ans. A String in Java can be created using a string literal, using new String(), from a character or byte array, or by converting another object such as StringBuilder with toString(). String literals are stored in the String Pool, which is part of the heap in modern Java. Identical literals share the same pooled object.
Q. Given a source vertex in a graph, find the shortest distances to all other vertices.
asked 1xmediumGraphsOnline test2020
Ans. Use BFS for an unweighted graph and Dijkstra’s algorithm for a weighted graph with non-negative edge weights. Store distances in an array, initialise the source to 0 and others to infinity. BFS uses a queue and runs in O(V + E). Dijkstra uses a min-priority queue and runs in O((V + E) log V).
Q. How would you handle a situation where one of your team members is performing poorly?
asked 1xmediumConflict resolutionHR2020
Ans. Pick a real example where you addressed poor performance early and fairly. Emphasise understanding the cause, giving clear feedback, agreeing measurable improvements, offering support, and following up consistently. Show you balanced empathy with accountability. Interviewers listen for maturity, direct communication, documentation, and a focus on team outcomes rather than blame.
Q. Explain OOP concepts including function overloading, overriding, and virtual functions
asked 1xmediumOOPTechnical2023
Ans. OOP organises code around objects that combine state and behaviour, using encapsulation, abstraction, inheritance and polymorphism. Function overloading means same function name with different parameter lists, resolved at compile time. Overriding means a subclass provides a new implementation of a parent method. Virtual functions enable runtime dispatch, so the correct overridden method is called through a base reference.
Q. Describe a situation where you had to manage a team or handle a conflict within a team.
asked 1xmediumTeamworkHR2022
Ans. Choose a real team conflict with clear stakes, such as missed deadlines, unclear ownership, or tension between colleagues. Emphasise how you listened to both sides, clarified facts, set expectations, and kept the work moving. Interviewers listen for maturity, fairness, communication, accountability, and a practical outcome, not blame or drama.
Q. Discuss common data structures and algorithms and how they are used in problem solving.
asked 1xmediumGeneralTechnical2023
Ans. Common data structures include arrays, linked lists, stacks, queues, hash tables, trees, heaps, and graphs, while common algorithms include sorting, searching, recursion, dynamic programming, greedy methods, and graph traversal. They help model the problem efficiently, choose fast operations, and reduce time or space complexity, often deciding whether a solution scales.
Q. Given two containers of size a and b liters, how can you measure exactly x liters of water?
asked 1xmediumLogical reasoningTechnical2019
Ans. It is possible exactly when x is no more than max(a, b) and x is divisible by gcd(a, b). Use the Euclidean method: fill one container, pour into the other until full, empty the full one, and repeat. The amounts reached are multiples of gcd(a, b), so you stop when x appears.
Q. Design a car parking system using object-oriented principles and implement it using classes.
asked 1xmediumOOPTechnical2021
Ans. Model it with ParkingLot, Floor, Spot, Vehicle, Ticket and Payment classes. ParkingLot owns floors, Floor owns spots by type, Vehicle has size, and Ticket links vehicle, spot and entry time. Keep available spots in queues or sets per type for O(1) allocation and release, with payment calculated on exit.
Q. Solve logic-based puzzle problems under time pressure.
asked 1xunknownLogical reasoningHR2024
Ans. I solve these by writing down the facts, turning each clue into a constraint, and eliminating impossible options. I look for the strongest clue first, then test remaining cases systematically. Under time pressure, I avoid guessing and state assumptions clearly. If no unique answer follows, I explain why the information is insufficient.
Showing 60 of 191 questions. Ranked by how often the same question came back across interviews.