i
Publicis Sapient
Filter interviews by
Clear (1)
I appeared for an interview before Nov 2020.
Round duration - 90 minutes
Round difficulty - Medium
There were 2 coding questions .
A thief plans to rob a store and can carry a knapsack with a maximum weight capacity of 'W'. The store contains 'N' items, each with a specified weight and value known to th...
The 0/1 Knapsack Problem involves maximizing profit by selecting items with specified weights and values within a knapsack's weight capacity.
Create a 2D array to store the maximum profit that can be achieved at each weight capacity and item index.
Iterate through each item and weight capacity, updating the maximum profit based on whether the item is included or not.
Return the maximum profit achievable with the given ite...
Given an N x M
matrix filled with integers, determine the minimum sum obtainable from a path that starts at a specified cell (x, y)
and ends at the top left corner of t...
Find the minimum sum path from a specified cell to the top left corner of a matrix.
Use dynamic programming to keep track of the minimum sum at each cell
Consider all possible moves (down, right, diagonal) from each cell
Start from the specified cell and work towards the top left corner
Add the value of the current cell to the minimum sum of the previous cells
Tip 1 : Must Solve Top Interview questions sincerely and have notebook where you write important Algorithms for future reference
Tip 2 : Practice about 800-1000 problems with about 5 - 10 problems a day. If you get bored then switch site for practice or just study topics that you like most to stay engaged. Consistency is the key.
Tip 3 : To make CV attractive add projects from either WEBD or ML . Both are fine. Also try to be through with the projects as any question can be asked related to them to test your knowledge. Also, consult with seniors and show them your CV as they provide helpful insights to make CV better .
Tip 1 : Nice indented resume with Key word highlighted .
Tip 2 : Be ready with all the topics related to your Internship / Projects as they are key point of discussion in interview. Write only those projects that you completed yourself because the interviewer knows when you are lying.
I appeared for an interview before Mar 2021.
Round duration - 75 minutes
Round difficulty - Medium
The round had 2 coding problems to solve with varying difficulty. Each candidate had a different set of questions. The round was around 2 pm. The webcam was turned on to keep an eye on candidates.
You are given two sorted linked lists. Your task is to merge them to form a combined sorted linked list and return the head of this final linked list.
Merge two sorted linked lists in-place to form a combined sorted linked list.
Create a dummy node to start the merged list
Compare nodes from both lists and link them accordingly
Update the pointer to the next node in the merged list
Handle cases where one list is longer than the other
Return the head of the merged list
Given an integer array, your objective is to change all elements to the same value, minimizing the cost. The cost of changing an element from x
to y
is defined ...
Find the minimum cost to make all elements of an array equal by changing them to a common value.
Calculate the median of the array and find the sum of absolute differences between each element and the median.
Sort the array and find the median element, then calculate the sum of absolute differences between each element and the median.
If the array has an even number of elements, consider the average of the two middle elem
Round duration - 50 minutes
Round difficulty - Medium
This round had 2 questions related to DSA. I was first asked to explain my approach with proper complexity analysis and then code the soution in any IDE that I prefer.
You are given an array of integers 'ARR' and an integer 'X'. Your task is to determine the number of subarrays in 'ARR' whose elements have a bitwise XOR equal...
Count the number of subarrays in an array whose elements have a bitwise XOR equal to a given value.
Iterate through all subarrays and calculate the XOR value for each subarray.
Keep track of the count of subarrays with XOR equal to the given value.
Use a hashmap to store the XOR values encountered and their frequencies for efficient lookup.
Handle edge cases like empty array or XOR value of 0 separately.
Example: For input ...
Given 'K' different arrays that are individually sorted in ascending order, merge all these arrays into a single array that is also sorted in ascending order.
Merge K sorted arrays into a single sorted array.
Iterate through all arrays and merge them using a min-heap.
Use a priority queue to efficiently merge the arrays.
Time complexity can be optimized to O(N log K) using a min-heap.
Round duration - 60 minutes
Round difficulty - Medium
This round had 2 Algorithmic questions wherein I was supposed to code both the problems after discussing their approaches and respective time and space complexities . After that , I was grilled on some OOPS concepts related to C++.
You are provided with a string STR
of length N
. The goal is to identify the longest palindromic substring within this string. In cases where multiple palind...
Identify the longest palindromic substring in a given string.
Iterate through the string and expand around each character to find palindromes
Keep track of the longest palindrome found
Return the longest palindrome with the smallest start index
Sort the given array of integers in ascending order using the quick sort algorithm.
Quick sort is a divide and conquer algorithm where a pivot is chosen to partition th...
Yes, the quick sort algorithm can be optimized to achieve NlogN complexity in the worst case by choosing the pivot element strategically.
Choose the pivot element as the median of the first, middle, and last elements of the array to reduce the chances of worst-case scenarios.
Implement a hybrid sorting algorithm that switches to a different sorting algorithm like insertion sort for small subarrays to improve efficiency.
R...
Early binding is resolved at compile time, while late binding is resolved at runtime in C++.
Early binding is also known as static binding, where the function call is resolved at compile time based on the type of the object.
Late binding is also known as dynamic binding, where the function call is resolved at runtime based on the actual type of the object.
Early binding is faster as the function call is directly mapped to...
Data abstraction is the process of hiding the implementation details of a data structure and only showing the necessary information to the user.
Data abstraction can be achieved through the use of abstract classes and interfaces in object-oriented programming.
It helps in reducing complexity by providing a simplified view of the data.
Example: In Java, abstract classes and interfaces are used to achieve data abstraction.
E...
Diamond Problem is a common issue in multiple inheritance in C++ where a class inherits from two classes that have a common base class.
Diamond Problem occurs when a class inherits from two classes that have a common base class, leading to ambiguity in accessing members.
It can be resolved in C++ using virtual inheritance, where the common base class is inherited virtually to avoid duplicate copies of base class members.
...
Friend functions in C++ are functions that are not members of a class but have access to its private and protected members.
Friend functions are declared inside a class with the 'friend' keyword.
They can access private and protected members of the class they are friends with.
Friend functions are not member functions of the class.
They can be used to allow external functions or classes to access private members of a class
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I appeared for an interview before Mar 2021.
Round duration - 75 minutes
Round difficulty - Medium
This was an online coding round where we had 2 questions to solve under 75 minutes. I found both the questions to be of Easy to Medium level of difficulty.
You are given several sets of points on a 2D plane, each set represented as a list of coordinates. Your task is to determine if there exists a line parallel to the Y-axis...
The task is to determine if there exists a line parallel to the Y-axis that reflects given points symmetrically.
Iterate through each test case and check if a vertical reflection line exists for the given points
Calculate the midpoint of the x-coordinates and check if it reflects the points symmetrically
Consider edge cases where points are on the reflection line or have the same x-coordinate
You are provided with a 2-dimensional matrix having N
rows and M
columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in t...
Count the number of islands in a 2D matrix of 1s and 0s.
Iterate through the matrix and perform depth-first search (DFS) to find connected 1s.
Mark visited cells to avoid redundant traversal.
Increment island count whenever a new island is encountered.
Round duration - 60 minutes
Round difficulty - Medium
This round had 2 coding questions followed by some questions from DBMS.
You are given an array/list HEIGHTS
of length N
, where each element represents the height of a histogram bar. The width of each bar is considered to be 1.
Find the area of the largest rectangle that can be formed within the bounds of a given histogram.
Iterate through the histogram bars and calculate the area of the largest rectangle that can be formed using each bar as the height.
Use a stack to keep track of the indices of the bars in non-decreasing order of height.
Pop elements from the stack and calculate the area until a smaller height bar is encountered.
Update the max...
Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.
The first line contains an...
The task is to determine if a given string consisting of parentheses is balanced or not.
Iterate through the characters of the string and use a stack to keep track of opening parentheses.
If an opening parenthesis is encountered, push it onto the stack.
If a closing parenthesis is encountered, check if it matches the top of the stack. If it does, pop the stack, else the string is not balanced.
At the end, if the stack is e...
ACID properties in DBMS ensure data integrity and consistency in transactions.
Atomicity: All operations in a transaction are completed successfully or none at all.
Consistency: Data is always in a valid state before and after a transaction.
Isolation: Transactions are isolated from each other to prevent interference.
Durability: Once a transaction is committed, changes are permanent and survive system failures.
Example: If...
Levels of data abstraction in a DBMS refer to the different views of data provided to users and applications.
Physical level: Deals with how data is stored on the storage media. Example: data blocks, pages, indexes.
Logical level: Focuses on how data is represented to users. Example: tables, views, constraints.
View level: Provides a customized view of the database for specific users or applications. Example: queries, rep
Round duration - 60 minutes
Round difficulty - Medium
Standard DS/Algo round with 2 coding questions followed by 2 interesting puzzles.
You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determi...
Detect if an undirected graph contains a cycle by exploring all possible paths.
Use Depth First Search (DFS) algorithm to traverse the graph and detect cycles.
Maintain a visited set to keep track of visited vertices and a parent pointer to avoid visiting the same vertex twice.
If a visited vertex is encountered that is not the parent of the current vertex, a cycle is present.
Consider edge cases like disconnected graphs a
Given a matrix ARR
with dimensions N
* M
, consisting only of 0s and 1s where each row is sorted, determine the index of the row that contains the highest number of 1s. If multi...
Find the row with the maximum number of 1s in a sorted matrix.
Iterate through each row of the matrix and count the number of 1s in each row
Keep track of the row index with the maximum number of 1s
Return the index of the row with the highest count of 1s
By lighting both wires at the same time, the shorter wire will burn out first, allowing you to measure a specific duration of time.
Light both wires at the same time
Measure the time it takes for the shorter wire to burn out completely
The remaining length of the longer wire will indicate the specific duration of time
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Publicis Sapient interview questions for designations
Network layers are a hierarchical way of organizing communication protocols.
Network layers provide a modular approach to networking.
Each layer has a specific function and communicates with adjacent layers.
The OSI model has 7 layers, while the TCP/IP model has 4 layers.
Examples of layers include the physical layer, data link layer, network layer, transport layer, and application layer.
Deadlock is a situation where two or more processes are unable to proceed because they are waiting for each other to release resources.
Occurs in multi-threaded/multi-process environments
Can lead to system freeze or crash
Prevention techniques include resource ordering and timeouts
Example: Process A holds resource X and waits for resource Y, while Process B holds resource Y and waits for resource X
Paging and Segmentation are memory management techniques used by operating systems.
Paging divides memory into fixed-size pages and stores them in physical memory.
Segmentation divides memory into logical segments and stores them in physical memory.
Paging allows for efficient use of physical memory and reduces fragmentation.
Segmentation allows for protection and sharing of memory between processes.
Examples of operating s...
Get interview-ready with Top Publicis Sapient Interview Questions
I am a software developer with experience in various programming languages and frameworks.
Proficient in Java, C++, and Python
Familiar with web development using HTML, CSS, and JavaScript
Experience with database management systems such as MySQL and MongoDB
Strong problem-solving and analytical skills
Worked on projects involving machine learning and artificial intelligence
Method overloading is having multiple methods with the same name but different parameters. Method overriding is having a subclass method with the same name and parameters as a superclass method.
Method overloading is used to provide different ways of calling the same method with different parameters.
Method overriding is used to provide a specific implementation of a method in a subclass that is already defined in the su...
Switch case is used for multiple conditions while if else is used for binary conditions.
Switch case is faster than if else for multiple conditions.
If else can handle complex conditions while switch case cannot.
Switch case can only compare values of the same data type.
If else can handle null values while switch case cannot.
Example: switch (day) { case 1: console.log('Monday'); break; case 2: console.log('Tuesday'); brea...
Interface and abstract class are both used for abstraction in object-oriented programming.
An interface is a collection of abstract methods that define a contract for a class to implement.
An abstract class is a class that cannot be instantiated and may contain abstract methods.
Interfaces are used to achieve multiple inheritance in Java.
Abstract classes can have non-abstract methods and instance variables.
An example of a...
Polymorphism is the ability of an object to take on many forms.
It allows objects of different classes to be treated as if they were objects of the same class.
It is achieved through method overriding and method overloading.
Example: A shape class can have multiple subclasses like circle, square, etc. and all can be treated as shapes.
Example: A method can have different implementations in different classes but with the sa
Inheritance is a mechanism in object-oriented programming where a new class is created by inheriting properties of an existing class.
Inheritance allows code reusability and saves time and effort in writing new code.
The existing class is called the parent or base class, and the new class is called the child or derived class.
The child class inherits all the properties and methods of the parent class and can also add its ...
Default case in switch case statement
Default case is executed when no other case matches the switch expression
It is optional and can be placed anywhere in the switch statement
It is often used to handle unexpected input or errors
It should always be the last case in the switch statement
I am a passionate software developer with a strong background in web development and a love for problem-solving.
Experienced in HTML, CSS, JavaScript, and various web development frameworks
Proficient in backend development using languages like Java, Python, and Node.js
Familiar with database management systems such as MySQL and MongoDB
Strong problem-solving skills and ability to work well in a team environment
I tend to get overly focused on details, which can sometimes slow down my progress.
I have a tendency to spend too much time on perfecting small details
I sometimes struggle with prioritizing tasks due to my focus on details
I am working on improving my time management skills to balance detail-oriented work with efficiency
Yes, I have received offers from two other companies.
Received offers from Company A and Company B
Currently evaluating all offers to make an informed decision
Considering factors like company culture, growth opportunities, and compensation
I would like to join Google because of their innovative projects and work culture.
Google is known for its cutting-edge technology and innovative projects.
They have a strong focus on employee well-being and work-life balance.
Google offers opportunities for career growth and development.
The company has a diverse and inclusive work culture.
Google is a leader in the tech industry with a global presence.
Yes, I have worked in multiple teams in various projects.
Worked in a team of developers to create a new software application
Collaborated with designers, testers, and project managers to meet project deadlines
Participated in daily stand-up meetings to discuss progress and roadblocks
Yes, they are similar.
All 8 metal balls are of the same material.
They have the same size and weight.
They have the same physical properties.
They are interchangeable in any given situation.
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance.
C++ has a standard template library (STL) which C does not have.
C++ allows function overloading while C does not.
C++ has exception handling while C does not.
For loop is used for iterating over a sequence while while loop is used for iterating until a condition is met.
For loop is used when the number of iterations is known beforehand
While loop is used when the number of iterations is not known beforehand
For loop is faster than while loop for iterating over a sequence
While loop is useful for iterating until a specific condition is met
For loop can be used with range() functio...
To reverse a string without using any looping and inbuilt functions, we can use recursion.
Create a function that takes a string as input.
If the length of the string is 0 or 1, return the string.
Otherwise, call the function recursively with the substring starting from the second character and concatenate the first character at the end.
Return the reversed string.
Example: reverseString('hello') returns 'olleh'.
A priority queue can be implemented using a single queue or multiple queues.
One approach is to use a single queue and assign priorities to elements using a separate data structure.
Another approach is to use multiple queues, each representing a different priority level.
For example, if there are three priority levels, three queues can be used to implement the priority queue.
An array of objects can be used to implement a heterogeneous array.
Each element in the array can be an object that represents a different data type.
The objects can have different properties and methods based on their respective data types.
For example, an element can be an object representing a string with a 'value' property and a 'length' method.
Developed a web-based inventory management system for a retail company.
Used HTML, CSS, and JavaScript for the front-end development.
Implemented a RESTful API using Node.js and Express for the back-end.
Utilized a MySQL database to store and manage inventory data.
Implemented features like product search, order management, and reporting.
Ensured data security and user authentication using encryption and JWT.
Collaborated wi...
The missing rupee is not actually missing. The calculation is misleading and does not account for the total amount paid.
The initial amount paid by each person was Rs.10, totaling Rs.30.
The owner gave them a discount of Rs.5, so they paid Rs.25 in total.
The broker took Rs.2, leaving them with Rs.23.
When the broker returned Rs.1 to each person, they each received Rs.1 back, totaling Rs.3.
So, the total amount paid by the ...
Inheritance in Java allows a class to inherit properties and methods from another class.
Inheritance is achieved using the 'extends' keyword.
The class that is being inherited from is called the superclass or parent class.
The class that inherits from the superclass is called the subclass or child class.
Subclasses can access the public and protected members of the superclass.
Inheritance promotes code reusability and allow...
A program to check if a given number is a palindrome or not.
Convert the number to a string.
Reverse the string and compare it with the original string.
If they are equal, the number is a palindrome.
If not, the number is not a palindrome.
Normalisation is the process of organizing data in a database to reduce redundancy and improve data integrity.
It involves breaking down a table into smaller tables and defining relationships between them.
Normalization helps to eliminate data inconsistencies and anomalies.
There are different levels of normalization, with each level having specific rules to follow.
For example, first normal form (1NF) requires that each t...
Yes, I am ready to relocate anywhere in India or outside upon company needs.
I am open to exploring new locations and cultures.
I understand that relocation may be necessary for career growth and opportunities.
I am adaptable and willing to adjust to new environments.
I have experience working in diverse teams and can easily integrate into new settings.
I would be ready to accept a project in Java even if I was trained in DotNet earlier.
I have a strong foundation in programming principles and concepts, which can be applied to any language.
I am confident in my ability to quickly learn and adapt to new technologies.
I have experience working with multiple programming languages and frameworks.
I can leverage my knowledge of DotNet to understand similar concepts in Java.
I a...
I want to join Sapient because of its reputation for innovative projects and collaborative work environment.
Sapient is known for working on cutting-edge projects that push the boundaries of technology
I value the collaborative work environment at Sapient, where team members support each other to achieve success
I am impressed by Sapient's commitment to professional development and growth opportunities for employees
My expectations from Sapient
I expect Sapient to provide a challenging and innovative work environment
I expect Sapient to offer opportunities for professional growth and learning
I expect Sapient to have a collaborative and supportive team culture
I expect Sapient to provide competitive compensation and benefits
I expect Sapient to have a strong focus on quality and delivering excellent software solutions
What people are saying about Publicis Sapient
Some of the top questions asked at the Publicis Sapient Software Developer interview -
based on 8 interviews
4 Interview rounds
based on 37 reviews
Rating in categories
Senior Associate
2.2k
salaries
| ₹11 L/yr - ₹40 L/yr |
Associate Technology L2
1.5k
salaries
| ₹5 L/yr - ₹20 L/yr |
Senior Associate Technology L1
1.2k
salaries
| ₹10.2 L/yr - ₹30 L/yr |
Senior Software Engineer
743
salaries
| ₹9.6 L/yr - ₹37 L/yr |
Senior Associate 2
628
salaries
| ₹14.2 L/yr - ₹41 L/yr |
Accenture
IBM
TCS
Infosys