Q. Explain the OSI model or TCP/IP model in detail.
asked 2xmediumNetworkingTechnical2024
Ans. The OSI model describes networking in seven layers: physical, data link, network, transport, session, presentation and application. Each layer provides services to the one above it and hides lower-level details. In practice, TCP/IP is used more often: link, internet, transport and application layers, with IP handling addressing and TCP or UDP handling transport.
Q. Explain Dijkstra’s and Bellman-Ford graph traversal algorithms.
asked 2xmediumGraphsTechnical2024
Ans. Dijkstra and Bellman-Ford find shortest paths from one source to all vertices in a weighted graph. Dijkstra repeatedly picks the nearest unvisited vertex, usually with a priority queue, and works only with non-negative edges. Bellman-Ford relaxes every edge repeatedly, handles negative weights, and can detect negative cycles. Dijkstra is faster; Bellman-Ford is more general.
Q. Explain MAC addressing, IP addressing, ARP tables, and routing tables.
asked 2xmediumNetworkingTechnical2024
Ans. MAC addresses identify network interfaces on a local link, IP addresses identify hosts across networks, ARP tables map IP addresses to MAC addresses, and routing tables choose where packets go next. The key distinction is scope: MAC and ARP work within a local network, while IP and routing work across interconnected networks.
Q. Write logic to generate the Tribonacci series.
asked 2xeasyDynamic programmingTechnical2024
Ans. Start with 0, 1, 1, then generate each next term as the sum of the previous three terms. Store the terms in a list if the full series is needed, or keep only three variables if printing. Run a loop until n terms are produced. Time complexity is O(n).
Q. Explain inheritance in Object-Oriented Programming.
asked 2xeasyOOPTechnical2024
Ans. Inheritance is an object-oriented programming feature where one class derives from another class and reuses or extends its fields and methods. The derived class, often called a subclass, can add new behaviour or override existing behaviour, while the base class defines shared functionality. It supports code reuse and represents “is a” relationships.
Q. Merge two sorted arrays into a single sorted array.
asked 2xeasyArraysOnline test2015-2017
Ans. Use two pointers, one for each sorted array, and repeatedly append the smaller current element to a new result array. When one array is exhausted, append the remaining elements from the other array. This keeps the merge sorted in one pass, using an output array, with O(n + m) time complexity.
Q. Explain the difference between a Router and a Switch.
asked 2xeasyNetworkingTechnical2024
Ans. A switch connects devices within the same local network, while a router connects different networks, such as a home LAN to the internet. A switch forwards frames using MAC addresses, usually at layer 2. A router forwards packets using IP addresses, usually at layer 3, and chooses paths between networks.
Q. Why do we use a Switch along with a Router in a network?
asked 2xeasyNetworkingTechnical2024
Ans. We use a switch with a router because they do different jobs: the switch connects devices inside the local network, while the router connects that network to other networks or the internet. The switch forwards frames using MAC addresses, and the router forwards packets using IP addresses, often also handling NAT and DHCP.
Q. Explain TCP flow control.
asked 1xmediumNetworkingTechnical2018
Ans. TCP flow control prevents a sender from overwhelming a receiver by limiting how much unacknowledged data can be in flight. The receiver advertises a window size in TCP acknowledgements, showing how much buffer space it has available. The sender must stay within this receive window, adjusting as the receiver drains or fills its buffer.
Q. Explain ARP and DNS protocols.
asked 1xmediumNetworkingTechnical2023
Ans. ARP maps an IP address to a MAC address on a local network, while DNS maps a human-readable domain name to an IP address. ARP uses local broadcast requests and caches replies. DNS uses a hierarchical naming system, typically queried through recursive resolvers, with cached results to reduce lookup time and traffic.
Q. Explain the boot process of a PC.
asked 1xmediumOperating systemsTechnical2023
Ans. A PC boots by firmware starting the hardware, finding a bootable device, loading a bootloader, and handing control to the operating system kernel. The key detail is the firmware, usually UEFI or older BIOS, runs POST, initialises devices, reads the boot configuration, then the OS kernel starts drivers, services, and user space.
Q. Explain DHCP and the DORA process.
asked 1xmediumNetworkingTechnical2024
Ans. DHCP is a network protocol that automatically gives hosts IP configuration, such as an IP address, subnet mask, default gateway and DNS servers. DORA is the usual exchange: Discover from client, Offer from server, Request from client, and Acknowledgement from server. It commonly uses broadcasts and UDP ports 67 and 68.
Q. Design an airline connectivity system.
asked 1xmediumDistributed systemsTechnical2018
Ans. Design it as a time-dependent graph service where airports are nodes and scheduled flights are edges with departure time, arrival time, airline, capacity and status. Ingest schedules and live disruption feeds into a durable store, index by origin and time, and use shortest path search with connection-time rules to return valid itineraries.
Q. Implement get and get-next operations.
asked 1xmediumData structuresTechnical2018
Ans. Use a balanced binary search tree storing key value pairs, such as a red black tree or AVL tree. get searches by key and returns the value in O(log n). get-next finds the in-order successor, keeping the smallest key greater than the target while descending. It also runs in O(log n).
Q. What are VLANs and their applications?
asked 1xmediumNetworkingTechnical2023
Ans. VLANs are logical network segments created on switches to separate devices into different broadcast domains, even if they share the same physical network. They are used to isolate departments, improve security, reduce broadcast traffic, support guest networks, separate voice and data traffic, and make network management more flexible.
Q. Explain routing protocols OSPF and RIP.
asked 1xmediumNetworkingTechnical2024
Ans. OSPF and RIP are interior routing protocols used to choose paths within an autonomous system. RIP is distance-vector, using hop count and periodic updates, with a 15-hop limit. OSPF is link-state, builds a full topology map, uses cost to run shortest path, and converges faster, especially in large networks.
Q. Explain the concept of race conditions.
asked 1xmediumOperating systemsTechnical2024
Ans. A race condition happens when two or more concurrent operations access shared data and the final result depends on their timing or order of execution. It usually occurs when at least one operation writes to that data. The key prevention is to control access using synchronisation, such as locks, atomic operations, or transactions.
Q. Explain how a compiler works internally.
asked 1xmediumCompiler designTechnical2023
Ans. A compiler translates source code into executable code through a pipeline of analysis and generation stages. It lexes text into tokens, parses tokens into a syntax tree, checks types and semantics, optimises an intermediate representation, then generates target machine code or bytecode. The key idea is preserving program meaning while changing representation.
Q. Implement htons (host to network short).
asked 1xmediumNetworkingTechnical2018
Ans. Implement htons by returning the 16-bit value unchanged on a big-endian host, and swapping its two bytes on a little-endian host. Network byte order is big-endian, so the key detail is detecting or assuming host endianness correctly. No data structure is needed, and the operation runs in constant time.
Q. Perform insertion sort on a linked list.
asked 1xmediumLinked listsTechnical2015
Ans. Use insertion sort by building a sorted linked list and inserting each original node into its correct position. Keep a dummy head for the sorted part, scan from it to find the insertion point, then relink pointers. This works well with linked lists because insertion is O(1) after search. Time is O(n²), space is O(1).
Q. Explain merge sort with code and diagram.
asked 1xmediumSortingTechnical2023
Ans. Merge sort recursively splits an array into two halves, sorts each half, then merges the sorted halves using a temporary array. Diagrammatically: [8,3,5,1] becomes [8,3] and [5,1], then [8],[3],[5],[1], then [3,8] and [1,5], finally [1,3,5,8]. It takes O(n log n) time and O(n) extra space.
Q. Explain different types of software testing.
asked 1xmediumSoftware testingTechnical2020
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. Write boundary value test cases for a table.
asked 1xmediumSoftware testingTechnical2020
Ans. Test the table at its limits: zero rows, one row, maximum allowed rows, maximum plus one, zero columns, one column, maximum columns, and maximum plus one. Also test empty cells, minimum and maximum cell length, invalid data types, duplicate keys, very large values, special characters, sorting, filtering, and pagination at page boundaries.
Q. Explain process vs thread and multiprogramming.
asked 1xmediumOperating systemsTechnical2023
Ans. A process is an independent running program with its own memory, while a thread is a smaller execution path inside a process that shares the process’s memory. Threads are cheaper to create and switch between, but need careful synchronisation. Multiprogramming means keeping several processes in memory so the CPU can switch when one waits.
Q. Explain routing protocols such as OSPF and RIP.
asked 1xmediumNetworkingTechnical2024
Ans. OSPF and RIP are interior routing protocols that let routers learn paths inside an organisation’s network. RIP is distance-vector and chooses routes mainly by hop count, with a 15-hop limit. OSPF is link-state, builds a network map, and uses cost to find shortest paths, so it scales and converges better.
Q. Swap nibbles in a number: aabbccdd to ddccbbaa.
asked 1xmediumBit manipulationTechnical2018
Ans. Reverse the 4-bit nibbles by repeatedly taking the lowest nibble and appending it to the result. For 0xaabbccdd, extract each nibble with mask 0xF, shift the result left by 4, OR the nibble in, then shift the input right by 4. This takes constant time and space for fixed-width integers.
Q. Explain multithreading concepts in C++ and Java.
asked 1xmediumOOPTechnical2015
Ans. Multithreading lets a program run multiple threads concurrently within one process, sharing memory but keeping separate call stacks. In C++, threads use std::thread, mutexes, locks, atomics and condition variables, with manual lifetime management. In Java, Thread, Runnable, executors, synchronized, volatile and concurrent utilities provide higher-level support managed by the JVM.
Q. Explain socket-based client-server architecture.
asked 1xmediumNetworkingTechnical2018
Ans. Socket-based client-server architecture uses network sockets as endpoints for communication between a client process and a server process. The server binds to an IP address and port, listens for connections, and accepts clients. The client connects to that address and port, then both exchange data using protocols such as TCP or UDP.
Q. Generate the next permutation of a given string.
asked 1xmediumStringsOnline test2017
Ans. Convert the string to a character array, find the rightmost position where a character is smaller than the one after it, then swap it with the smallest larger character to its right and reverse the suffix. If no such position exists, it is already the last permutation. This takes O(n) time and O(n) space.
Q. What happens in the browser when you type a URL?
asked 1xmediumNetworkingTechnical2015
Ans. The browser resolves the URL to an IP address, opens a connection to the server, sends an HTTP request, receives a response, and renders the page. The key detail is DNS resolution happens first, followed by TCP and usually TLS setup, then HTML parsing, resource fetching, CSS layout, JavaScript execution, and painting to the screen.
Q. Explain the structure and fields of an IP header.
asked 1xmediumNetworkingTechnical2018
Ans. An IPv4 header is a 20 to 60 byte structure containing version, header length, type of service, total length, identification, flags, fragment offset, TTL, protocol, header checksum, source address, destination address, and optional options. The most important detail is that it carries routing and fragmentation metadata, not application data.
Q. Sort a doubly linked list. Write the code on paper.
asked 1xmediumLinked listsTechnical2017
Ans. Use merge sort on the doubly linked list, because it does not need random access and can relink nodes directly. Split the list with slow and fast pointers, recursively sort both halves, then merge them while fixing both next and prev pointers. The time complexity is O(n log n), with O(log n) recursion stack.
Q. Explain how Network Address Translation (NAT) works.
asked 1xmediumNetworkingTechnical2024
Ans. Network Address Translation lets devices on a private network share one or more public IP addresses by rewriting packet IP addresses, and often ports, at the router. The router keeps a translation table mapping internal addresses and ports to external ones, so return traffic can be forwarded back to the correct internal device.
Q. Explain regular languages and context-free grammars.
asked 1xmediumTheory of computationTechnical2017
Ans. Regular languages are the simplest class of formal languages, describable by regular expressions and recognisable by finite automata. Context-free grammars define languages using production rules where one non-terminal can be replaced by symbols. The key difference is that CFGs can express nested or recursive structure, such as balanced parentheses, which regular languages cannot.
Q. Name all OSI layers and important protocols in each.
asked 1xmediumNetworkingTechnical2023
Ans. The OSI layers are Physical, Data Link, Network, Transport, Session, Presentation and Application. Physical includes Ethernet PHY, DSL and fibre standards. Data Link includes Ethernet, Wi-Fi, PPP and ARP. Network includes IP and ICMP. Transport includes TCP and UDP. Session includes RPC and NetBIOS. Presentation includes TLS, SSL and MIME. Application includes HTTP, DNS, SMTP, FTP and SSH.
Q. Explain how NAT works using a given network topology.
asked 1xmediumNetworkingTechnical2024
Ans. NAT lets hosts on a private LAN reach outside networks by rewriting their private source IPs to the router’s public IP. In a topology with several clients behind one gateway, the gateway also rewrites source ports and stores mappings in a NAT table, so returning packets are translated back to the correct internal host.
Q. How do you detect memory leaks during system startup?
asked 1xmediumOperating systemsTechnical2018
Ans. Track all allocations during startup and verify that each is freed or intentionally retained after initialisation completes. Use allocator instrumentation or tools such as Valgrind, ASan, kmemleak, or heap tracing to record allocation sites. Take memory snapshots at key boot phases and compare them, treating steadily growing unreachable allocations as leaks.
Q. Explain different sorting algorithms and compare them.
asked 1xmediumSortingTechnical2015
Ans. Common sorting algorithms trade simplicity, speed, memory, and stability. Bubble, selection, and insertion sort are simple but usually O(n²), with insertion good on nearly sorted data. Merge sort is stable O(n log n) but uses extra memory. Quick sort is usually fastest in practice O(n log n), but worst case O(n²). Heap sort is O(n log n) in-place but not stable.
Q. Explain synchronization problems in operating systems.
asked 1xmediumOperating systemsTechnical2015
Ans. Synchronization problems occur when multiple processes or threads access shared resources concurrently and the result depends on timing. Common issues include race conditions, deadlock, starvation and priority inversion. Operating systems use locks, semaphores, monitors and atomic operations to enforce mutual exclusion, ordering and safe communication between concurrent tasks.
Q. Explain SMTP protocol and how it works across OSI layers.
asked 1xmediumNetworkingTechnical2023
Ans. SMTP is an application layer protocol used to send email between clients and mail servers, and between mail servers. It uses DNS MX records to find the recipient’s server, then exchanges commands like HELO, MAIL FROM, RCPT TO and DATA. Across OSI layers, SMTP sits on TCP, usually ports 25, 587 or 465, over IP and lower network layers.
Q. Find the repeated elements in an array without using STL.
asked 1xmediumArraysTechnical2017
Ans. Use a simple frequency array if the value range is known: scan the array, increment the count for each value, then print values whose count becomes 2. This avoids STL and reports each duplicate once. It takes O(n) time and O(k) extra space, where k is the value range.
Q. Why are mutexes and semaphores used in operating systems?
asked 1xmediumOperating systemsTechnical2023
Ans. Mutexes and semaphores are used to synchronise concurrent threads or processes so shared resources are accessed safely. They prevent race conditions and inconsistent data. A mutex gives exclusive access to one owner at a time, while a semaphore uses a counter to allow limited access or signal availability.
Q. Detect a loop in a linked list and explain with a diagram.
asked 1xmediumLinked listsTechnical2023
Ans. Use Floyd’s slow and fast pointer method to detect a loop. Move slow one node and fast two nodes each step; if they ever meet, a loop exists, and if fast reaches null, there is no loop. Diagram: A → B → C → D → E, with E pointing back to C.
Q. Explain multithreading and common issues associated with it.
asked 1xmediumOperating systemsTechnical2018
Ans. Multithreading is running multiple threads within one process so work can happen concurrently while sharing the same memory. The main issues come from shared state: race conditions, deadlocks, starvation, livelocks, and visibility problems. These are managed with synchronisation, locks, atomic operations, thread-safe data structures, and careful design to minimise shared mutable data.
Q. Explain the concept of race conditions in Operating Systems.
asked 1xmediumOperating systemsTechnical2024
Ans. A race condition occurs when two or more processes or threads access shared data at the same time and the final result depends on the unpredictable order of execution. The key issue is unsynchronised access to a critical section, which can cause inconsistent data. It is prevented using locks, mutexes, semaphores, or atomic operations.
Q. List the devices used across all layers of the TCP/IP model.
asked 1xmediumNetworkingTechnical2024
Ans. Devices include hubs, repeaters, bridges, switches, wireless access points and NICs at the network access layer, routers and layer 3 switches at the internet layer, firewalls and load balancers at the transport layer, and proxies, gateways and application firewalls at the application layer. The key point is their layer of operation.
Q. List the devices used across all layers of the TCP/IP or OSI model.
asked 1xmediumNetworkingTechnical2024
Ans. Physical uses repeaters, hubs, modems and cables; data link uses switches, bridges, NICs and access points; network uses routers and Layer 3 switches; transport uses firewalls and load balancers; upper layers use gateways, proxies and application firewalls. The key point is that devices are classified by the layer whose header or signal they mainly inspect.
Q. Check for balanced parentheses with slight modification using regex.
asked 1xmediumStringsOnline test2015
Ans. Use a stack, not a single regex, to check balanced parentheses because regex cannot reliably match arbitrary nesting. Scan characters left to right, push opening brackets, and pop only when the matching closing bracket appears. If a mismatch occurs or the stack is non-empty at the end, it is unbalanced. Time complexity is linear.
Q. Explain paging and why it is required. How does virtual memory work?
asked 1xmediumOperating systemsTechnical2017
Ans. Paging is a memory management scheme that divides virtual memory into fixed size pages and physical memory into frames, letting the OS map pages to any free frames. It is required to avoid contiguous allocation, reduce fragmentation, and isolate processes. Virtual memory uses page tables and swaps missing pages from disk on demand.
Q. Basic aptitude questions covering quantitative and logical reasoning.
asked 1xmediumLogical reasoningOnline test2015
Ans. Break the problem into given facts, what is being asked, and the formula or logic needed. For quantitative questions, convert units, set up equations, and calculate carefully. For logical reasoning, identify patterns, relationships, or assumptions. Eliminate impossible options first, then verify the remaining answer against the original question.
Q. Find the next permutation of a given string with slight modification.
asked 1xmediumStringsOnline test2015
Ans. Scan from right to left to find the first character smaller than its next character, then swap it with the smallest character to its right that is larger, and reverse the suffix. This gives the next lexicographic permutation. If no such character exists, the string is already the largest permutation. Time complexity is O(n).
Q. Why is C widely used in embedded systems despite lacking OOP support?
asked 1xmediumEmbedded systemsTechnical2023
Ans. C is widely used in embedded systems because it gives very direct control over hardware with low runtime overhead. It maps well to memory registers, interrupts, and constrained RAM or flash, while producing small, predictable binaries. OOP is less important than determinism, portability across microcontrollers, and access to mature compilers and toolchains.
Q. Explain how messages are sent from one device to another in a network.
asked 1xmediumNetworkingHR2020
Ans. Messages are sent by breaking data into packets, adding addressing and control information, and passing them through network layers to the destination. Each packet carries source and destination addresses, such as IP addresses. Routers forward packets across networks, and the receiving device checks, orders, and reassembles them into the original message.
Q. Solve aptitude problems based on ages.
asked 1xhardQuantitative aptitudeOnline test2020
Ans. Represent present ages with variables, such as x and y. Translate each statement into an equation, keeping track of time: “after 5 years” means add 5 to each age, and “5 years ago” means subtract 5. Use ratios or differences as given, solve the equations, then check ages are realistic and non-negative.
Q. Solve aptitude problems based on mixtures and allegations.
asked 1xhardQuantitative aptitudeOnline test2020
Ans. Use alligation to compare the cheaper and dearer components with the required mean. Write the differences diagonally: dearer minus mean and mean minus cheaper. These differences give the ratio in which the two components must be mixed. For more than two components, first convert quantities to weighted averages, then apply the same idea.
Q. Puzzle: Using two 9-faced dice, how can you obtain all numbers from 0 to 31?
asked 1xhardLogical reasoningTechnical2023
Ans. Label one die 0, 1, 2, 3, 4, 5, 6, 7, 8. Label four faces of the other 0, 9, 18, 27, with the remaining faces repeats. Add the upward faces. Every n from 0 to 31 is 9q + r, with q from 0 to 3 and r from 0 to 8, so all values are covered.
Q. Solve logical puzzles discussed during the interview.
asked 1xunknownLogical reasoningTechnical2024
Ans. I solve logic puzzles by defining the facts, listing assumptions, and reducing possibilities step by step. I would speak my reasoning aloud, check each conclusion against the original conditions, and revise if a contradiction appears. Without a specific puzzle, there is no single answer, but the method is structured elimination and verification.
Q. Answer situational questions related to work scenarios and decision-making.
asked 1xunknownSituationalManagerial2024
Ans. Choose a real work situation with clear stakes, your specific responsibility, and a decision you had to make. Emphasise how you assessed options, involved others, managed risk, and acted under constraints. Interviewers listen for sound judgement, ownership, communication, learning from the outcome, and behaviour that fits their values and role expectations.
Q. Answer situational questions related to workplace scenarios and decision-making.
asked 1xunknownSituationalManagerial2024
Ans. Choose a real, relevant workplace example with a clear decision, constraint, and outcome. Emphasise how you assessed options, involved others, managed risk, and acted professionally. Interviewers listen for sound judgement, accountability, communication, and learning. Use enough context to make the situation clear, but focus mainly on your actions and results.
Q. You are being bullied by one of your classmates. How will you tackle the situation?
asked 1xunknownConflict resolutionTechnical2017
Ans. Pick a realistic situation where you stayed calm, protected yourself, and used the right support channels. Emphasise not retaliating, keeping records, setting clear boundaries, speaking to a trusted teacher or counsellor, and prioritising safety. Interviewers listen for maturity, self-control, respect for rules, and willingness to seek help when needed.
Showing 60 of 145 questions. Ranked by how often the same question came back across interviews.