Premium Employer

i

This company page is being actively managed by PubMatic Team. If you also belong to the team, you can get access from here

PubMatic Verified Tick Work with us arrow

Compare button icon Compare button icon Compare

Filter interviews by

PubMatic SDE-2 Interview Questions and Answers

Updated 16 Sep 2021

6 Interview questions

A SDE-2 was asked
Q. 

Convert Binary Tree to Mirror Tree

Convert a given binary tree into its mirror tree, where the left and right children of all non-leaf nodes are interchanged.

Input:

An integer ‘T’ denoting the number of...
Ans. 

Convert a binary tree into its mirror tree by interchanging left and right children of non-leaf nodes.

  • Traverse the tree in a recursive manner and swap the left and right children of each node.

  • Use a temporary variable to swap the children of each node.

  • Ensure to modify the tree in place without creating a new tree.

  • Example: For the input tree 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1, the mirror tree will have inorder tr...

A SDE-2 was asked
Q. 

Loot Houses Problem Statement

A thief is planning to steal from several houses along a street. Each house has a certain amount of money stashed. However, the thief cannot loot two adjacent houses. Determin...

Ans. 

Determine the maximum amount of money a thief can steal from houses without looting two consecutive houses.

  • Use dynamic programming to keep track of the maximum money that can be stolen up to each house.

  • At each house, the thief can either choose to steal from the current house or skip it and steal from the previous house.

  • The maximum amount of money that can be stolen without looting two consecutive houses is the ma...

SDE-2 Interview Questions Asked at Other Companies

asked in Walmart
Q1. Maximum Frequency Number Problem Statement Given an array of inte ... read more
Q2. Reverse String Operations Problem Statement You are provided with ... read more
asked in KhataBook
Q3. Alien Dictionary Problem Statement Ninja is mastering an unusual ... read more
asked in Atlassian
Q4. K Most Frequent Words Problem Statement Given an array of N non-e ... read more
asked in DP World
Q5. Count Ways To Reach The N-th Stair Problem Statement You are give ... read more
A SDE-2 was asked
Q. 

Trailing Zeros in Factorial Problem

Find the number of trailing zeroes in the factorial of a given number N.

Input:

The first line contains an integer T representing the number of test cases.
Each of the ...
Ans. 

Count the number of trailing zeros in the factorial of a given number.

  • Count the number of factors of 5 in the factorial of the given number N.

  • Divide N by 5, then by 25, then by 125, and so on, and sum up the quotients to get the total number of trailing zeros.

  • Example: For N=10, 10/5=2, so there are 2 factors of 5 in 10!, hence 2 trailing zeros.

A SDE-2 was asked
Q. 

Time to Burn Tree Problem

You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely bu...

Ans. 

Calculate the time in minutes required to completely burn a binary tree starting from a given node.

  • Start burning from the given node and spread fire to adjacent nodes each minute

  • Track the time taken for each node to burn completely

  • Return the maximum time taken to burn the entire tree

A SDE-2 was asked
Q. 

Topological Sort Problem Statement

Given a Directed Acyclic Graph (DAG) consisting of V vertices and E edges, your task is to find any topological sorting of this DAG. You need to return an array of size V...

Ans. 

Implement a function to find any topological sorting of a Directed Acyclic Graph (DAG).

  • Use Depth First Search (DFS) to find the topological ordering of the vertices.

  • Start by visiting a vertex and recursively visit its adjacent vertices before adding it to the result array.

  • Maintain a visited array to keep track of visited vertices and avoid cycles.

  • Once all vertices are visited, reverse the result array to get the t...

A SDE-2 was asked
Q. 

Binary Tree Zigzag Traversal Problem Statement

Given a Binary Tree comprised of 'N' nodes with integer values, your task is to print the zigzag traversal of the tree.

Note:

The zigzag pattern implies tha...

Ans. 

Implement a function to print the zigzag traversal of a Binary Tree.

  • Traverse the Binary Tree level by level, alternating the direction of traversal for each level.

  • Use a queue to keep track of nodes at each level and a flag to switch the direction of traversal.

  • Print the values of nodes in the zigzag order as described in the problem statement.

PubMatic SDE-2 Interview Experiences

1 interview found

SDE-2 Interview Questions & Answers

user image Anonymous

posted on 16 Sep 2021

I appeared for an interview in Jan 2021.

Round 1 - Video Call 

(3 Questions)

Round duration - 90 Minutes
Round difficulty - Medium

It was a zoom call with a SDE-2 person, after 15 mins into my background he jumped directly to the questions
 

  • Q1. 

    Binary Tree Zigzag Traversal Problem Statement

    Given a Binary Tree comprised of 'N' nodes with integer values, your task is to print the zigzag traversal of the tree.

    Note:

    The zigzag pattern implies th...

  • Ans. 

    Implement a function to print the zigzag traversal of a Binary Tree.

    • Traverse the Binary Tree level by level, alternating the direction of traversal for each level.

    • Use a queue to keep track of nodes at each level and a flag to switch the direction of traversal.

    • Print the values of nodes in the zigzag order as described in the problem statement.

  • Answered by AI
  • Q2. 

    Convert Binary Tree to Mirror Tree

    Convert a given binary tree into its mirror tree, where the left and right children of all non-leaf nodes are interchanged.

    Input:

    An integer ‘T’ denoting the number o...
  • Ans. 

    Convert a binary tree into its mirror tree by interchanging left and right children of non-leaf nodes.

    • Traverse the tree in a recursive manner and swap the left and right children of each node.

    • Use a temporary variable to swap the children of each node.

    • Ensure to modify the tree in place without creating a new tree.

    • Example: For the input tree 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1, the mirror tree will have inorder travers...

  • Answered by AI
  • Q3. 

    Time to Burn Tree Problem

    You are given a binary tree consisting of 'N' unique nodes and a start node where the burning will commence. The task is to calculate the time in minutes required to completely b...

  • Ans. 

    Calculate the time in minutes required to completely burn a binary tree starting from a given node.

    • Start burning from the given node and spread fire to adjacent nodes each minute

    • Track the time taken for each node to burn completely

    • Return the maximum time taken to burn the entire tree

  • Answered by AI
Round 2 - Video Call 

(1 Question)

Round duration - 90 Minutes
Round difficulty - Medium

Again this was a Problem Solving round taken by a SDE-2 

  • Q1. 

    Topological Sort Problem Statement

    Given a Directed Acyclic Graph (DAG) consisting of V vertices and E edges, your task is to find any topological sorting of this DAG. You need to return an array of size ...

  • Ans. 

    Implement a function to find any topological sorting of a Directed Acyclic Graph (DAG).

    • Use Depth First Search (DFS) to find the topological ordering of the vertices.

    • Start by visiting a vertex and recursively visit its adjacent vertices before adding it to the result array.

    • Maintain a visited array to keep track of visited vertices and avoid cycles.

    • Once all vertices are visited, reverse the result array to get the topolo...

  • Answered by AI
Round 3 - Video Call 

(1 Question)

Round duration - 100 Minutes
Round difficulty - Hard

This round was with a SDE-3(Principal Engineer)

  • Q1. 

    Trailing Zeros in Factorial Problem

    Find the number of trailing zeroes in the factorial of a given number N.

    Input:

    The first line contains an integer T representing the number of test cases.
    Each of the...
  • Ans. 

    Count the number of trailing zeros in the factorial of a given number.

    • Count the number of factors of 5 in the factorial of the given number N.

    • Divide N by 5, then by 25, then by 125, and so on, and sum up the quotients to get the total number of trailing zeros.

    • Example: For N=10, 10/5=2, so there are 2 factors of 5 in 10!, hence 2 trailing zeros.

  • Answered by AI
Round 4 - Video Call 

Round duration - 90 Minutes
Round difficulty - Hard

This round was scheduled with a SDE-3/SDE-4(Senior Principal Engineer):
He directly started with questions after my introduction of 5mins
 

Round 5 - Video Call 

(1 Question)

Round duration - 90 Miinutes
Round difficulty - Medium

Discussion with Hiring Manager
 

  • Q1. 

    Loot Houses Problem Statement

    A thief is planning to steal from several houses along a street. Each house has a certain amount of money stashed. However, the thief cannot loot two adjacent houses. Determi...

  • Ans. 

    Determine the maximum amount of money a thief can steal from houses without looting two consecutive houses.

    • Use dynamic programming to keep track of the maximum money that can be stolen up to each house.

    • At each house, the thief can either choose to steal from the current house or skip it and steal from the previous house.

    • The maximum amount of money that can be stolen without looting two consecutive houses is the maximum...

  • Answered by AI
Round 6 - Video Call 

Round duration - 75 Minutes
Round difficulty - Easy

This round was with VP in Redwood City , it was scheduled around 11:00 pm IST
 

Interview Preparation Tips

Professional and academic backgroundI completed Computer Science Engineering from Guru Gobind Singh Indraprastha University. I applied for the job as SDE - 2 in PuneEligibility criteria2+ years of Experience in relevant field/teamPubMatic interview preparation:Topics to prepare for the interview - DataStructures , Algorithms, System Design,Big Data,Spark,OptimizationTime required to prepare for the interview - 3 monthsInterview preparation tips for other job seekers

Tip 1 : Be solid with the basics of Ds, Algo. Good to have end to end projects which are hosted on cloud/Github.
Tip 2 : Its always good to be presentable and have good communications skills
Tip 3 : Be honest, clear in approach and always walkthrough your thought process to the interviewer, If you dont know something kindly refuse , dont try to fake anything

Application resume tips for other job seekers

Tip 1 : Mention your projects and experience at the top. Be clear on what was done, a brief on how it was done, language /tech stack involved. If possible try to host and make it accessible. You never know if you can present it with just one click.
Tip 2 : Choose a balance between, white spaces and text, it should be well indented, no grammatical errors.
Tip 3 : It takes less than 2 min to scan a resume. Don't mention things which are irrelevant.

Final outcome of the interviewSelected

Skills evaluated in this interview

Top trending discussions

View All
Interview Tips & Stories
2w
toobluntforu
·
works at
Cvent
Can speak English, can’t deliver in interviews
I feel like I can't speak fluently during interviews. I do know english well and use it daily to communicate, but the moment I'm in an interview, I just get stuck. since it's not my first language, I struggle to express what I actually feel. I know the answer in my head, but I just can’t deliver it properly at that moment. Please guide me
Got a question about PubMatic?
Ask anonymously on communities.

Interview questions from similar companies

I applied via Naukri.com and was interviewed before May 2021. There were 4 interview rounds.

Round 1 - Aptitude Test 

It was mixed like aptitude and from technical.

Round 2 - Technical 

(1 Question)

  • Q1. It was F2F round. Where technical questions were asked.
Round 3 - One-on-one 

(1 Question)

  • Q1. Managerial round. It includes technical and managerial both
Round 4 - HR 

(1 Question)

  • Q1. HR round. It includes all the HR level questions

Interview Preparation Tips

Interview preparation tips for other job seekers - Just be prepared with your resume content what you have mentioned

SDE-2 Interview Questions Asked at Other Companies

asked in Walmart
Q1. Maximum Frequency Number Problem Statement Given an array of inte ... read more
Q2. Reverse String Operations Problem Statement You are provided with ... read more
asked in KhataBook
Q3. Alien Dictionary Problem Statement Ninja is mastering an unusual ... read more
asked in Atlassian
Q4. K Most Frequent Words Problem Statement Given an array of N non-e ... read more
asked in DP World
Q5. Count Ways To Reach The N-th Stair Problem Statement You are give ... read more

I applied via LinkedIn and was interviewed in Jan 2021. There were 5 interview rounds.

Interview Questionnaire 

2 Questions

  • Q1. I have been questioned on AEM Concepts, Sling Models, schedulers, servlets, OSGI services
  • Q2. Be prepared for most of the concepts in AEM

Interview Preparation Tips

Interview preparation tips for other job seekers - The overall interview experience was very good.

I applied via LinkedIn

Interview Questionnaire 

1 Question

  • Q1. I have been questioned on different concepts in AEM, sling models, services, servlets, schedulers, workflow

Interview Preparation Tips

Interview preparation tips for other job seekers - The overall interview process was smooth and as per schedule.

Interview Questionnaire 

1 Question

  • Q1. Different sprint ceremonies
  • Ans. 

    Sprint ceremonies are meetings held during a sprint to facilitate communication and collaboration within the team.

    • Sprint planning: where the team plans the work to be done in the upcoming sprint

    • Daily stand-up: a brief meeting where team members share progress and discuss any obstacles

    • Sprint review: a meeting where the team demonstrates the work completed during the sprint

    • Sprint retrospective: a meeting where the team r...

  • Answered by AI

Skills evaluated in this interview

I applied via Naukri.com and was interviewed in May 2021. There were 3 interview rounds.

Interview Questionnaire 

1 Question

  • Q1. Java Basics,Cloud Basics,simple level codes,API related question

Interview Preparation Tips

Interview preparation tips for other job seekers - Keep the basics clear, OOPS DS concepts,REST API Concepts will help

I applied via Naukri.com and was interviewed in Sep 2021. There was 1 interview round.

Interview Questionnaire 

1 Question

  • Q1. SQL, Cloud, Power BI,

Interview Preparation Tips

Interview preparation tips for other job seekers - Interview process was very nice.
Are these interview questions helpful?
Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
2-4 weeks
Result
Selected Selected

I applied via Campus Placement and was interviewed before Jan 2022. There were 3 interview rounds.

Round 1 - Resume Shortlist 
Pro Tip by AmbitionBox:
Don’t add your photo or details such as gender, age, and address in your resume. These details do not add any value.
View all tips
Round 2 - Technical 

(1 Question)

  • Q1. There is mcq test, where all the question are from devops perspective like Jenkins, git, maven etc.,
Round 3 - One-on-one 

(1 Question)

  • Q1. As I'm interested in java they asked some java based questions and some aptitude questions

Interview Preparation Tips

Interview preparation tips for other job seekers - Try concentrating on java because mule works on java, having maven knowledge is an add on.

I applied via Naukri.com and was interviewed in May 2021. There were 4 interview rounds.

Interview Questionnaire 

1 Question

  • Q1. Basic Java questions

Interview Preparation Tips

Interview preparation tips for other job seekers - They have asked basic Java questions and MySQL questions

Interview Questionnaire 

1 Question

  • Q1. Oops concept,Versioning in javascipt,CTE in sql server,Cursor in sql server,scenario based questions like if duplicate data is stored in email then what is your approach to resolve.

Tell us how to improve this page.

Join PubMatic THE SUPPLY CHAIN OF THE FUTURE.BUILT FOR YOU.

Interview Questions from Similar Companies

Apisero Interview Questions
4.3
 • 66 Interviews
TestingXperts Interview Questions
3.9
 • 41 Interviews
Credera Interview Questions
3.7
 • 41 Interviews
Damco Solutions Interview Questions
3.8
 • 40 Interviews
Simform Interview Questions
3.4
 • 37 Interviews
Stefanini Interview Questions
3.0
 • 36 Interviews
View all
Softwaretest Engineer
102 salaries
unlock blur

₹3.4 L/yr - ₹5.1 L/yr

Senior Software Engineer
98 salaries
unlock blur

₹12 L/yr - ₹42 L/yr

Software Engineer
82 salaries
unlock blur

₹11.6 L/yr - ₹20.8 L/yr

Principal Software Engineer
52 salaries
unlock blur

₹19 L/yr - ₹51 L/yr

QA Engineer
27 salaries
unlock blur

₹3.5 L/yr - ₹4.9 L/yr

Explore more salaries
Compare PubMatic with

Tekwissen

4.8
Compare

Damco Solutions

3.8
Compare

smartData Enterprises

3.3
Compare

In Time Tec Visionsoft

3.7
Compare
write
Share an Interview