Q. Explain interfaces and friend functions in C++
asked 2xmediumOOPTechnical2021-2022
Ans. In C++, an interface is usually an abstract class with pure virtual functions, defining behaviour that derived classes must implement. A friend function is a non-member function, or another class member, granted access to a class’s private and protected data. Friend functions are useful for operators, but should be used sparingly.
Q. How is a doubly linked list implemented in C++?
asked 2xmediumLinked listsTechnical2021-2022
Ans. A doubly linked list in C++ is implemented as nodes where each node stores data plus two pointers, one to the previous node and one to the next node. A list class usually keeps head and tail pointers. Insertion or deletion is O(1) when the node position is known, while traversal is O(n).
Q. Explain the layers of the OSI Model
asked 2xeasyNetworkingTechnical2021-2022
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. Delete the Nth node from the end of a linked list
asked 2xeasyLinked listsTechnical2021-2022
Ans. Use two pointers with a dummy node before the head. Move the fast pointer n steps ahead, then move fast and slow together until fast reaches the end. The slow pointer will be just before the node to delete, so bypass it. This handles deleting the head cleanly. Time is O(n), space is O(1).
Q. Explain Object-Oriented Programming (OOPS) concepts with examples
asked 2xeasyOOPTechnical2019-2023
Ans. Object-oriented programming organises software around objects that hold data and behaviour. Its main concepts are encapsulation, inheritance, polymorphism and abstraction. For example, a Car object has fields like speed and methods like brake. A SportsCar can inherit from Car, override drive behaviour, and hide internal engine details behind simple methods.
Q. Explain ACID properties in DBMS
asked 1xmediumDBMSManagerial2023
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. Design a vending machine system.
asked 1xmediumLow level designTechnical2021
Ans. Design it as a state machine with states like idle, selecting item, accepting payment, dispensing, returning change, and out of service. Core components are inventory, payment handling, pricing, change management, dispenser, and controller. The most important detail is making payment and inventory updates transactional so money is not taken unless dispensing succeeds.
Q. Explain CPU scheduling techniques
asked 1xmediumOperating systemsTechnical2021
Ans. CPU scheduling techniques decide which ready process gets the CPU and for how long. Common methods include First Come First Served, Shortest Job First, Priority Scheduling, Round Robin, and Multilevel Queue scheduling. The key distinction is preemptive versus non-preemptive scheduling, balancing throughput, waiting time, response time, fairness, and starvation risk.
Q. Explain the TCP/IP protocol suite.
asked 1xmediumNetworkingTechnical2020
Ans. The TCP/IP protocol suite is the set of networking protocols that lets devices communicate over the internet and most modern networks. IP handles addressing and routing packets between machines, while TCP provides reliable, ordered delivery using connections, acknowledgements, retransmission and flow control. Common application protocols like HTTP, DNS and SMTP run on top.
Q. How do you handle an angry client?
asked 1xmediumConflict resolutionHR2020
Ans. A strong answer should use a real example where you stayed calm, listened without interrupting, and acknowledged the client’s frustration. Emphasise how you clarified the issue, took ownership of what you could control, agreed clear next steps, and followed through. Interviewers listen for composure, empathy, accountability, and problem solving.
Q. Explain Spanning Tree Protocol (STP)
asked 1xmediumNetworkingTechnical2018
Ans. Spanning Tree Protocol is a Layer 2 protocol that prevents switching loops by creating a loop-free logical topology over a network with redundant links. Switches exchange BPDUs, elect a root bridge, choose the best paths towards it, and place some ports into blocking state so backups exist without forwarding loops.
Q. Design and implement a T9 dictionary.
asked 1xmediumStringsTechnical2013
Ans. Use a trie keyed by digit sequences rather than letters, where each word is converted using the T9 keypad mapping and inserted under its numeric path. Each terminal node stores matching words, optionally ranked by frequency. Lookup follows the digits and returns that node’s words. Insert and lookup take O(L), where L is word length.
Q. Print a binary tree in vertical order
asked 1xmediumTreesTechnical2018
Ans. Use level order traversal with a horizontal distance for each node, root at 0, left child minus 1 and right child plus 1. Store nodes in a map from distance to list, appending as visited. Finally print lists by increasing distance. Time is O(n log k) with an ordered map.
Q. Design Spotify (music streaming system)
asked 1xmediumScalable systemsSystem design2021
Ans. Build Spotify as clients using APIs for search, playback, playlists and recommendations, backed by metadata services, user services and a streaming service over a CDN. Store songs in object storage, transcode into multiple bitrates, and serve adaptive chunks. The most important detail is low-latency, rights-aware playback using caching, CDN edge delivery and signed URLs.
Q. Explain multithreading concepts in Java
asked 1xmediumOOPOnline test2017
Ans. Multithreading in Java means running multiple threads within one process to perform tasks concurrently while sharing the same memory. Threads can be created with Thread, Runnable, Callable, or preferably managed through ExecutorService. The key concern is thread safety, handled using synchronised blocks, locks, volatile variables, concurrent collections, and careful coordination.
Q. Explain Microsoft Azure and its services
asked 1xmediumCloudHR2021
Ans. Microsoft Azure is Microsoft’s cloud computing platform for building, deploying and managing applications and infrastructure over the internet. It offers services such as virtual machines, storage, databases, networking, identity, analytics, AI, containers and serverless computing. The key benefit is scalable, pay-as-you-go infrastructure managed through global data centres.
Q. Explain the concept of a Neural Network.
asked 1xmediumMachine learningManagerial2019
Ans. A neural network is a machine learning model made of connected layers of simple units called neurons, inspired by the brain. Each connection has a weight, and training adjusts these weights so the network maps inputs to useful outputs, such as class labels or predictions, by minimising error on examples.
Q. Explain busy wait, spin lock, and deadlocks
asked 1xmediumOperating systemsTechnical2015
Ans. Busy wait means repeatedly checking a condition without sleeping, spin lock is a lock implemented by busy waiting until it becomes free, and deadlock is when tasks wait forever for each other’s resources. Busy waiting wastes CPU, spin locks are only suitable for very short waits, and deadlocks require prevention or detection.
Q. Explain different CPU scheduling algorithms
asked 1xmediumOperating systemsTechnical2022
Ans. CPU scheduling algorithms decide which ready process runs next. Common ones are First Come First Served, Shortest Job First, Priority Scheduling, Round Robin, and Multilevel Queue. The key trade-off is between fairness, response time, throughput, and starvation. Preemptive algorithms can interrupt running processes, while non-preemptive ones wait until completion or blocking.
Q. What is a page fault and what is thrashing?
asked 1xmediumOperating systemsTechnical2015
Ans. A page fault occurs when a process accesses a virtual memory page that is not currently in physical RAM. The operating system must load it from disk, which is slow. Thrashing happens when the system spends most of its time swapping pages in and out instead of executing, usually because memory demand exceeds available RAM.
Q. Implement Dijkstra's shortest path algorithm
asked 1xmediumGraphsTechnical2015
Ans. Use an adjacency list and a min priority queue to repeatedly choose the unvisited node with the smallest known distance, then relax all outgoing edges. Initialise distances to infinity except the source as zero. Push improved distances into the heap and ignore stale entries. Time complexity is O((V + E) log V) with a binary heap.
Q. Explain Linux file system structure and inode
asked 1xmediumOperating systemsTechnical2015
Ans. Linux has a single hierarchical file system rooted at /, with directories such as /etc, /home, /var and /usr mounted from one or more devices. The key detail is that a directory maps file names to inode numbers. An inode stores metadata like permissions, owner, size, timestamps and pointers to data blocks, but not the file name.
Q. Explain garbage collection in C++ and Python.
asked 1xmediumOperating systemsTechnical2021
Ans. C++ generally does not have built-in garbage collection, while Python manages memory automatically. In C++, objects are freed explicitly or by RAII when lifetimes end, often using smart pointers. Python mainly uses reference counting and a cyclic garbage collector to reclaim objects that reference each other and would otherwise not reach zero references.
Q. Explain Spanning Tree Protocol and its purpose
asked 1xmediumNetworkingTechnical2015
Ans. Spanning Tree Protocol prevents Layer 2 switching loops by creating a loop-free logical topology across redundant network links. Switches exchange BPDUs, elect a root bridge, choose the best paths towards it, and place some ports into blocking state. This preserves redundancy while avoiding broadcast storms and MAC table instability.
Q. Delete the last node in a circular linked list.
asked 1xmediumLinked listsTechnical2024
Ans. Traverse the circular list until you find the node whose next pointer is the head, keeping track of the previous node. Set the previous node’s next pointer to head and delete the last node. If the list is empty, do nothing; if it has one node, set head to null. Time complexity is O(n).
Q. Explain the services offered by Microsoft Azure
asked 1xmediumCloudManagerial2022
Ans. Microsoft Azure offers cloud services for computing, storage, databases, networking, analytics, AI, security, identity, DevOps and application hosting. The key point is that it supports IaaS, PaaS and SaaS, so organisations can run virtual machines, build applications, store data, manage users and deploy scalable systems without owning physical infrastructure.
Q. How is content copied from disk to main memory?
asked 1xmediumOperating systemsTechnical2020
Ans. Content is copied from disk to main memory by an I/O operation managed by the operating system and disk controller. The OS requests the needed disk blocks, and the controller usually uses DMA to transfer data directly into RAM, avoiding byte-by-byte CPU copying. When finished, an interrupt notifies the CPU.
Q. Explain and implement common sorting algorithms.
asked 1xmediumSortingTechnical2024
Ans. Common sorting algorithms include bubble, insertion, selection, merge, quick and heap sort, implemented by comparing elements and rearranging an array or list. Merge sort uses extra arrays and runs in O(n log n). Quick sort partitions in place, average O(n log n), worst O(n²). Heap sort uses a heap, O(n log n).
Q. Explain the concept of process forking in Linux.
asked 1xmediumOperating systemsTechnical2015
Ans. Process forking in Linux is creating a new child process from an existing parent process using fork. The child starts as a near copy of the parent, with separate process ID and address space. In practice, Linux uses copy-on-write, so memory pages are shared until either process modifies them.
Q. What are system calls and how are they executed?
asked 1xmediumOperating systemsTechnical2015
Ans. System calls are controlled entry points that let a user program request services from the operating system kernel, such as file access, process creation or memory allocation. They execute by placing arguments in agreed registers or memory, invoking a trap or syscall instruction, switching to kernel mode, running kernel code, then returning results to user mode.
Q. Write an SQL query to evaluate A - B using joins.
asked 1xmediumSQLTechnical2019
Ans. Use a left outer join from A to B on the matching key columns, then keep only rows where the B key is null. This is a left anti-join and returns rows in A with no match in B. With a hash join it is typically linear in the input sizes.
Q. Merge overlapping intervals in a list of intervals
asked 1xmediumArraysTechnical2021
Ans. Sort the intervals by start time, then scan them once, keeping a result list of merged intervals. For each interval, compare its start with the end of the last interval in the result. If they overlap, extend the end; otherwise, append it. Time complexity is O(n log n) due to sorting, with O(n) space.
Q. Explain process scheduling, schedulers, and dispatcher
asked 1xmediumOperating systemsTechnical2015
Ans. Process scheduling is the operating system’s method for deciding which process runs on the CPU and when. Schedulers make these decisions: the long-term scheduler admits jobs, the short-term scheduler selects ready processes, and the medium-term scheduler may suspend or resume them. The dispatcher performs the actual context switch and gives CPU control to the chosen process.
Q. How would you sort words present in a very large file?
asked 1xmediumSortingTechnical2013
Ans. Use external merge sort: read the file in chunks that fit memory, extract words, sort each chunk, and write sorted temporary files. Then perform a k-way merge of those files using a min-heap, streaming output to the result file. This keeps memory bounded while handling files much larger than RAM.
Q. Merge overlapping intervals in a given set of intervals
asked 1xmediumArraysTechnical2022
Ans. Sort the intervals by start time, then scan them once and merge each interval with the last interval in the result if they overlap. Use a list or array to store merged intervals, updating the last end value when needed. Sorting dominates the cost, so time complexity is O(n log n) and space is O(n).
Q. Write a program to print the left view of a binary tree
asked 1xmediumTreesManagerial2023
Ans. Print the first node visible at each depth when the tree is viewed from the left. Do a level order traversal using a queue, and for each level print the first node removed from the queue. This visits every node once, so the time complexity is O(n), with O(w) space for the queue.
Q. Write a program to print the right view of a binary tree
asked 1xmediumTreesManagerial2023
Ans. Use level order traversal and print the last node seen at each level. Keep a queue of nodes, process one level at a time using the current queue size, and record or print the node when it is the last in that level. Time complexity is O(n), and space complexity is O(w).
Q. Explain RAID levels 0, 1, 5, and 10 and their differences.
asked 1xmediumStorage systemsOnline test2020
Ans. RAID 0 stripes data for speed but has no redundancy; RAID 1 mirrors data for fault tolerance; RAID 5 stripes with distributed parity; RAID 10 mirrors pairs and stripes across them. RAID 0 gives best capacity and performance but unsafe, RAID 1 is simple and safe, RAID 5 balances capacity and resilience, and RAID 10 is fast and resilient but costly.
Q. Data structure questions on arrays, trees, and linked lists
asked 1xmediumMixedTechnical2023
Ans. Arrays give fast index access, linked lists give cheap insertion or deletion when you already have the node, and trees model hierarchical or ordered data efficiently. The key detail is complexity: arrays access in O(1), linked lists search in O(n), and balanced trees usually search, insert, and delete in O(log n).
Q. Write an SQL query to find the 3rd highest salary from a table
asked 1xmediumSQLTechnical2023
Ans. Use a distinct salary list, sort it in descending order, then return the single row after skipping the first two salaries. This gives the 3rd highest unique salary, so duplicate salaries do not affect the result. The database typically uses a sort or index scan; sorting is usually O(n log n).
Q. Write optimized pseudocode to swap the contents of two stacks.
asked 1xmediumStackTechnical2019
Ans. Swap the two stack references, not the individual elements. Keep a temporary stack reference, make the first stack variable refer to the second stack, then make the second refer to the temporary reference. This preserves all element order and uses constant extra space. The time complexity is O(1).
Q. How can hashing be used to store IP addresses without collision?
asked 1xmediumHashingTechnical2024
Ans. Use a perfect hash, or for IPv4 use the 32-bit IP value itself as the index, so each address maps to one unique slot. The key detail is that normal hash functions can collide, so collision-free storage requires a fixed known key set or direct addressing over the full address space.
Q. Differentiate between Random Forest and Decision Tree algorithms.
asked 1xmediumMachine learningManagerial2019
Ans. A Decision Tree is a single model that splits data by feature rules, while a Random Forest is an ensemble of many Decision Trees trained on random samples and feature subsets. The key difference is that Random Forest usually gives better accuracy and reduces overfitting, but is less interpretable and more computationally expensive.
Q. Explain different types of SQL joins and write sample SQL queries
asked 1xmediumSQLTechnical2020
Ans. SQL joins combine rows from related tables: INNER JOIN returns matching rows, LEFT JOIN returns all left rows plus matches, RIGHT JOIN returns all right rows plus matches, FULL OUTER JOIN returns all rows from both sides, and CROSS JOIN returns every pair. A typical query joins employees to departments using a shared department_id; indexed keys make it efficient.
Q. What are different data transmission formats in computer networks?
asked 1xmediumNetworkingTechnical2020
Ans. The main data transmission formats are simplex, half-duplex and full-duplex. In simplex, data flows only one way, like a keyboard to a computer. In half-duplex, both sides can send, but not at the same time. In full-duplex, both sides can send and receive simultaneously, as in modern switched Ethernet.
Q. Explain Object-Oriented Programming (OOPS) concepts with an example
asked 1xmediumOOPManagerial2023
Ans. Object-Oriented Programming organises software as objects that combine data and behaviour. Its main concepts are encapsulation, abstraction, inheritance and polymorphism. For example, a Vehicle class can define common fields and methods, while Car and Bike inherit from it, hide internal details, and implement start differently through polymorphism.
Q. Explain how cloud computing works and how load balancing is handled.
asked 1xmediumNetworkingTechnical2019
Ans. Cloud computing works by providing compute, storage, networking and services over the internet from shared data centres, usually on demand and billed by usage. Applications run on virtual machines, containers or managed services. Load balancing distributes incoming traffic across healthy instances using algorithms like round robin, least connections or latency based routing.
Q. What is deadlock in an operating system and how can it be prevented?
asked 1xmediumOperating systemsManagerial2024
Ans. Deadlock is a state where two or more processes wait forever because each holds a resource another needs. It can be prevented by breaking one necessary condition for deadlock, such as enforcing a fixed order for acquiring resources, requiring processes to request all resources at once, allowing preemption, or making resources shareable where possible.
Q. Explain the concepts of processes and threads in an operating system.
asked 1xmediumOperating systemsManagerial2024
Ans. A process is an independent running program with its own memory space and system resources, while a thread is a smaller unit of execution within a process. Threads in the same process share memory and resources, but each has its own stack and registers. Threads are cheaper to create, but shared memory requires synchronisation.
Q. Write an SQL query using joins between employee and department tables.
asked 1xmediumSQLManagerial2017
Ans. Use an inner join between the employee table and the department table, matching employee.department_id to department.id, and select the employee fields with the department name. The data structures are relational tables, usually helped by indexes on the join keys. With a hash join, the work is roughly linear in the two table sizes.
Q. Design an application for a shortest-path problem and explain its features.
asked 1xmediumApplication designManagerial2019
Ans. I would design a routing service that models locations as graph nodes and roads as weighted edges, then uses Dijkstra or A* to find the shortest path. Key features include route search, distance and time estimates, traffic-aware weights, map display, saved routes, caching popular queries, and updating edge weights from live data.
Q. Estimate the number of laptops sold per day in Delhi and explain your approach.
asked 1xmediumEstimationManagerial2017
Ans. About 2,000 laptops are sold per day in Delhi. I would estimate a population of 20 million, around 5 million households, and assume a laptop replacement or first purchase cycle of four years for roughly half of them. That gives about 625,000 consumer laptops yearly. Adding offices and students brings it near 700,000 to 800,000, or around 2,000 daily.
Q. How do you handle conflicts within a team? Provide solutions to given conflicting problems.
asked 1xmediumConflict resolutionManagerial2024
Ans. Choose a real conflict where you helped reach a practical outcome, not where you simply “won”. Emphasise listening to both sides, clarifying facts, separating people from the problem, agreeing actions, and following up. Interviewers listen for maturity, fairness, calm communication, accountability, and evidence that the team relationship improved.
Q. As a first-time event manager with no senior support, how would you ensure the event is successful?
asked 1xmediumLeadershipTechnical2017
Ans. Pick a situation where you owned planning despite limited experience. Emphasise how you clarified objectives, built a timeline, identified risks, used checklists, communicated with suppliers and stakeholders, and sought advice from peers where possible. Interviewers listen for calm ownership, prioritisation, contingency planning, and evidence that you would not hide uncertainty or work in isolation.
Q. Aptitude questions involving numerical reasoning under time constraints (no verbal or comprehension).
asked 1xmediumNumerical reasoningOnline test2021
Ans. Use a quick structure: identify what is asked, note the given numbers, choose the relevant rule, then calculate with shortcuts. Estimate first to spot impossible options, use percentages, ratios, averages, speed, work, and probability formulas as needed. Avoid long arithmetic, eliminate wrong answers, and move on if stuck.
Q. Based on given properties of multiple cities, answer logical reasoning questions about their relationships.
asked 1xmediumLogical reasoningOnline test2021
Ans. Create a table with cities as rows and properties as columns, then fill in every definite fact. Mark exclusions as well as matches. Use each clue to eliminate impossible combinations, and update the table after every step. When stuck, compare remaining options across rows and columns until only one consistent relationship remains.
Q. If you have 9 coins and one of them weighs less, how can you identify the odd coin in minimum number of steps?
asked 1xmediumLogical reasoningManagerial2017
Ans. Use two weighings on a balance scale. Split the 9 coins into three groups of 3. Weigh group A against group B. If they balance, the light coin is in group C; otherwise it is in the lighter group. Then weigh two coins from that suspect group. If one is lighter, it is odd; if balanced, the third is odd.
Q. Describe an analogy between knight and rook movements in chess and how it could relate to code you have written.
asked 1xmediumLogical reasoningTechnical2021
Ans. I would model both as graph moves on a grid. A rook changes one coordinate while the other stays fixed; a knight changes both by fixed offsets, two and one. In code, I have used the same idea in pathfinding: define legal neighbour generation, then run breadth first search to find reachability or shortest paths.
Q. Find the number of possible arrangements or selections using permutations and combinations for a given scenario.
asked 1xmediumPermutations combinationsOnline test2021
Ans. Identify whether order matters. If order matters, use permutations, usually nPr = n!/(n-r)!. If order does not matter, use combinations, nCr = n!/[r!(n-r)!]. Adjust for repetition, restrictions, or identical items. Break complex scenarios into cases, count each valid case, then add or multiply as appropriate.
Q. Trapping Rain Water problem
asked 1xhardArraysTechnical2023
Ans. Use two pointers from both ends, keeping the maximum height seen on the left and right. Move the side with the smaller current height, because trapped water there is limited by that side’s maximum. Add max minus current height when positive. This uses constant space and runs in O(n) time.
Showing 60 of 169 questions. Ranked by how often the same question came back across interviews.