One Convergence
30+ PPG Asian Paints Interview Questions and Answers
Q1. Longest Common Subsequence Problem Statement
Given two strings STR1
and STR2
, determine the length of their longest common subsequence.
A subsequence is a sequence that can be derived from another sequence by d...read more
Q2. Middle of a Linked List
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the middle ...read more
Q3. Flip Bits Problem Explanation
Given an array of integers ARR
of size N, consisting of 0s and 1s, you need to select a sub-array and flip its bits. Your task is to return the maximum count of 1s that can be obta...read more
Q4. Count Set Bits Problem Statement
Given a positive integer N
, compute the total number of '1's in the binary representation of all numbers from 1 to N. Return this count modulo 1e9+7 because the result can be ve...read more
Q5. Convert a Binary Search Tree (BST) to a Greater Sum Tree
Given a Binary Search Tree of integers, transform it into a Greater Sum Tree where each node's value is replaced with the sum of all node values greater ...read more
Q6. Reverse the String Problem Statement
You are given a string STR
which contains alphabets, numbers, and special characters. Your task is to reverse the string.
Example:
Input:
STR = "abcde"
Output:
"edcba"
Input...read more
Q7. What is IPC(inter process communication) and ITC(inter thread communication) and how it happens and how to implement it
IPC is a mechanism for communication between processes, while ITC is for communication between threads within a process.
IPC allows processes to exchange data and synchronize their actions.
ITC allows threads to share data and coordinate their activities.
IPC can be implemented using various techniques such as pipes, sockets, shared memory, and message queues.
ITC can be achieved through shared variables, message passing, and synchronization primitives.
Example of IPC: A client-se...read more
Q8. What are different types of memory segment and tell about different parts of program and where they are stored?
Memory segments include code, data, stack, and heap. Each segment stores different parts of a program in memory.
Code segment: stores the executable code of the program
Data segment: stores global and static variables
Stack segment: stores local variables and function call information
Heap segment: stores dynamically allocated memory
Q9. What is little endian ,big endian. How to implement it’s code?
Little endian and big endian are byte ordering formats. Little endian stores the least significant byte first, while big endian stores the most significant byte first.
Little endian and big endian refer to the order in which bytes are stored in memory.
In little endian, the least significant byte is stored first, followed by the more significant bytes.
In big endian, the most significant byte is stored first, followed by the less significant bytes.
Implementing code for little en...read more
Q10. Explain zombie, daemon and orphan processes and how they are different?
Zombie, daemon, and orphan processes are different types of processes in operating systems.
Zombie processes are dead processes that have completed execution but still have an entry in the process table.
Daemon processes are background processes that run continuously and perform specific tasks.
Orphan processes are child processes that continue to run even after their parent process has terminated.
Zombie processes consume system resources until they are removed from the process ...read more
Q11. How client and server establish their communication. How to create socket , explain step by step?
Client and server establish communication through sockets. Creating a socket involves several steps.
Client and server each create a socket object.
Server socket binds to a specific port number on the server machine.
Server socket listens for incoming client connections.
Client socket connects to the server socket using the server's IP address and port number.
Once the connection is established, client and server can exchange data through the socket.
Q12. How to use gcc to compile program and what are different options available?
gcc is a command-line compiler used to compile programs written in C or C++.
To compile a program using gcc, use the command 'gcc
-o '. The '-o' option is used to specify the name of the output file.
By default, gcc compiles C programs. To compile C++ programs, use the '-x' option with 'c++' argument.
To enable warnings during compilation, use the '-Wall' option.
To optimize the compiled code, use the '-O' option followed by a level (e.g., '-O2' for level 2 optimization).
To inclu...read more
Q13. Describe switch in n/w and how will you implement its s/w
A switch in a network is a device that connects multiple devices together and forwards data packets between them.
A switch operates at the data link layer of the OSI model.
It uses MAC addresses to determine the destination of data packets.
Switches improve network performance by reducing collisions and providing dedicated bandwidth to each connected device.
Switches can be implemented using software-defined networking (SDN) technologies.
Examples of switch software include Cisco ...read more
Q16. How to create parent and child process and different threads?
To create parent and child processes, use fork() system call. To create threads, use pthread_create() function.
To create a child process, use fork() system call. The child process is an exact copy of the parent process.
To create threads, use pthread_create() function from pthread library.
Parent and child processes can communicate using inter-process communication mechanisms like pipes or shared memory.
Threads share the same memory space and can communicate directly through sh...read more
Q17. What are common segment used by parent and child processes?
The common segments used by parent and child processes are code segment, data segment, and stack segment.
Code segment: Contains the executable code of the program.
Data segment: Stores global and static variables.
Stack segment: Used for local variables and function calls.
Q20. What is symbol table and what is it used for?
A symbol table is a data structure used by compilers and interpreters to store information about the variables, functions, and other symbols in a program.
It maps each symbol to its attributes, such as its data type, memory location, and scope.
Symbol tables are used during the compilation or interpretation process to resolve references to symbols and perform semantic analysis.
They enable efficient lookup and retrieval of symbol information during program execution.
Symbol table...read more
Q21. Write program to check common sequence in two string
Program to check common sequence in two strings
Iterate through each character of the first string
Check if the current character is present in the second string
If yes, add it to the common sequence array
Return the common sequence array
Q22. What is NAT and its functions ?
NAT stands for Network Address Translation. It is a process of translating IP addresses between different networks.
NAT allows multiple devices in a private network to share a single public IP address.
It provides security by hiding the internal IP addresses from external networks.
NAT enables the conservation of public IP addresses by allowing multiple devices to use a single IP.
It facilitates the routing of traffic between different networks.
NAT can be implemented using variou...read more
Q26. What are common segment used by threads?
The common segments used by threads are code segment, data segment, and stack segment.
Code segment: Contains the executable code of the program.
Data segment: Stores global and static variables.
Stack segment: Used for local variables and function call information.
Q27. What is linking? Explain in detail
Linking is the process of connecting different web pages or resources together through hyperlinks.
Linking is an essential aspect of the World Wide Web.
It allows users to navigate between different web pages by clicking on hyperlinks.
Hyperlinks can be text, images, or other elements that when clicked, direct the user to another web page or resource.
Linking helps in organizing and structuring information on the web.
It enables search engines to discover and index web pages.
Linki...read more
Q30. Write program to the bits which is set
This program finds and prints the bits that are set in a given number.
Use bitwise AND operator (&) to check if a bit is set.
Iterate through each bit of the number and print the position of the set bits.
Q31. Write program to reverse bits of number
Program to reverse the bits of a number
Convert the number to binary representation
Reverse the binary representation
Convert the reversed binary back to decimal
Q32. What is socket buffer?
A socket buffer is a data structure used by the operating system to store data being sent or received over a network socket.
Socket buffers are typically implemented as circular buffers.
They are used to temporarily hold data until it can be processed by the application.
Socket buffers have a fixed size and can be filled or emptied by the operating system or the application.
They help in managing the flow of data between the network and the application.
Examples of socket buffer i...read more
Q33. Write program to reverse string
Program to reverse a string
Use a loop to iterate through the characters of the string
Create a new string and append each character in reverse order
Return the reversed string
Q34. What is function of bridge?
A bridge is a structure that connects two separate areas, allowing for the passage of people, vehicles, or other forms of transportation.
Bridges provide a means of crossing obstacles such as rivers, valleys, or roads.
They facilitate the movement of people, vehicles, and goods from one place to another.
Bridges can be made of various materials such as concrete, steel, or wood.
They can be designed in different styles and shapes, including arches, suspension bridges, or beam brid...read more
Q35. What is VLAN ?
VLAN stands for Virtual Local Area Network. It is a technology that allows the creation of multiple virtual networks within a single physical network.
VLANs provide segmentation and isolation of network traffic.
They improve network performance and security.
VLANs can be used to group devices based on department, function, or security requirements.
They enable easier network management and troubleshooting.
VLANs are commonly used in large organizations, data centers, and cloud env...read more
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month