Upload Button Icon Add office photos
Engaged 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

Compare button icon Compare button icon Compare
4.1

based on 108 Reviews

Filter interviews by

PubMatic SDE-2 Interview Questions, Process, and Tips

Updated 16 Sep 2021

PubMatic SDE-2 Interview Experiences

1 interview found

SDE-2 Interview Questions & Answers

user image CodingNinjas

posted on 16 Sep 2021

I was interviewed 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

    You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to print the zigzag traversal of the given tree.

    Note:
    In zigzag ord...
  • Ans. Brute force

    We can use level order traversal (recursive) to explore all levels of the tree. Also, at each level nodes should be printed in alternating order. 

     

    For example - First level of tree should be printed in left to right manner, Second level of tree should be printed in right to left manner, Third again in left to right order and so on.

     

    So, we will use a Direction variable whose value will toggle a...

  • Answered by CodingNinjas
  • Q2. Convert binary tree to mirror tree

    Given a binary tree, convert this binary tree into its mirror tree.

    A binary tree is a tree in which each parent node has at most two children.

    Mirror of a Tree: Mirr...

  • Ans. Recursive approach.

    The idea is to traverse the binary tree and swap the left and right subtrees.

     

    The steps are as follows:

     

    1. Call mirror function as mirror(node->left)  to access the left subtree.
    2. Call mirror function as mirror(node->right) to access the right subtree.
    3. Swap left and right subtrees using:
    • ‘TEMP’ = leftSubtree
    • leftSubtree = rightSubtree
    • rightSubtree = ‘TEMP’
    Space Complexity: O(n)Explanation...
  • Answered by CodingNinjas
  • Q3. Time to Burn Tree

    You have been given a binary tree of 'N' unique nodes and a Start node from where the tree will start to burn. Given that the Start node will always exist in the tree, your task i...

  • Ans. Using BFS

    The idea is to first create an undirected graph of the given binary tree and then doing a bfs traversal of the undirected graph starting from the start node. We will keep a variable ‘count’ that will be incremented at each level of bfs traversal. ‘count-1’ is the required time needed to burn the whole tree.

     

    Algorithm

     

    • Initialize an unordered map ‘M’ that maps from integer to array of integers that sto...
  • Answered by CodingNinjas
Round 2 - Video Call 

(2 Questions)

Round duration - 90 Minutes
Round difficulty - Medium

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

  • Q1. Technical Questions

    Started off by asking Java Fundamentals, OOPS,DesignPatters(Singleton,Factory,Cascade), HashMap Internals,Collections, Fail Fast-Fail Safe Iterators
    Then jumped off to Problem Solving - E...

  • Q2. Topological Sort

    A Directed Acyclic Graph (DAG) is a directed graph that contains no cycles.

    Topological Sorting of DAG is a linear ordering of vertices such that for every directed edge from vertex ‘u’...

  • Ans. Modify Depth First Search

    In the Depth First Search (DFS), we start from a vertex, we first print it and then recursively call DFS for its adjacent vertices. In topological sorting, we use a  stack. We don’t print the vertex immediately, we first recursively call topological sorting for all its adjacent vertices, then push it to a stack. Finally, print contents of the stack. Note that a vertex is pushed to stack on...

  • Answered by CodingNinjas
Round 3 - Video Call 

(2 Questions)

Round duration - 100 Minutes
Round difficulty - Hard

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

  • Q1. Technical Questions

    He took a deep dive into my resume and asked a lot of questions around my projects asking my roles and responsibilities in each project/product/team. Asked about Kadane's Algorithm.
    After...

  • Q2. Trailing Zeros in Factorial

    You are given an integer N, you need to find the number of trailing zeroes in N! (N factorial).

    Note:

    1. Trailing zeros in a number can be defined as the number of continuous...
  • Ans. Find the factorial of the number
    • Calculate the factorial of N.
    • Initialise FACT = 1 to store factorial of N, iterate 1 <= i <= N and do FACT = FACT * i.
    • Count the number of trailing zeroes in FACT. Initialise ZEROES = 0.
    • Repeatedly divide the FACT by 10, if the remainder is 0, increase ZEROES by 1. If the remainder > 0, stop and return ZEROES.
    Space Complexity: O(1)Explanation:

    O(1), as we are using constant extra m...

  • Answered by CodingNinjas
Round 4 - Video Call 

(1 Question)

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
 

  • Q1. Technical Questions

    Question 1 : A scenario/story where Bitonic Sequence was to be implemented.
    Question 2 : Design a Scheduler for scheduling n jobs with input give at the runtime , input can be t...

Round 5 - Video Call 

(3 Questions)

Round duration - 90 Miinutes
Round difficulty - Medium

Discussion with Hiring Manager
 

  • Q1. Basic HR Questions

    My Aspirations, Problems I have solved, How do I motivate myself, Disappointment faced, Situations where your solution was accepted other than your peers and How did you convince the mana...

  • Q2. Technical Questions

    Deep-Discussion on my projects , My Approach on there use cases /or the problem they were facing , Questions on Spark(Broadcast Join Scenario), Questions on Mapreduce (Scenario Based)
    Que...

  • Q3. Loot Houses

    A thief wants to loot houses. He knows the amount of money in each house. He cannot loot two consecutive houses. Find the maximum amount of money he can loot.

    Input Format :
    The first line of...
  • Ans. Recursive Approach

    Suppose that the robber is at the ith house. The robber has two options:

    • If he decides to rob this house, then he cannot rob the next house, so he’ll have to go to the house after that.
    • If he decides not to rob this house, he has no restriction over choosing the next house.

    You will follow the same for the rest of the houses. Thus, if maxLoot(i) is the maximum loot possible when we’re at the ith house, t...

  • Answered by CodingNinjas
Round 6 - Video Call 

(2 Questions)

Round duration - 75 Minutes
Round difficulty - Easy

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

  • Q1. Basic HR Questions

    Manager Relationships, Difficult problem solved, Normal day routine, How do I manage a stressful situaiton, Leadership skills, Why I want to join there company, What will happen If I get ...

  • Q2. Technical Questions

    Discussion on my resume, Work exp, Team Size, Duration of Projects, Counter Question: Why did you switch 2 companies with your experience and why do you want to switch and come here(Desp...

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

Interview questions from similar companies

Interview experience
1
Bad
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Aptitude Test 

Easy level test can be cleared

Round 2 - Technical 

(2 Questions)

  • Q1. Fibonacci sequence print
  • Q2. Tell me about my self

I applied via Referral and was interviewed in Jan 2022. There were 2 interview rounds.

Round 1 - Coding Test 

2 coding ques easy - medium level

Round 2 - Technical 

(1 Question)

  • Q1. Merge intervals, find second largest salary in sql
  • Ans. 

    Merge intervals and find second largest salary in SQL

    • For merging intervals, sort them by start time and then iterate through the intervals to merge overlapping ones

    • For finding second largest salary, use the SQL query: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees)

  • Answered by AI

Interview Preparation Tips

Topics to prepare for MongoDB SDE (Software Development Engineer) interview:
  • DSA
Interview preparation tips for other job seekers - Be calm, have a smile on your face, do as many questions as you can on different platforms

Skills evaluated in this interview

Tell us how to improve this page.

Interview Questions from Similar Companies

Globant Interview Questions
3.9
 • 162 Interviews
Grey Orange Interview Questions
3.2
 • 36 Interviews
InMobi Interview Questions
3.6
 • 34 Interviews
Mobileum Interview Questions
3.3
 • 34 Interviews
CodeClouds Interview Questions
4.5
 • 33 Interviews
View all
Softwaretest Engineer
102 salaries
unlock blur

₹3.4 L/yr - ₹5.1 L/yr

Software Engineer
83 salaries
unlock blur

₹7 L/yr - ₹27 L/yr

Senior Software Engineer
70 salaries
unlock blur

₹15.2 L/yr - ₹39.1 L/yr

Principal Software Engineer
40 salaries
unlock blur

₹19.5 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

InMobi

3.6
Compare

Komli Media

4.0
Compare

Adcolony

5.0
Compare

Affle

3.0
Compare

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Did you find this page helpful?
Yes No
write
Share an Interview