Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Housing.com interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Housing.com
upvote
share-icon
2 rounds | 2 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, DBMS, OS, Dynamic Programming, Recursion
Tip
Tip

Tip 1 : Solve questions on various topics from leetcode, gfg
Tip 2 : make at least 2 good projects based on any tech stack

Application process
Where: Campus
Eligibility: 70% throughout (X, XII, B. Tech)
Resume Tip
Resume tip

Tip 1 : Try to make your resume closest to the job you wish to apply for (i.e., mention relevant skills)
Tip 2 : Be thorough with the projects and tech stack you mention in your resume

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date24 Mar 2021
Coding problem1

1. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
MicrosoftAmazonApple

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    step 1 : took a queue and stores positions of all rotten oranges along with time 0
    step 2 : pop elements from queue one by one and push positions of all good oranges in contact with current postion and increase time +1
    step 3 : repeat above step until the queue is empty

    Try solving now
    02
    Round
    Medium
    Video Call
    Duration60 minutes
    Interview date30 Mar 2021
    Coding problem1

    1. Find Permutation

    Moderate
    25m average time
    65% success
    0/80
    Asked in companies
    FacebookOlaJP Morgan

    You are given an integer ‘N’. You need to find an array of size 2*N that satisfies the following two conditions.

    1. All numbers from 1 to N should appear exactly twice in the array.

    2. The distance between the second occurrence and the first occurrence of any number should exactly be equal to the value of that number.

    The distance between two numbers at indices ‘i’ and ‘j’ is defined as (j-i-1) where i < j.

    If no such array exists, then you should return an empty array.

    For example :
    For N = 3 one valid array is [3,1,2,1,3,2].
    
    Problem approach

    step 1 : after few hints I gave an approach using hashmap, i stored all the possible pairs of random numbers (1,1), (1,2)....(n,n) in a map.
    step 2 : I was asked to optimise the above approach
    step 3 : I was able to come up with a mathematical formula to compute random number in O(1) time complexity

    Try solving now

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    What is the index number of the last element of an array with 9 elements?

    Choose another skill to practice
    Join the Discussion
    1 reply
    kamana veera venkata satyanarayana 21 Oct, 2023

    This Comment was removed by the moderator

    This comment won't show up to you, as it was removed by moderator due to inappropriate content.

    Similar interview experiences
    company logo
    Frontend Engineer
    3 rounds | 8 problems
    Interviewed by Housing.com
    1024 views
    0 comments
    0 upvotes
    company logo
    Software Engineer
    3 rounds | 5 problems
    Interviewed by Housing.com
    872 views
    0 comments
    0 upvotes
    company logo
    Software Engineer
    3 rounds | 8 problems
    Interviewed by Housing.com
    840 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 4 problems
    Interviewed by Housing.com
    920 views
    1 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - Intern
    3 rounds | 6 problems
    Interviewed by Amazon
    13529 views
    4 comments
    0 upvotes
    company logo
    SDE - Intern
    4 rounds | 7 problems
    Interviewed by Microsoft
    12658 views
    1 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 4 problems
    Interviewed by Amazon
    9006 views
    2 comments
    0 upvotes