BharatPe | SDE1 | Hiring Event - MAY 2022 | Rejected
Anonymous User
1623

YOE - 1.4 Years

I applied through a hiring drive post which was conducted on May 7th 2022. I was shortlisted after resume screening and the recruiter reached out to me 2 days before the drive.

Date : May 7th, 2022
First Round -
Q1: Given a nested hashmap and a string of keys separated by delimeter, return the object found at the end of the string if it exists in map or else return null. (Difficulty level - LC-Easy)

public class Main {
    public static void main(String[] args) {
        int c = 12;
        HashMap b = new HashMap();
        b.put("c", c);
        HashMap a = new HashMap();
        a.put("b", b);
        HashMap obj = new HashMap();
        obj.put("a", a);

        // System.out.println(obj);
        // obj = {
        //     a: {
        //         b: {
        //             c: 12
        //         }
        //     }
        // };


        System.out.println(findPath(obj, "a:b:c")); // 12
        System.out.println(findPath(obj, "a:b")); // {c: 12}
        System.out.println(findPath(obj, "a:b:d")); // null
        System.out.println(findPath(obj, "a:c")); // null
        System.out.println(findPath(obj, "a:b:c:d")); // null
        System.out.println(findPath(obj, "a:b:c:d:e")); // null

    }

    public static Object findPath(HashMap obj, String path) {
        // Complete the function
    }
}

Q2: Given a database schema for student and city, asked to write the query to find all the cities and the count of students in that city.

-- Problem Statement:
-- We are running an online classroom. Students sign up on
-- our platform. During sign up, they provide us their name
-- and the city they come from. Providing city is optional, so
-- some students do not provide that. Our database schema is
-- as follows.

-- We need to write SQL query to find out how many students
-- we have from each city. The report should have two
-- columns - the left column should have the name of the city
-- and the right column should have the number of students
-- from each city.

-- Expected output (order of rows does not matter):
-- Delhi  2
-- Jaipur 1
-- Patna  3
-- null   3


CREATE TABLE city (
  id INTEGER NOT NULL PRIMARY KEY,
  name VARCHAR(100) NOT NULL
);


CREATE TABLE student (
  id INTEGER NOT NULL PRIMARY KEY,
  name vARCHAR(100) NOT NULL,
  city_id INTEGER,
  FOREIGN KEY (city_id) REFERENCES city(id)
);


INSERT INTO city
(id, name)
VALUES
(1, 'Delhi'),
(2, 'Jaipur'),
(3, 'Patna'),
(4, 'Pune');

INSERT INTO student
(id, name, city_id)
VALUES
(1, 'Ravi',    1),
(2, 'Rames',    1),
(3, 'Shubham', 2),
(4, 'Mansi',   null),
(5, 'Rachna',  3),
(6, 'Mohit',   3),
(7, 'Ankita',  null),
(8, 'Anshul',  3),
(9, 'Sanchit', null);

Got a call on the same day that I cleared the first round and will be informed when they'll be conducting the second round.

Date : May 10th, 2022
Second Round -
This round was conducted by an egineering manager in one of their POS team.

  • Asked me to introduce myself and tell about my past experience and what does my day look like at my current company.
  • Questions about Java, Spring Boot, Hibernate
  • What happens when you enter a domain, how the call reaches the server and how the result is returned from server
  • I was asked to do a low level design of an alert system, which runs every 5 or 10 mins interval and check for failed APIs in between that interval and generates an email alert basis that. I was able to design the database schema and structures for it along with method calls which will happen and how it will work but he interrupted and stopped me in between.
  • Given two schemas of Photos and Comments, in which a photo can have multiple comments, write a SQL query to fetch the count of comments for each photo
  • Puzzel question which looked like below
    You are given Rs 500/- and you're feeling very hungry and you have two pizza offers as below, which one will you choose 
    - Either 2 Pizza of 7 inches each
    - One Pizza of 10 inches
  • At last, one DS question - Detect loop in a linkedlist

I believe the reason for my rejection can only be because of the LLD question which he asked, because for all of the remaining ones, I gave the right solution. The LLD question has one extra requirement, that was of retrying the failed APIs for which I suggested a costly approach which I realised later.

Got a call after 5 days from HR that they are not moving forward with me. I asked for the feedback to which she told that this was a very big hiring drive so the feedbacks are not collated at the moment.

Do upvote if you guys find it helpful!!

Comments (2)