GeeksforGeeks interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

GeeksforGeeks
upvote
share-icon
3 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Journey
I started my journey in coding by learning a basic programming language like C and some theoretical concepts and then I learned data structures in my college but not practiced it well and started focusing on GATE Exam after one year due to personal issues I have to left my GATE preparation and started again focusing on coding and I started writing code in python and practiced DSA and during in between I switched to C++ for solving problems. Till now I am doing questions randomly without focusing on the platform and along with I learned web development and made some good projects. And I finally became consistent in my last year and decided on only two platforms to code (i.e GFG and Leetcode ) along with revised core subjects and started looking for off-campus opportunities as I was from a Tier-3 college. At this time, I cracked some service-based companies but all are extending the date of joining.
Application story
I got this opportunity off-campus. I applied for this role via LinkedIn and after one month I got a call from HR the whole process took just one week.
Why selected/rejected for the role?
I was not a pro neither in development or coding. But I have maintained a great balance in both skills in my resume also my desire to learn. I think this makes me a fit candidate for SDE-1. In GFG, they focus on skills, and language of communication was never a barrier.
Preparation
Duration: 3 months
Topics: Data Structures and Algorithms, Database Management Systems, OOPs, Computer Networks, Web Development
Tip
Tip

Tip 1 : Being consistent is the key. Practice DSA questions daily and revised core concepts weekly 
Tip 2 : I personally recommend you Coding Ninjas and Geeks For Geeks for interview preparation.
Tip 3 : Be an active user of job platforms and started appearing in mock or real interviews for confidence without thinking about the level of your preparation

Application process
Where: Linkedin
Eligibility:
Resume Tip
Resume tip

Tip 1 : Make a one-page resume and add skills in which you are confident
Tip 2 : Mention at least two good projects and links to coding platforms
Tip 3 : Must read interview experiences before any interview

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 minutes
Interview date24 Aug 2023
Coding problem3

This was the DSA round. The interviewer asked 3 questions which are of medium level and asked upto optimal solution

1. Top View

Moderate
42m average time
61% success
0/80
Asked in companies
SamsungAdobeMakeMyTrip

Given a binary tree. Print the Top View of Binary Tree. Print the nodes from left to right order.

Example:
Input:

Alt text

Output: 2 35 2 10 2
Problem approach

Step 1 : Figure out how the tree will look after traversal and got the point that I have to do something like vertical order traversal
Step 2 : I do a level order traversal so that the topmost node at a horizontal node is visited before any other node of the same horizontal distance below it.
Step 3 : Hashing is used to check whether a node at a given horizontal distance is seen. 
Step 4 : I explained the whole approach and code

Try solving now

2. Ways to Arrange Balls

Hard
40m average time
50% success
0/120
Asked in companies
GeeksforGeeksTata Consultancy Services (TCS)Ford Motor Company

Given ‘a’ balls of type ‘A’, ‘b’ balls of type ‘B’ and ‘c’ balls of type ‘C’. You need to find the total number of ways to arrange the balls in a straight line such that adjacent balls are of different types.

In other words, find the total ways to arrange the given balls in such a way that no two balls of the same type are adjacent.

For Example :
Suppose we have 2 balls of type ‘A’, 1 ball of type ‘B’ and 1 ball of type ‘C’, following are the ways to arrange them in the required fashion. 
ABCA
ABAC 
ACBA 
ACAB 
BACA 
CABA 
Hence, there is a total of six ways.
Problem approach

Step 1 : Initially I read the problem and start thinking about two pointer approach
Step 2 : But after a few minutes I got to the point where I can treat balls as numbers (i.e 0, 1, 2) then I remembered the DNF algorithm
Step 3 : So I took three-pointers i.e low, high, and mid, and write code keeping in mind I save to store red -> white -> blue and applied DNF algo

Try solving now

3. Increasing Path In Matrix

Moderate
25m average time
75% success
0/80
Asked in companies
AppleGoogleJP Morgan

A graph problem-
Given N X N matrix filled with 1, 0, 2, 3. Find whether there is a path possible from source to destination, traversing through blank cells only. You can traverse up, down, right, and left. 

A value of cell 1 means Source.
A value of cell 2 means Destination.
A value of cell 3 means a Blank cell.
A value of cell 0 means Blank Wall.

Problem approach

Step 1 : He just asked for an approach to this question so I told him like that
Consider each cell as a node and each boundary between any two adjacent cells be an edge. so the total number of Nodes is N * N. So the idea is to do a breadth-first search from the starting cell till the ending cell is found.
Step 2 : Then he asked for time complexity

Try solving now
02
Round
Easy
Video Call
Duration40 minutes
Interview date25 Aug 2022
Coding problem2

It was a complete Database Round.

1. DBMS Question

Asked for 2-3 SQL Queries 
Query 1: Related to join of tables 
Query 2: Normalize the Resultant table of Query 1 and asked for some theoretical questions regardings Normalization, Acid Properties, etc.

Problem approach

Tip 1 : Practice SQL queries 
Tip 2 : Grasp theoretical concepts also

2. DBMS Question

Asked for Schema Design of LinkedIn

Problem approach

Tip 1 : Practice the design of the schema
Tip 2 : Well understanding of the keys in schema

03
Round
Hard
Face to Face
Duration40 minutes
Interview date29 Aug 2022
Coding problem3

Asked for almost everything that I mentioned in my resume

1. Rotate Linked List

Moderate
25m average time
65% success
0/80
Asked in companies
Morgan StanleyTata Consultancy Services (TCS)PharmEasy

You are given a linked list having ‘n’ nodes and an integer ‘k’.


You have to rotate the linked list to the right by ‘k’ positions .


Example :
Input: linked list = [1 2 3 4] , k = 2

Output: 3 4 1 2

Explanation:
We have to rotate the given linked list to the right 2 times. After rotating it to the right once it becomes 4->1->2->3. After rotating it to the right again, it becomes 3->4->1->2. 


Problem approach

1)Create a function for a single rotation
2)Take care of some edge cases
3)Simply make the value of k smaller: to avoid the repeated effect of rotation (k=k%n)
4)Since the function singleRotate() will rotate the list one time only so to rotate it k times call the function under a while loop which will be operated k-times
5)Return the head of the list

Try solving now

2. DBMS Questions

Schema Design for Instagram post

3. DBMS Question

Asked about web development theoretical concepts some remembered questions like ---- 
Q1: You have given n no. of articles and you have to change the color of the title in an alternate fashion in CSS
Q2: What happens when we hit google.com in browser?

Problem approach

Tip 1 : Well revised your skills and made some projects hands-on 
Tip 2 : Read the standard interview question

Here's your problem of the day

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

Skill covered: Programming

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by GeeksforGeeks
1428 views
0 comments
0 upvotes
company logo
Software Engineer
4 rounds | 6 problems
Interviewed by GeeksforGeeks
797 views
0 comments
0 upvotes
company logo
Intern
2 rounds | 3 problems
Interviewed by GeeksforGeeks
1200 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by GeeksforGeeks
787 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
107832 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
52129 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
32261 views
6 comments
0 upvotes