Add office photos
Engaged Employer

PubMatic

4.0
based on 111 Reviews
Filter interviews by

30+ Annapoorna Mithai Interview Questions and Answers

Updated 19 Nov 2024

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 that the f...read more

Add your answer

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 of test c...read more
Add your answer

Q3. Which coding language do you prefer and why?

Ans.

I prefer Python because of its simplicity, readability, and extensive libraries.

  • Python is known for its simplicity and readability, making it easier to write and understand code.

  • Python has a large number of libraries and frameworks that can be used to quickly develop applications.

  • Python's syntax is clean and concise, allowing for faster development and easier maintenance.

  • Python is widely used in various domains such as web development, data analysis, and machine learning.

  • Pyth...read more

Add your answer

Q4. 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 burn th...read more

Add your answer
Discover Annapoorna Mithai interview dos and don'ts from real experiences

Q5. 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. Determine the...read more

Add your answer

Q6. 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 followi...read more
Add your answer
Are these interview questions helpful?

Q7. What if person mistakenly put F for male and M for female in sql how do you solve this

Ans.

To solve the issue of mistakenly assigned gender values in SQL, you can update the incorrect values using SQL queries.

  • Identify the incorrect gender values in the SQL table

  • Use UPDATE statement with appropriate conditions to correct the values

  • For example, if 'F' is mistakenly assigned for male, update it to 'M' using UPDATE statement

View 1 answer

Q8. 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 repr...read more

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. write a code using multithreading to scan 3 log files for different patterns and write the matches in a o/p file. these log files are huge, so code should not leave a huge memory foot print

Ans.

Code using multithreading to scan 3 log files for different patterns and write matches in o/p file with low memory footprint.

  • Use Python's threading module to create multiple threads for each log file

  • Use regex to search for patterns in each log file

  • Write matches to output file using a thread-safe queue

  • Use a memory-efficient data structure like deque to store log file lines

Add your answer

Q10. how can you simulate 1 user profile to another user

Ans.

Simulating one user profile to another can be done through user impersonation.

  • User impersonation can be achieved through various tools and techniques.

  • One way is to use a proxy server to intercept and modify the user's requests and responses.

  • Another way is to use a browser extension or plugin that allows you to switch between user profiles.

  • You can also use a testing tool like Selenium to automate the process of switching between user profiles.

  • It's important to ensure that the ...read more

Add your answer

Q11. write a code that should run as a service to scan every 30 sec to get min, max and avg CPU/memory and also calculate moving avg of last 300 sec.

Ans.

Code to run as a service to scan CPU/memory every 30 sec and calculate min, max, avg and moving avg of last 300 sec.

  • Use a loop to run the code every 30 sec

  • Use psutil library to get CPU/memory usage

  • Store the values in a list and calculate min, max, avg and moving avg using numpy library

  • Use threading to run the code in the background as a service

Add your answer

Q12. Count the occurances a purticualar word from a file.

Ans.

Count the occurrences of a particular word from a file.

  • Read the file and store its contents in a string variable.

  • Split the string into an array of words using a delimiter.

  • Loop through the array and count the occurrences of the particular word.

  • Return the count.

Add your answer

Q13. what is multiprocessing and multi threading

Ans.

Multiprocessing is the use of multiple processors to execute multiple tasks simultaneously. Multithreading is the use of multiple threads within a single process to execute multiple tasks simultaneously.

  • Multiprocessing involves the use of multiple processors or cores to execute multiple tasks simultaneously.

  • Multithreading involves the use of multiple threads within a single process to execute multiple tasks simultaneously.

  • Multiprocessing is typically used for CPU-intensive ta...read more

Add your answer

Q14. Optimize an existing system. The system currently makes an API call and stores data in its memory. When it tries to serve a request from another component it refers to the memory location by searching the entir...

read more
Ans.

Implement a data structure like a hash table or a cache to optimize memory search.

  • Use a hash table to store the data with keys as memory locations

  • Implement a cache to store frequently accessed data for faster retrieval

  • Consider using indexing or sorting techniques to optimize search operations

Add your answer

Q15. Write a code in c c++ or any other language to validate all use cases for an ip address given as input string. Output will be yes or no.

Ans.

Code to validate all use cases for an IP address input string and output yes or no.

  • Use regular expressions to match the input string against the valid IP address pattern.

  • Check for valid ranges of each octet (0-255) and proper formatting (4 octets separated by periods).

  • Handle edge cases like leading zeros, extra spaces, and invalid characters.

  • Return 'yes' if the input string is a valid IP address, otherwise return 'no'.

Add your answer

Q16. Have you used fluient wait in selenium and why we are not using mostly

Ans.

Fluent wait in Selenium is used for handling dynamic elements and synchronization issues.

  • Fluent wait is used to wait for a condition to be true before proceeding with the next steps in Selenium automation scripts.

  • It provides more flexibility in defining wait conditions compared to implicit or explicit waits.

  • Fluent wait can be used to wait for a specific element to be visible, clickable, or any other custom condition.

  • It is not used as frequently because it can lead to longer e...read more

Add your answer

Q17. find the number of pairs which sum to target.

Ans.

Count pairs in an array that sum up to a target value.

  • Iterate through the array and store the frequency of each element in a hashmap.

  • For each element, check if the difference between the target and the element exists in the hashmap.

  • Increment the count of pairs if the difference is found in the hashmap.

Add your answer

Q18. Given 2 sorted integer array print the common value between them. 2 to 3 optimized ways.

Ans.

Find common values in two sorted integer arrays efficiently.

  • Use two pointers approach to iterate through both arrays simultaneously.

  • If the current values are equal, add it to the result and move both pointers forward.

  • If the current values are not equal, move the pointer of the array with the smaller value forward.

Add your answer

Q19. Data structure with code writing

Ans.

Implement a stack data structure using an array of strings.

  • Use an array to store the strings in the stack.

  • Implement push() and pop() functions to add and remove elements from the stack.

  • Keep track of the top of the stack using a variable.

Add your answer

Q20. Binary search moderate problems of array ones increasing then decreasing

Ans.

Binary search can be used to solve moderate problems of arrays that are first increasing and then decreasing.

  • Use binary search to find the peak element in the array, which marks the transition from increasing to decreasing.

  • Divide the array into two parts based on the peak element and apply binary search on each part separately.

  • Handle edge cases such as when the array is strictly increasing or strictly decreasing.

  • Example: ['1', '3', '5', '7', '6', '4', '2']

Add your answer

Q21. what is bashrc .profile file

Ans.

bashrc and .profile are configuration files for the Bash shell in Linux/Unix systems.

  • bashrc is executed for every new interactive shell session

  • .profile is executed only once during login

  • They contain environment variables, aliases, and other shell settings

  • bashrc is typically used for user-specific settings, while .profile is system-wide

  • Examples: setting PATH variable, defining aliases, setting prompt

Add your answer

Q22. smallest subarray having given target sum

Ans.

Find the smallest subarray in an array that has a given target sum.

  • Use a sliding window approach to find the subarray with the target sum.

  • Keep track of the current sum of elements in the window and adjust the window size accordingly.

  • Start with a window of size 1 and expand it until the sum is greater than or equal to the target sum.

  • Shrink the window from the left side while updating the smallest subarray length until the sum is less than the target sum.

Add your answer

Q23. How to get all the links available in the page

Ans.

To get all the links available on a page, you can use web scraping techniques.

Add your answer

Q24. 1. longest path from node to node in tree

Ans.

The longest path from one node to another in a tree is the maximum number of edges that must be traversed to reach from one node to another.

  • The longest path in a tree is also known as the diameter of the tree.

  • The diameter of a tree can be found by first finding the farthest leaf node from any arbitrary node, and then finding the farthest leaf node from that leaf node.

  • The sum of the distances from the root to the farthest leaf nodes in both subtrees of the root gives the diame...read more

Add your answer

Q25. Loop in kinked list

Ans.

Detecting a loop in a linked list

  • Use two pointers, one moving at double the speed of the other

  • If there is a loop, the two pointers will eventually meet

  • Use Floyd's Cycle Detection Algorithm for efficient solution

Add your answer

Q26. system design for a web surfing utility

Ans.

Design a system for a web surfing utility

  • Use a web crawler to gather data from websites

  • Implement a search engine to retrieve relevant information

  • Utilize a recommendation system to suggest related content

  • Include user authentication and personalized settings

  • Ensure scalability and performance for handling large amounts of data

Add your answer

Q27. What is Apache Kafka?

Ans.

Apache Kafka is a distributed streaming platform used for building real-time data pipelines and streaming applications.

  • Apache Kafka is designed to handle high-throughput, fault-tolerant, and scalable real-time data streams.

  • It allows for the publishing and subscribing to streams of records, similar to a message queue.

  • Kafka is often used for log aggregation, stream processing, event sourcing, and real-time analytics.

  • It provides durability and fault tolerance through replication...read more

Add your answer

Q28. Java code for reverse string without split

Ans.

Java code to reverse a string without using split method

  • Create a char array from the input string

  • Use two pointers to swap characters from start and end of the array

  • Continue swapping until the pointers meet in the middle

Add your answer

Q29. Count number of digits

Ans.

Count the number of digits in a given string

  • Iterate through each character in the string

  • Check if the character is a digit using isdigit() function

  • Increment a counter if the character is a digit

  • Return the final count of digits

Add your answer

Q30. Java coding for array duplicates

Ans.

Java code to find duplicates in an array of strings

  • Iterate through the array and use a HashSet to keep track of unique elements

  • If an element is already in the HashSet, it is a duplicate

  • Print or store the duplicates as needed

Add your answer

Q31. Sourcing for Java folks

Ans.

Utilize various sourcing methods to find qualified Java candidates

  • Utilize job boards like Indeed and LinkedIn to search for Java developers

  • Attend Java meetups and conferences to network with potential candidates

  • Utilize social media platforms like Twitter and GitHub to find Java developers

  • Partner with coding bootcamps and universities to find recent Java graduates

Add your answer

Q32. Designing of chess

Ans.

Designing a chess game involves creating a board with 64 squares, defining the movement rules for each piece, implementing game logic, and designing a user interface.

  • Create a 8x8 board with alternating colors for squares

  • Define movement rules for each type of chess piece (pawn, rook, knight, bishop, queen, king)

  • Implement game logic for capturing pieces, checkmate, stalemate

  • Design a user interface for players to interact with the game

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Annapoorna Mithai

based on 21 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.9
 • 536 Interview Questions
4.0
 • 471 Interview Questions
4.1
 • 266 Interview Questions
4.1
 • 206 Interview Questions
3.9
 • 202 Interview Questions
4.1
 • 141 Interview Questions
View all
Top PubMatic Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter