Summary
I recently interviewed for a Java Developer position at Pubmatic in Pune, which involved three distinct rounds focusing on Data Structures & Algorithms, Core Java, Spring Boot, and System Design principles.
Full Experience
Round 1
This round primarily focused on a mix of Data Structures & Algorithms and core Java/Spring Boot concepts. I was given two DSA questions to solve:
- Rotate array at index k
- Find a loop in a linked list
Following the DSA problems, the discussion shifted to various theoretical topics including:
- Explaining the Spring MVC architecture
- Strategies for scaling my current project to handle a million users
- Concepts related to Java Streams
- Principles of Object-Oriented Programming (OOPS)
- Understanding Indexing in Databases
- Several resume-based questions to delve into my past work.
Round 2
The second round continued with a DSA question, then delved deeper into Java and Spring topics.
- I was asked to find the winner in a Tic Tac Toe board of NxN size, which required careful handling of edge cases and general board traversal.
The discussion then moved to advanced Java and Spring concepts:
- Multithreading, specifically how to avoid race conditions and various implementation approaches.
- The different scopes of beans in Spring.
- The Singleton design pattern.
- Detailed questions about Indexing and B-trees in databases.
- Implementing Depth-First Search (DFS) using pseudocode.
- Concepts surrounding Anomaly Detection.
- Explaining the Diamond Problem in Java and its implications.
Round 3
The final round was heavily focused on design and scaling, along with project discussions.
- I had to perform a Low-Level Design (LLD) for a Snake and Ladder game, detailing the classes and interactions.
- The discussion revisited how I would scale a system to accommodate a million users.
- There were extensive Project Q&A sessions, where I had to explain my past projects in detail.
- Finally, there was a general discussion about Generative AI (GenAI).
Interview Questions (17)
Given an array, rotate the array to the right by k steps, where k is non-negative. For example, if array is [1,2,3,4,5,6,7] and k=3, the output should be [5,6,7,1,2,3,4].
Given the head of a singly linked list, determine if it has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer.
Describe the architecture of the Spring Model-View-Controller (MVC) framework, including its core components like DispatcherServlet, Controller, Model, View, and View Resolver, and how they interact to handle a web request.
Discuss strategies and architectural considerations for scaling a web application or project to effectively handle a workload of a million concurrent users. Cover aspects like load balancing, database scaling, caching, microservices, etc.
Explain the concept of Java Streams API introduced in Java 8. Discuss its features, common operations (filter, map, reduce), intermediate and terminal operations, and benefits over traditional collections processing.
Explain the fundamental principles of Object-Oriented Programming (OOPS): Encapsulation, Inheritance, Polymorphism, and Abstraction. Provide real-world examples or code snippets to illustrate each concept.
Explain what database indexing is, why it's used, and how it improves query performance. Discuss different types of indexes (e.g., clustered vs. non-clustered) and their trade-offs.
Given a completed Tic Tac Toe board of size NxN, determine if there is a winner. A winner is defined as N consecutive marks (either 'X' or 'O') in any row, column, or diagonal.
Explain multithreading in Java, including how threads are created and managed. Discuss the concept of a race condition, how it occurs, and various mechanisms (e.g., synchronized blocks, locks, volatile keyword) to prevent or handle them.
Explain the different bean scopes available in the Spring Framework (e.g., singleton, prototype, request, session, global session, application, websocket) and when to use each.
Explain the Singleton design pattern, its purpose, and provide a Java implementation. Discuss common challenges (e.g., thread safety, reflection, serialization) and ways to address them.
Explain the concept of B-trees and B+ trees, and how they are fundamental data structures used for indexing in most relational databases. Discuss their advantages in disk-based storage and query performance.
Provide pseudocode or a high-level explanation for implementing the Depth-First Search (DFS) algorithm for traversing a graph or tree. Discuss its typical applications.
Discuss the basic concepts of anomaly detection. What are anomalies, why is their detection important, and what are some general approaches or techniques (e.g., statistical, machine learning-based) used to identify them?
Explain the 'Diamond Problem' in the context of multiple inheritance and how Java addresses this issue, particularly with interfaces and default methods.
Design the core components and interactions for a Snake and Ladder game. This includes designing classes for Player, Board, Dice, Snake, Ladder, and the Game itself, along with their attributes and methods.
Discuss strategies and architectural considerations for scaling a web application or project to effectively handle a workload of a million concurrent users. Cover aspects like load balancing, database scaling, caching, microservices, etc. (Asked again in a different round).
Summary
I applied for an Intern/FTE role at PubMatic in Pune, undergoing a multi-stage interview process including a screening round, two technical rounds focusing on data structures and algorithms, and a final HR round, ultimately leading to an offer.
Full Experience
I applied for the Intern + FTE role at PubMatic through a job opening link I found in a Telegram group that regularly posts about job opportunities. The initial stage was a Screening Round, which comprised three coding questions along with multiple-choice questions on C/C++.
After successfully clearing the screening round, I progressed to the interview phase. This consisted of two technical rounds and a subsequent HR round. Both technical rounds were conducted on the same day, each lasting approximately 90-95 minutes.
Round 1
During this round, I was first asked to explain the internal implementation of a Min Heap data structure and then tasked with coding it from scratch. Following that, I was given a problem to implement Pascal's triangle.
Round 2
This round also spanned about 90-95 minutes. The core problem statement was: "Suppose we are given an incoming list of billions of names. The objective is to determine the frequency of each name and then sort these names in ascending order of their frequencies. A crucial constraint was that the use of the Standard Template Library (STL) was strictly prohibited (I was using C++ for my solution). This question also incorporated OOPS-based concepts alongside the implementation."
A few days after completing the technical rounds, I was informed about the results and then proceeded to the final HR round.
Interview Questions (2)
Implement a function to generate Pascal's triangle up to a given number of rows.
Given an incoming stream or list containing billions of names, determine the frequency of each name and then sort the names in ascending order based on their frequencies. The use of Standard Template Library (STL) is not permitted. This question involved OOPS concepts and custom implementation.