Q. Reverse a linked list.
asked 2xeasyLinked listsTechnical2017-2020
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. Explain the ACID properties of DBMS.
asked 2xeasyDBMSTechnical2021-2023
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 the OSI Model and its layers
asked 2xeasyNetworkingTechnical2016-2021
Ans. The OSI model has seven layers: physical, data link, network, transport, session, presentation and application. They describe how data moves from raw bits on a medium, through framing, routing and reliable delivery, up to user-facing protocols. The key idea is separation of concerns, so each layer provides services to the one above.
Q. Count the number of set bits in a given number
asked 2xeasyBit manipulationTechnical2016-2020
Ans. Use Brian Kernighan’s algorithm: repeatedly replace n with n & (n - 1) and increment a counter until n becomes zero. Each operation removes the lowest set bit. The data used is just an integer counter. Time complexity is O(k), where k is the number of set bits, and space is O(1).
Q. What are the different types of software testing?
asked 2xeasySoftware engineeringManagerial, Technical2019-2021
Ans. Common types of software testing include unit, integration, system, acceptance, regression, performance, security, usability, smoke and exploratory testing. The most important distinction is between functional testing, which checks behaviour against requirements, and non-functional testing, which checks qualities such as speed, reliability, security and ease of use.
Q. Explain Object Oriented Programming (OOP) concepts.
asked 2xeasyOOPTechnical2021-2023
Ans. Object-Oriented Programming models software as objects that combine data and behaviour. The main concepts are encapsulation, which hides internal state; abstraction, which exposes only needed details; inheritance, which reuses and extends existing classes; and polymorphism, which lets different objects respond to the same interface in their own way.
Q. Explain storage classes in C/C++
asked 1xmediumOOPTechnical2016
Ans. Storage classes in C++ define an object’s lifetime, visibility, and linkage. The main specifiers are static, extern, thread_local, and mutable. Historically, auto and register were also storage class specifiers, but auto now means type deduction and register is obsolete. The key idea is how long data exists and where it can be accessed.
Q. Implement a tree data structure.
asked 1xmediumTreesTechnical2023
Ans. Implement a tree using nodes, where each node stores a value and references to its children. For a binary tree, each node has left and right references; for a general tree, use a list of children. Insertion and search are O(n) unless ordering rules, such as a binary search tree, are added.
Q. Write a variation of Merge Sort.
asked 1xmediumSortingTechnical2020
Ans. Use bottom-up Merge Sort, an iterative variation that merges runs of size 1, then 2, then 4, doubling each pass until the array is sorted. It uses an auxiliary array for merging. The time complexity is O(n log n), and the extra space complexity is O(n).
Q. Explain OS scheduling algorithms.
asked 1xmediumOperating systemsOnline test2020
Ans. OS scheduling algorithms decide which ready process or thread gets the CPU next. Common types include First Come First Served, Shortest Job First, Round Robin, Priority Scheduling, and Multilevel Queues. The key trade-off is between throughput, response time, fairness, and starvation; pre-emptive algorithms can interrupt tasks to improve responsiveness.
Q. Explain scheduling concepts in RTOS
asked 1xmediumOperating systemsManagerial2020
Ans. RTOS scheduling decides which ready task runs so timing deadlines are met predictably. Most RTOSs use priority based preemptive scheduling, where a higher priority ready task immediately interrupts a lower priority one. Key concepts include task states, context switching, interrupt latency, time slicing, priority inversion, and mechanisms like mutex priority inheritance.
Q. Explain UML diagrams and their usage
asked 1xmediumOOPTechnical2015
Ans. UML diagrams are standard visual models used to describe the structure and behaviour of a software system. They help teams communicate design clearly before and during development. Common examples include class diagrams for objects and relationships, sequence diagrams for interactions over time, and use case diagrams for user goals and system functions.
Q. Implement Merge Sort on a linked list.
asked 1xmediumLinked listsTechnical2019
Ans. Use merge sort by splitting the linked list into halves with slow and fast pointers, recursively sorting each half, then merging the two sorted lists by relinking nodes. The key detail is to cut the list at the middle before recursing. Time complexity is O(n log n), with O(log n) recursion stack space.
Q. Implement a stack using a linked list.
asked 1xmediumLinked listsTechnical2017
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. Explain SHA algorithms and their usage.
asked 1xmediumCryptographyTechnical2019
Ans. SHA algorithms are cryptographic hash functions that turn any input into a fixed-length digest, such as SHA-256 producing 256 bits. They are used for data integrity checks, digital signatures, certificates, Git object IDs and blockchain hashing. SHA-1 is considered broken; SHA-2 and SHA-3 are preferred. For passwords, use salted slow hashes instead.
Q. Compare HashTable and ConcurrentHashMap.
asked 1xmediumOOPTechnical2016
Ans. Hashtable is a legacy thread safe map that synchronises every method, while ConcurrentHashMap is a modern thread safe map designed for high concurrency. The key difference is locking granularity: Hashtable effectively locks the whole table for operations, but ConcurrentHashMap allows multiple reads and updates to proceed concurrently, giving much better scalability.
Q. Explain pointers and their usage in C/C++
asked 1xmediumOOPTechnical2016
Ans. Pointers are variables that store the memory address of another object or function. In C/C++, they are used to access or modify data indirectly, pass large objects efficiently, work with arrays and strings, allocate dynamic memory, and build data structures like linked lists. Care is needed to avoid null, dangling, or invalid pointers.
Q. Explain string and pointer concepts in C.
asked 1xmediumCTechnical2019
Ans. In C, a string is a sequence of characters ending with a null character, and a pointer is a variable that stores a memory address. Strings are usually handled through character arrays or char pointers. The key detail is that C does not store string length automatically, so correct null termination and memory management are essential.
Q. Explain virtualization and virtual memory
asked 1xmediumOperating systemsTechnical2020
Ans. Virtualization lets one physical computer run multiple isolated virtual machines, each behaving like its own computer. A hypervisor shares CPU, memory, storage and devices between them. Virtual memory is an operating system technique that gives each process a large private address space, mapping virtual addresses to physical RAM and disk when needed.
Q. Explain the working process of DHCP and DNS
asked 1xmediumNetworkingTechnical2024
Ans. DHCP automatically gives a device network settings, while DNS translates domain names into IP addresses. In DHCP, a client broadcasts discover, receives an offer, requests it, and gets an acknowledgement with IP, gateway and DNS server. In DNS, the resolver queries caches or DNS servers to find the IP for a hostname.
Q. Detect whether a linked list contains a loop
asked 1xmediumLinked listsTechnical2021
Ans. Use Floyd’s cycle detection algorithm with two pointers, slow and fast. Move slow by one node and fast by two nodes each step. If they ever meet, the linked list contains a loop. If fast reaches null, there is no loop. Time complexity is O(n), space complexity is O(1).
Q. Write code related to linked list operations
asked 1xmediumLinked listsTechnical2016
Ans. Use a Node structure with data and next fields, then implement traversal-based operations for insert, delete, search, and reverse. For insertion or deletion, update neighbouring next pointers carefully, especially at the head. Traversal, search, insertion at position, deletion, and reversal take O(n) time, while head insertion is O(1).
Q. Explain Kruskal’s algorithm and how it works.
asked 1xmediumGraphsTechnical2016
Ans. Kruskal’s algorithm finds a minimum spanning tree by choosing the cheapest edges that do not create a cycle. It sorts all edges by weight, then scans them in order, adding an edge if it connects two different components. A disjoint set union structure detects cycles efficiently. Time complexity is usually O(E log E).
Q. Explain processes vs threads and system calls.
asked 1xmediumOperating systemsTechnical2020
Ans. A process is an independent running program with its own address space, while threads are execution paths inside a process that share the same memory and resources. Processes are more isolated but costlier to create and switch. System calls are controlled requests from user programs to the operating system for services like file access, networking or process creation.
Q. What are system calls and why are they needed?
asked 1xmediumOperating systemsTechnical2015
Ans. System calls are the controlled interface through which a user program asks the operating system kernel to perform privileged operations. They are needed because programs should not directly access hardware, memory management, files, processes, or devices. This protection keeps the system stable and secure while still allowing programs to use operating system services.
Q. Explain threading concepts in operating systems
asked 1xmediumOperating systemsTechnical2020
Ans. Threads are the smallest schedulable units of execution within a process, sharing the same address space and resources while having their own stack, registers and program counter. They improve responsiveness and parallelism, but require synchronisation such as mutexes, semaphores or condition variables to avoid race conditions, deadlocks and inconsistent shared data.
Q. Explain the OSI model and functions of each layer.
asked 1xmediumNetworkingManagerial2020
Ans. The OSI model is a seven-layer framework for how network communication is organised: physical sends raw bits, data link handles frames and MAC addressing, network routes packets with IP, transport provides end-to-end delivery with TCP or UDP, session manages conversations, presentation formats, encrypts and compresses data, and application provides services such as HTTP, DNS and email.
Q. Explain the internal working of ConcurrentHashMap.
asked 1xmediumOOPTechnical2016
Ans. ConcurrentHashMap stores entries in a hash table and allows concurrent access by locking only the affected bucket or using lock-free CAS where possible. In Java 8, reads are mostly non-blocking, updates synchronise on a bin when needed, and heavily collided bins become trees. Resizing is done cooperatively by multiple threads.
Q. How are vectors internally implemented in C++ STL?
asked 1xmediumOOPTechnical2020
Ans. A C++ STL vector is implemented as a dynamically allocated contiguous array. It typically stores pointers to the start, the current end, and the end of allocated capacity. When capacity is exceeded, it allocates a larger block and moves or copies elements. Random access is O(1), while growth is amortised O(1).
Q. Implement and explain basic linked list operations
asked 1xmediumLinked listsTechnical2015
Ans. Use a Node containing data and a next pointer, and keep a head pointer for the list. Implement insert at head by relinking the new node to head, delete by finding the previous node, search by traversal, and display by walking from head. Insert at head is O(1); search, delete, and traversal are O(n).
Q. Solve aptitude questions based on blood relations.
asked 1xmediumLogical reasoningOnline test2020
Ans. Draw a family tree and fix yourself as the reference point. Convert each statement into a clear relation, marking gender where given. Work step by step from known persons to unknown ones, avoiding assumptions about age or gender. For coded questions, first decode the relation symbols, then trace the path to the required person.
Q. Write a program to detect a cycle in a linked list
asked 1xmediumLinked listsTechnical2020
Ans. Use Floyd’s tortoise and hare algorithm: keep two pointers, one moving one node at a time and the other moving two nodes at a time. If they ever meet, there is a cycle. If the fast pointer reaches null, there is no cycle. It uses constant extra space and runs in O(n) time.
Q. Explain mutexes and semaphores and their use cases.
asked 1xmediumOperating systemsTechnical2020
Ans. A mutex is a lock that lets one thread enter a critical section; a semaphore is a counter that lets up to N threads access a resource. Use mutexes to protect shared data from races. Use semaphores to manage limited resources, signal events, or coordinate producer-consumer workflows. Always release them correctly to avoid deadlocks.
Q. Explain semaphores and mutexes and their differences
asked 1xmediumOperating systemsTechnical2016
Ans. A mutex is a lock that allows only one thread to enter a critical section, while a semaphore is a counter that controls access to a limited number of resources. The key difference is ownership: a mutex is locked and unlocked by the same thread, but a semaphore can be signalled by another thread.
Q. When a program is run, what will be its page offset?
asked 1xmediumOperating systemsTechnical2021
Ans. A program’s page offset is the lower bits of any virtual address, not a single value for the whole program. It depends on the page size: for a 4 KB page, the offset is 12 bits. The offset is copied unchanged when translating from virtual page to physical frame.
Q. Write a program to demonstrate operator overloading.
asked 1xmediumOOPTechnical2020
Ans. Create a Complex number class with two integer fields, real and imaginary, and overload the plus operator to add two Complex objects. The overloaded operator returns a new Complex object whose fields are the sums of the operands’ matching fields. This uses a simple object data structure and runs in O(1) time.
Q. Write code to insert a node in a doubly linked list.
asked 1xmediumLinked listsTechnical2020
Ans. Insert by creating a new doubly linked list node, setting its prev and next pointers to fit the target position, then updating the neighbouring nodes to point back to it. If inserting at the head or tail, update the list’s head or tail reference. The operation is O(1) when the position node is known.
Q. Check if there exists a subarray with sum equal to 0.
asked 1xmediumArraysTechnical2020
Ans. Use prefix sums and a hash set. Scan the array, maintaining the running sum. If the running sum is ever 0, or if the same running sum has been seen before, a zero-sum subarray exists. Store each prefix sum in the set. This runs in O(n) time and uses O(n) space.
Q. Explain normalization and table decomposition in DBMS
asked 1xmediumDBMSTechnical2015
Ans. Normalization is the process of organising database tables to reduce redundancy and avoid update, insert and delete anomalies. It usually splits data into well-structured tables following normal forms. Table decomposition is that splitting process, and the key detail is that it should be lossless and ideally preserve dependencies.
Q. Explain the difference between a process and a thread
asked 1xmediumOperating systemsTechnical2015
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. Time and work related quantitative aptitude problems.
asked 1xmediumLogical reasoningOnline test2020
Ans. Convert each worker’s time into a rate: work done per day equals 1 divided by time taken. Add rates when people work together, subtract rates when one undoes work, and multiply rate by time to get work done. Use total work as 1, or use the LCM of times for easier arithmetic.
Q. What are race conditions and how can they be avoided?
asked 1xmediumOperating systemsTechnical2017
Ans. A race condition occurs when program behaviour depends on the timing or ordering of concurrent operations on shared state. It can be avoided by synchronising access with locks, mutexes, semaphores, atomic operations, or message passing, and by reducing shared mutable state. The key is making critical sections safe and deterministic.
Q. Explain the OSI model and protocols used at each layer
asked 1xmediumNetworkingTechnical2020
Ans. The OSI model has seven layers: Physical, Data Link, Network, Transport, Session, Presentation and Application. Examples are Ethernet physical signalling at layer 1, Ethernet or PPP at layer 2, IP and ICMP at layer 3, TCP and UDP at layer 4, TLS sessions or RPC at layer 5, TLS/SSL and JPEG at layer 6, and HTTP, DNS, SMTP and FTP at layer 7.
Q. Find the repeating and the missing number in an array.
asked 1xmediumArraysTechnical2020
Ans. Use the sum and sum of squares of numbers from 1 to n compared with the array’s sum and square sum to derive two equations for the missing and repeating values. Solve them to get both numbers. This uses no extra data structure, runs in O(n) time, and O(1) space.
Q. Swap two nodes of a linked list without swapping data.
asked 1xmediumLinked listsTechnical2017
Ans. To swap two linked list nodes without swapping data, change the links pointing to them. Find each node and its previous node, handle cases where one node is the head, then update previous pointers and swap the nodes’ next pointers. The key detail is handling adjacent nodes correctly. Time is O(n), space is O(1).
Q. What is the difference between a lock and a semaphore?
asked 1xmediumOperating systemsTechnical2020
Ans. A lock provides mutual exclusion for one thread at a time, while a semaphore controls access to a resource using a counter. The key difference is ownership: a lock is normally acquired and released by the same thread, but a semaphore can be signalled by a different thread and may allow multiple concurrent holders.
Q. Add two numbers without using the '+' operator in Java.
asked 1xmediumBit manipulationTechnical2019
Ans. Add two numbers by repeatedly using bitwise XOR for the partial sum and bitwise AND shifted left for the carry. In Java, loop until the carry becomes zero. This uses only integer variables, no data structure. Time complexity is O(1) for fixed-size int values, or O(number of bits) generally.
Q. Basic networking questions about routers and protocols.
asked 1xmediumNetworkingOnline test2020
Ans. Routers connect different networks and forward packets towards their destination using IP addresses and routing tables. The key detail is that routing chooses the next hop, not the full end-to-end path. Common protocols include IP for addressing, TCP for reliable transport, UDP for faster unreliable transport, DNS for name lookup, and HTTP for web traffic.
Q. Explain OOP concepts and their real-world applications.
asked 1xmediumOOPManagerial2020
Ans. OOP organises software as objects that combine data and behaviour, using encapsulation, abstraction, inheritance and polymorphism. Encapsulation protects internal state, abstraction hides complexity, inheritance reuses common features, and polymorphism lets different objects share an interface. Real applications include banking accounts, e-commerce orders, game characters and UI components.
Q. Explain virtual memory and paging in operating systems.
asked 1xmediumOperating systemsTechnical2020
Ans. Virtual memory lets each process see a large, private address space, while the operating system maps those virtual addresses to physical RAM or disk. Paging divides memory into fixed-size pages and frames, with page tables tracking mappings. The key detail is page faults: missing pages are loaded from storage into RAM when accessed.
Q. How does a router find the best route to transfer data?
asked 1xmediumNetworkingTechnical2021
Ans. A router finds the best route by looking up the packet’s destination IP address in its routing table and choosing the most specific matching entry. This is usually the longest prefix match. If several routes match equally, it uses routing protocol metrics such as hop count, cost, bandwidth, delay or administrative distance.
Q. What is the difference between a semaphore and a mutex?
asked 1xmediumOperating systemsTechnical2017
Ans. A mutex is a lock for exclusive access by one thread, while a semaphore is a counter that allows a fixed number of threads to access a resource. The key difference is ownership: the thread that locks a mutex should unlock it, but a semaphore can be signalled by another thread.
Q. Solve aptitude problems based on profit and loss calculations
asked 1xmediumLogical reasoningOnline test2020
Ans. Use cost price as the base unless stated otherwise. Profit equals selling price minus cost price, and loss equals cost price minus selling price. Profit or loss percentage is calculated on cost price. For marked price questions, apply discount first to get selling price, then compare with cost price. Translate each statement into these formulas.
Q. Design a system to store articles and retrieve the most popular article.
asked 1xmediumDBMSTechnical2017
Ans. Store articles in a durable database with article metadata and content, and maintain a popularity counter per article, such as views or likes. Update the counter on each interaction, preferably through an event stream to handle scale. Keep the current top article in a cache or sorted store, giving near constant-time reads.
Q. Solve the 9 balls weighing puzzle to find the odd ball using minimum weighings.
asked 1xmediumLogical reasoningTechnical2020
Ans. If the odd ball is known to be heavier or lighter, two weighings suffice. Weigh 3 balls against 3. If they balance, the odd ball is in the remaining 3. Otherwise it is in the heavier or lighter group. Then weigh 1 against 1 from that group. Balance means the third is odd.
Q. Puzzle: You have 3 bulbs in a room and 3 switches outside. How do you determine which switch controls which bulb?
asked 1xmediumLogical reasoningManagerial2020
Ans. Turn on the first switch for a few minutes, then turn it off. Turn on the second switch and enter the room. The bulb that is lit is controlled by the second switch. The bulb that is off but warm is controlled by the first. The off and cold bulb is controlled by the third.
Q. If you are assigned a task by your manager to complete within a week but you have no idea about the task, what will you do?
asked 1xmediumProblem solvingManagerial2016
Ans. Choose an example where you faced an unfamiliar task and handled it responsibly. Emphasise clarifying the expected outcome, breaking the work down, researching quickly, asking the right people for help, and giving progress updates. Interviewers listen for honesty, ownership, learning ability, time management, and whether you raise risks early rather than hiding confusion.
Q. Explain access specifiers in C++.
asked 1xeasyOOPTechnical2024
Ans. Access specifiers in C++ are keywords that control where class members can be accessed from: public, private, and protected. Public members are accessible everywhere, private members only inside the class and friends, and protected members inside the class, friends, and derived classes. In a class the default is private; in a struct it is public.
Q. How confident are you, and what is the reason for your confidence?
asked 1xeasySelf awarenessHR2024
Ans. A strong answer shows balanced confidence, not arrogance. Pick a recent situation where preparation, skill, or feedback led to a good result. Emphasise evidence: targets met, problems solved, or trust earned. Interviewers listen for self-awareness, resilience, and whether your confidence comes from proven behaviour rather than vague self-belief.
Q. What is the difference between a product-based company and a service-based company?
asked 1xeasyBusiness awarenessManagerial2020
Ans. A strong answer should explain that product-based companies build and improve their own products, while service-based companies deliver solutions or support for clients. Pick examples from your experience if possible. Emphasise business model, ownership, timelines, customer focus, and success measures. Interviewers listen for clarity, commercial awareness, and practical understanding.
Showing 60 of 245 questions. Ranked by how often the same question came back across interviews.