Q. Explain the difference between mutex and semaphore.
asked 2xeasyOperating systemsTechnical2017-2023
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. How does HTTP and HTTPS work?
asked 1xmediumNetworkingTechnical2015
Ans. HTTP is a stateless request response protocol where a client, usually a browser, sends a request to a server and receives a response with status, headers and content. HTTPS is HTTP over TLS, which encrypts the data, verifies the server’s identity with certificates and protects messages from tampering in transit.
Q. Detect a loop in a linked list.
asked 1xmediumLinked listsTechnical2023
Ans. Use Floyd’s cycle detection with two pointers, slow and fast, starting at the head. Move slow one node at a time and fast two nodes at a time. If they ever meet, there is a loop. If fast reaches null, there is no loop. This runs in O(n) time and O(1) space.
Q. Explain OS scheduling algorithms
asked 1xmediumOperating systemsTechnical2015
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. Reverse a linked list recursively
asked 1xmediumLinked listsTechnical2015
Ans. Reverse it by recursing to the last node, treating that node as the new head, then rewiring links while the recursion unwinds. For each node, set its next node to point back to it, then set its own next to null. It uses the linked list nodes, takes O(n) time and O(n) stack space.
Q. Explain UML class diagrams and ER diagrams
asked 1xmediumDBMSTechnical2015
Ans. UML class diagrams model object-oriented software structure, while ER diagrams model data and relationships in a database. A UML class diagram shows classes, attributes, methods, inheritance, associations and dependencies. An ER diagram shows entities, attributes, keys and cardinalities. The key difference is that UML is for software design, ER is for database design.
Q. Explain pointers and related concepts in C
asked 1xmediumOOPTechnical2023
Ans. Pointers in C are variables that store memory addresses, usually of other variables, arrays, functions, or dynamically allocated blocks. The key related concepts are dereferencing to access the value, pointer arithmetic based on the pointed type, null pointers, void pointers, function pointers, and careful memory management to avoid leaks, dangling pointers, and invalid access.
Q. How does Paging work in Operating Systems?
asked 1xmediumOperating systemsTechnical2023
Ans. Paging divides a process’s virtual memory into fixed-size pages and physical memory into equal-size frames, then maps pages to frames using a page table. The CPU’s MMU translates virtual addresses to physical addresses during execution, often using a TLB cache. If a needed page is not in RAM, a page fault occurs.
Q. Implement a singly linked list from scratch
asked 1xmediumLinked listsTechnical2023
Ans. Implement it with a Node holding a value and a next reference, and a LinkedList holding the head, optionally tail and size. Insert at head is O(1), append is O(1) with tail or O(n) without, search and traversal are O(n), and deletion is O(1) once the previous node is known.
Q. What are the different memory spaces in C/C++?
asked 1xmediumOperating systemsTechnical2023
Ans. C/C++ programs mainly use the stack, heap, static or global storage, and code or read-only storage. The stack holds local automatic variables and function calls, the heap holds dynamically allocated objects, static storage holds globals and static variables for the program lifetime, and code/read-only areas hold instructions and constants.
Q. Explain important features introduced in C++11.
asked 1xmediumOOPTechnical2017
Ans. C++11 introduced safer, more expressive language and library features, including auto type deduction, range-based for loops, lambdas, nullptr, strongly typed enums, move semantics, rvalue references and variadic templates. The most important change was move semantics, because it allowed efficient transfer of resources and made modern containers and smart pointers much more practical.
Q. Explain virtual functions in C++ with an example
asked 1xmediumOOPTechnical2015
Ans. Virtual functions in C++ enable runtime polymorphism, so a call through a base class pointer or reference invokes the derived class override. For example, a base class Shape can have virtual draw, and Circle overrides draw. If a Shape pointer points to a Circle, calling draw runs Circle’s version. Declare destructors virtual in polymorphic bases.
Q. Print numbers from 1 to 100 without using loops.
asked 1xmediumRecursionTechnical2023
Ans. Use recursion: define a function that takes the current number, prints it, then calls itself with the next number until it reaches 100. The key detail is the base case, which stops recursion after 100. No data structure is needed. Time complexity is linear, O(100), effectively constant for this fixed range.
Q. Print the level order traversal of a binary tree.
asked 1xmediumTreesTechnical2023
Ans. Use breadth first search with a queue to print nodes level by level from left to right. Start by enqueuing the root, then repeatedly dequeue a node, print it, and enqueue its left and right children if they exist. This visits each node once, so time is O(n) and space is O(w), where w is maximum width.
Q. Add two polynomials represented using linked lists
asked 1xmediumLinked listsTechnical2023
Ans. Traverse both linked lists like a merge operation, comparing powers and creating a result list. If powers match, add coefficients and append the term only if the sum is non-zero. If one power is larger, append that term and advance that list. This uses a new linked list, takes O(m+n) time, and O(m+n) space.
Q. Explain virtual memory, physical memory, and cache
asked 1xmediumOperating systemsTechnical2015
Ans. Virtual memory is the address space a process sees, physical memory is the actual RAM, and cache is a small faster store used to avoid slower memory access. The operating system and hardware map virtual pages to physical frames, allowing isolation, relocation, and paging to disk when RAM is limited. Caches exploit locality for speed.
Q. Explain React and Redux and how they work together.
asked 1xmediumFrontend frameworksTechnical2024
Ans. React is a JavaScript library for building user interfaces, and Redux is a predictable state container for managing application state. React renders components based on props and state, while Redux keeps shared state in a single store. Components dispatch actions, reducers update the store, and React re-renders when relevant state changes.
Q. Explain the difference between mutex and spin lock.
asked 1xmediumOperating systemsTechnical2017
Ans. A mutex blocks or sleeps the waiting thread, while a spin lock makes the waiting thread repeatedly check until the lock is free. A mutex is better when waiting may take time because it frees the CPU. A spin lock is useful only for very short waits, especially in low-level or kernel code.
Q. Implement a queue data structure without using STL.
asked 1xmediumQueueTechnical2023
Ans. Implement it using a fixed-size circular array with front, rear, and size variables. Enqueue writes at rear and advances it modulo capacity, while dequeue reads from front and advances it similarly. Check size for empty or full conditions. Both enqueue and dequeue take O(1) time, with O(n) space.
Q. Explain storage classes and their memory allocation.
asked 1xmediumCTechnical2017
Ans. Storage classes in C define a variable’s scope, lifetime, linkage and storage location. auto variables are local and usually allocated on the stack. register asks for CPU register storage, if available. static variables live for the whole program in the data segment. extern declares a variable defined elsewhere, so it does not allocate new storage.
Q. Explain the role of a web server in a web application
asked 1xmediumNetworkingTechnical2015
Ans. A web server receives HTTP requests from clients, forwards them to the application when needed, and sends HTTP responses back. It commonly serves static files such as HTML, CSS, JavaScript and images, and can also handle concerns such as TLS termination, routing, compression, caching, logging and load balancing.
Q. What is paging and segmentation in operating systems?
asked 1xmediumOperating systemsTechnical2015
Ans. Segmentation divides a process’s memory into logical variable-sized parts such as code, stack and heap, while paging divides memory into fixed-size pages mapped to physical frames. Segmentation matches the programmer’s view but can cause external fragmentation. Paging simplifies allocation and avoids external fragmentation, but needs page tables and can cause internal fragmentation.
Q. Explain CPU scheduling algorithms in operating systems
asked 1xmediumOperating systemsTechnical2023
Ans. CPU scheduling algorithms decide which ready process gets the CPU next. Common algorithms include First Come First Served, Shortest Job First, Round Robin, Priority Scheduling and Multilevel Queue scheduling. The key detail is the trade-off between throughput, waiting time, response time and fairness, especially for interactive systems where starvation must be avoided.
Q. Explain pointers and dynamic memory allocation in C/C++
asked 1xmediumOOPTechnical2015
Ans. Pointers are variables that store memory addresses, usually of other variables or heap-allocated objects. Dynamic memory allocation in C uses functions like malloc, calloc, realloc and free to request and release memory at runtime. The key detail is ownership: every successful allocation should be checked, used within bounds, and freed exactly once.
Q. What is the difference between Paging and Segmentation?
asked 1xmediumOperating systemsTechnical2023
Ans. Paging divides memory into fixed-size pages and frames, while segmentation divides a program into variable-size logical parts such as code, stack and data. Paging is mainly for efficient physical memory management and avoids external fragmentation. Segmentation matches the programmer’s view of memory but can suffer from external fragmentation.
Q. Explain the time complexity of merge sort and quick sort
asked 1xmediumSortingTechnical2015
Ans. Merge sort is O(n log n) in best, average, and worst cases, because it always splits the input and then merges all elements at each level. Quick sort is O(n log n) on average, but O(n²) in the worst case if pivots are badly chosen. Random or balanced pivots usually avoid that.
Q. What is a copy constructor in C++ and when is it called?
asked 1xmediumOOPTechnical2015
Ans. A copy constructor in C++ creates a new object as a copy of an existing object of the same class. It is called when an object is initialised from another object, passed by value, returned by value in some cases, or explicitly copied. It usually takes a const reference to the same class.
Q. Why do we need virtual memory and how is it implemented?
asked 1xmediumOperating systemsTechnical2017
Ans. Virtual memory lets each process see a large, private, contiguous address space while using physical RAM efficiently and safely. It is implemented by dividing memory into pages, mapping virtual pages to physical frames through page tables, and using the MMU and TLB for translation. Missing pages cause page faults and may be loaded from disk.
Q. What is the exact role of the Memory Management Unit (MMU)?
asked 1xmediumOperating systemsTechnical2014
Ans. The MMU is hardware that translates virtual memory addresses used by a program into physical RAM addresses. It does this on each memory access using page tables, usually cached in a TLB. It also enforces access permissions, supports isolation between processes, and raises page faults when a mapping is missing or invalid.
Q. What is the difference between int* const c and const int* c?
asked 1xmediumCTechnical2017
Ans. int* const c is a constant pointer to an int, while const int* c is a pointer to a constant int. With int* const c, you cannot make c point somewhere else, but you can change the int it points to. With const int* c, you can move c, but not modify the pointed value through c.
Q. How would you check whether stack space has overflowed or not?
asked 1xmediumOperating systemsTechnical2017
Ans. Check overflow before pushing: if the stack’s top index is already at capacity minus one, the stack is full and another push would overflow. In an array stack this is a constant time check. In a linked stack, overflow usually means memory allocation for a new node fails.
Q. What will be the size of the given linked list node structure?
asked 1xmediumOOPTechnical2023
Ans. The size is typically 16 bytes on a 64-bit system for a node containing an int and a next pointer. The int takes 4 bytes, the pointer takes 8 bytes, and padding is added for alignment. On a 32-bit system, the same structure is usually 8 bytes.
Q. How can SQL Injection and Buffer Overflow attacks be prevented?
asked 1xmediumSecurityTechnical2023
Ans. Prevent SQL injection by using parameterised queries or prepared statements, and prevent buffer overflows by enforcing strict bounds checking and using memory-safe functions or languages. The key detail is never to treat untrusted input as executable code or assume it fits in memory; validate input, escape only as a backup, and apply least privilege.
Q. Find the second largest element in a 2D array without sorting it.
asked 1xmediumArraysTechnical2023
Ans. Scan every element once, keeping two variables: largest and secondLargest. For each value, update largest if it is bigger, and move the old largest to secondLargest; otherwise update secondLargest if the value lies between them. This uses constant extra space and takes O(rows × columns) time.
Q. Design a stack that supports push and pop operations at both ends.
asked 1xmediumStackSystem design2017
Ans. Use a deque, implemented with a doubly linked list or a circular dynamic array. Keep references to the front and rear, so pushFront, pushBack, popFront and popBack update only one end. Each operation takes O(1) time, with O(n) space for n stored elements. Handle empty deque underflow on pop.
Q. What is an interrupt and how does a processor handle an interrupt?
asked 1xmediumOperating systemsTechnical2014
Ans. An interrupt is a signal that makes the processor pause its current work and run a special handler routine. The processor typically finishes the current instruction, saves its state, identifies the interrupt source, jumps to the interrupt service routine, then restores the saved state and resumes the interrupted program.
Q. How would you design an efficient digital traffic light signal system?
asked 1xmediumEmbedded systemsTechnical2017
Ans. I would design distributed intersection controllers running deterministic signal state machines, coordinated by a central traffic management service. Each controller uses vehicle, pedestrian and emergency sensors to adjust phase lengths locally, while the central service optimises corridor timing. The most important detail is fail-safe behaviour: on lost connectivity or faults, lights revert to safe fixed cycles.
Q. Write the most efficient algorithm to find the square root of a number.
asked 1xmediumMathTechnical2014
Ans. Use Newton-Raphson iteration to compute the square root efficiently. Start with an initial guess x, repeatedly replace it with (x + n / x) / 2, and stop when the change is below the required precision. It converges quadratically, so it needs very few iterations. For integer square root, use binary search for exact floor value.
Q. Which lock is used in a single-core system: mutex or spin lock, and why?
asked 1xmediumOperating systemsTechnical2017
Ans. A mutex is normally used on a single-core system, because a waiting thread should sleep and let the scheduler run the lock holder. A spin lock wastes the only CPU by repeatedly checking the lock, so the holder cannot make progress until the spinner is pre-empted. Spin locks only make sense for very short, non-sleepable critical sections.
Q. Explain dynamic memory allocation in C and C++ using malloc, calloc, new, and delete.
asked 1xmediumOOPTechnical2023
Ans. Dynamic memory allocation reserves heap memory at runtime. In C, malloc allocates uninitialised memory and calloc allocates zero-initialised memory; both return void pointers and must be released with free. In C++, new allocates memory and calls constructors, while delete calls destructors and frees memory. Use delete[] for arrays and never mix these families.
Q. How would you test a black box using new test cases, given results for old test cases?
asked 1xmediumSoftware testingTechnical2017
Ans. I would use the old test results as an oracle where possible, then design new tests from the same input partitions and boundary areas. For each new case, I would predict the expected result from the specification or from known input-output patterns, run the black box, and compare actual behaviour with that expectation.
Q. Guess the output and explain differences between given C++ code snippets related to OOPS.
asked 1xmediumOOPTechnical2023
Ans. The output cannot be guessed without the actual C++ snippets. In OOP-related C++ questions, the key differences usually come from virtual versus non-virtual functions, object slicing, constructor and destructor order, access control, function hiding, and whether calls are made through objects, pointers, or references. Constructors are never virtual, but destructors often should be.
Q. What factors are considered while deciding the size of Time Quantum in Round Robin Scheduling?
asked 1xmediumOperating systemsTechnical2023
Ans. Time quantum is chosen by balancing response time against context switching overhead. A smaller quantum improves interactivity but causes many context switches, reducing CPU efficiency. A larger quantum reduces overhead but makes Round Robin behave like FCFS and increases waiting for short jobs. It should usually relate to typical CPU burst lengths and system workload.
Q. Delete a node from a linked list when only the pointer to that node is given (no head pointer).
asked 1xmediumLinked listsTechnical2017
Ans. Copy the data from the next node into the given node, then change the given node’s next pointer to skip that next node. This effectively deletes the next node while making the current node look deleted. It works in O(1) time and O(1) space, but it cannot be done if the given node is the tail.
Q. Given a 2D array of 1s and 0s, replace all the 0s in a row with 1s if that row contains at least one 1.
asked 1xmediumArraysTechnical2023
Ans. Scan each row, and if you find at least one 1 in that row, set every element in that row to 1. This can be done in place using a boolean flag per row. The time complexity is O(rows × columns), and the extra space complexity is O(1).
Q. If thousands of records are stored in a file instead of a database, which data structure would you use and why?
asked 1xmediumDBMSTechnical2015
Ans. I would use a B+ tree index over the file, mapping each record key to its byte offset. It is disk-friendly because it keeps data sorted and reduces file reads. Lookups, inserts and range searches are efficient, usually logarithmic, instead of scanning thousands of records each time.
Q. When a game is running on a computer, what resources does it use (firmware, middleware, drivers, application characteristics, stack)?
asked 1xmediumOperating systemsTechnical2017
Ans. A running game uses the full hardware and software stack: CPU, GPU, RAM, storage, audio, input and network hardware, controlled through firmware, the operating system and device drivers. It also uses middleware such as a game engine, physics, audio and networking libraries, plus its own application code, heap, stack, assets and runtime data.
Q. Given a multithreaded program, place mutexes and semaphores to ensure ACID properties.
asked 1xhardOperating systemsTechnical2017
Ans. Use mutexes to protect every shared object and the transaction log, and use semaphores only to limit or order access to bounded resources. Hold locks until commit for isolation, validate invariants before commit for consistency, use undo or redo logging for atomicity, and flush the committed log to stable storage for durability.
Q. Design an autonomous driving car system considering all possible use cases and scenarios.
asked 1xhardHigh level designSystem design2017
Ans. Design it as a safety critical, layered real time system: sensors, perception, localisation, prediction, planning, control, vehicle actuation, monitoring and fallback. The most important detail is fail safe behaviour: redundant sensors and compute, continuous health checks, conservative planning, remote diagnostics, black box logging, secure updates and a minimal risk manoeuvre for any uncertainty.
Q. Convert a struct to a hex string and back to a struct using reinterpret_cast and void pointers.
asked 1xhardOOPTechnical2017
Ans. Treat the struct as a contiguous byte array via a void pointer, reinterpret the address as unsigned char*, convert each byte to two hex characters, then reverse the process into storage for the same struct type. Use a string for hex and a byte buffer for decoding. This is O(n). Only do this for trivially copyable structs, as padding and endianness matter.
Q. How would you measure the stack space without using the task manager when an application is running? Write an algorithm if possible.
asked 1xhardOperating systemsTechnical2017
Ans. Measure stack usage by watermarking the stack: initialise the stack region with a known byte pattern, let the application run, then scan the region to find how much of the pattern was overwritten. The data is just a contiguous memory range. The scan is linear in stack size, so time complexity is O(n).
Q. Print a complex star pattern.
asked 1xeasyPatternsTechnical2024
Ans. Use nested loops to print each row and decide for each column whether to print a star or a space. The key detail is to derive the row and column conditions before coding, such as borders, diagonals, or symmetry. No extra data structure is needed. Time complexity is O(rows × columns).
Q. Explain Round Robin Scheduling.
asked 1xeasyOperating systemsTechnical2023
Ans. Round Robin Scheduling is a preemptive CPU scheduling algorithm where each ready process gets a fixed time slice, called a time quantum, in cyclic order. If a process does not finish in its slice, it is moved to the back of the ready queue. The key trade-off is fairness versus context-switching overhead.
Q. What are smart pointers in C++?
asked 1xeasyOOPTechnical2017
Ans. Smart pointers in C++ are objects that manage dynamically allocated memory automatically using RAII, so resources are released when the pointer object goes out of scope. The key types are std::unique_ptr for sole ownership, std::shared_ptr for shared ownership, and std::weak_ptr to observe shared objects without extending their lifetime.
Q. Quantitative aptitude problems based on mathematics
asked 1xunknownProbabilityOnline test2015
Ans. Identify the topic first, such as percentages, ratios, averages, time and work, profit and loss, or algebra. Write the given values clearly, choose the correct formula, and simplify step by step. Use approximation only when options allow it. Always check units and test the final answer against the question.
Q. Logical reasoning problems testing analytical thinking
asked 1xunknownLogical reasoningOnline test2015
Ans. Break the problem into facts, conditions, and what must be found. Represent relationships with a table, diagram, sequence, or symbols. Eliminate options that break any rule, then test the remaining cases systematically. Watch for words like always, only, not, and some, because they often determine the correct conclusion.
Q. Verbal ability questions testing English comprehension
asked 1xunknownVerbalOnline test2015
Ans. Read the passage or sentence carefully before looking at the options. Identify the main idea, tone, and key details. For vocabulary, use context rather than memory alone. Eliminate choices that are too broad, too narrow, or unsupported. In grammar questions, check subject verb agreement, tense, pronouns, modifiers, and sentence logic.
Q. How would you resolve an issue within a group when working on a group project?
asked 1xunknownConflict resolutionTechnical2019
Ans. Pick a real example where the disagreement affected progress, not personalities. Emphasise listening to each person, clarifying the shared goal, using evidence or criteria to compare options, and agreeing clear next steps. Interviewers listen for calm communication, fairness, accountability, and whether you helped the group move forward without blaming others.
Q. If a close colleague is not following the company code of conduct, what would you do?
asked 1xunknownEthicsTechnical2017
Ans. Choose an example where you acted fairly, discreetly, and in line with policy. Emphasise checking facts, speaking to the colleague if safe and appropriate, documenting concerns, and escalating through the right channel if needed. Interviewers listen for integrity, courage, respect, confidentiality, and that you protect people and standards over personal loyalty.
Q. You are representing Intel in India and are about to board a flight to the US for an important billion-dollar deal. At the airport, you are asked for a bribe of Rs 500. Will you give the bribe or not?
asked 1xunknownEthicsHR2014
Ans. A strong answer should say you would not pay the bribe, even for a high value deal. Emphasise Intel’s ethics, anti bribery laws, and long term reputation over short term gain. Explain that you would stay calm, ask for official process, escalate to airport or company contacts, and document the incident.
Showing 60 of 113 questions. Ranked by how often the same question came back across interviews.