Open In App

Paytm Interview Experience (Java Backend developer)

Improve
Improve
Like Article
Like
Save
Share
Report

Round 1: 

There was an online round consisting of 4 sections and needs to be done in a span of 70 minutes.

  1. Data structure question : Find minimum number of swaps between adjacent characters in a string to convert into palindrome. If palindrome is not possible, return -1 and if string is already a palindrome, return 0. https://stackoverflow.com/questions/51796237/minimum-number-of-swaps-to-convert-a-string-to-palindrome
  2. Data structure MCQs : 13 Questions based on Heap, queue, b+ tree, sorting algorithm. A few questions were
    1. When will B+ tree leaf nodes will point to sibling node?
    2. Which property is true about red black tree?
    3. Given that stack is implemented with two queues and  a few push and pop operations given, how many enqueue and deque operations are done in total?
    4. Questions on MinHeap and MaxHeap.
  3. Java Based MCQs: 13 Questions related to Threads, classes, exceptions were mainly asked. A few questions were
    1. Which of the following is/are valid thread contructors.
    2. Two threads were created and run function containing a loop running 1000 times. Inside loop, there was synchronised to print two variables.Print expected output.
    3. One try/ catch question where arithmetic operation = 25/0 was mentioned in try block and this was followed by finally and then catch block with ArithmeticException handling and one statement after catch. Print expected output.
    4. Polymorphism question in which three functions with same name but different arguments such as string, Object and arraylist were made and a function call was made with NULL argument. We need to print expected output.
    5. Two question based on Yield and join function of threads.
  4. SQL Queries MCQs: 13 Queries based on insert operation, select queries with JOINs (natural join, left join, right join) and rollback datapoints.

Round 2: 

This round was a mix of data structures and low level design questions.

  1. Data structures questions :
    1. https://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/ 
    2. https://www.geeksforgeeks.org/zigzag-tree-traversal/
    3. Multiply two numbers without using ‘*’ and repetitive ‘+’ operators.(https://www.geeksforgeeks.org/russian-peasant-multiply-two-numbers-using-bitwise-operators/ )
    4. https://cs.stackexchange.com/questions/43073/fit-stack-of-stone-of-varying-length-into-a-well-of-varying-length
  2. Design Questions:
    1. Design low level diagram of system consisting of DataService class which will have three caches(C1, C2, C3). This class will have a function getData(id) which will internally calls C1. If data is not found in C1, it calls C2 and in case missing, in turn calls C3. Expected me to use Chain of Responsibility in Design Patterns.
    2. Why do we define (Spring boot) Beans as returning interface rather than implementations.I gave answer due to multiple strategy implementions for that interface. Strategy pattern.
    3. What is facade pattern. Explain with an example.
    4. Questions such what is inheritance, abstraction, local artifactory, pom.xml, maven, sharding.
    5. Difference between peek() and poll() method of queue in java

Round 3:

This round was mainly structured around design. Interviewer asked me to code classes in Java.

  1. Design logger class. They were looking for application of singleton design pattern in this class.
  2. Design a class for solving reader-writer problem using mutex locks in which multiple read operations and single write operation were allowed.
  3. Asked me difference about wait() and sleep() methods of Thread class.
  4. If you have one service say A and it’s dependent on service B. Due to some reason, there is failure in B service, what would you do in service A to cope with such situation.
  5. What is hashCode function and why do we need it. Which class does this function belong to.
  6. What is serialization and deserialization in Java.
  7. Create a custom annotation using spring boot framework Java.
  8. One data structure was also asked. https://www.geeksforgeeks.org/anagram-substring-search-search-permutations/

Last Updated : 25 Nov, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads