Chegg Inc. interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Chegg Inc.
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming, Data Science and Data Analytics
Tip
Tip

Tip 1 : Participate in live contests on online coding websites as much as possible.
Tip 2 : Practice previous interview questions from internet.
Tip 3 : Revise Computer Science subjects like DBMS, OOPS thoroughly.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Easy
Video Call
Duration45 minutes
Interview date30 Aug 2022
Coding problem3

1. Best Time to Buy and Sell Stock II

Moderate
22m average time
0/80
Asked in companies
FacebookOYOHCL Technologies

You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can make by buying and selling the stocks.

 Note :
You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.
Problem approach

You have been given the prices of 'N' stocks in an array where each array element represents the stock price for that day. You need to find the maximum profit which you can make by buying and selling the stocks. You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.

Try solving now

2. DBMS Questions

What is Normalization and tell its all forms(all 7 forms)?

Problem approach

Normalization is a database design technique that reduces data redundancy and eliminates undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules divides larger tables into smaller tables and links them using relationships. The purpose of Normalisation in SQL is to eliminate redundant (repetitive) data and ensure data is stored logically.
Here is a list of Normal Forms in SQL:

1NF (First Normal Form)
2NF (Second Normal Form)
3NF (Third Normal Form)
BCNF (Boyce-Codd Normal Form)
4NF (Fourth Normal Form)
5NF (Fifth Normal Form)
6NF (Sixth Normal Form)

3. Operating System Questions

What is semaphore in OS with example?

Problem approach

Semaphores are integer variables that are used to solve the critical section problem by using two atomic operations, wait and signal that are used for process synchronization. The definitions of wait and signal are as follows − Wait. The wait operation decrements the value of its argument S, if it is positive.

02
Round
Medium
Video Call
Duration45 minutes
Interview date30 Aug 2022
Coding problem2

1. Flatten Binary Tree to Linked List

Moderate
25m average time
70% success
0/80
Asked in companies
DunzoQuikrMakeMyTrip

You are given a binary tree consisting of 'n' nodes.


Convert the given binary tree into a linked list where the linked list nodes follow the same order as the pre-order traversal of the given binary tree.


Use the right pointer of the binary tree as the “next” pointer for the linked list and set the left pointer to NULL.


Use these nodes only. Do not create extra nodes.


Example :
Input: Let the binary be as shown in the figure:

Example Tree

Output: Linked List: 15 -> 40 -> 62 -> 10 -> 20 -> NULL

Explanation: As shown in the figure, the right child of every node points to the next node, while the left node points to null.

Also, the nodes are in the same order as the pre-order traversal of the binary tree.
Problem approach

You are given a binary tree consisting of integer values. Your task is to convert the given binary tree into a linked list where the nodes of the linked list follow the same order as the pre-order traversal of the given binary tree.
Note:
Use the right pointer of the binary tree as the “next” pointer for the linked list and set the left pointer to NULL.

Try solving now

2. System Design

Design a chess game

Problem approach

We need to clarify a bunch of things first, for example:

Do we need a graphical environment? It is totally possible to code the game with no graphics at all
Do we need an artificial intelligence machine or is it just going to be human to human?
Do we want to support network gaming (e.g, why not?)
Once all this has been clarified, we can dive into the problem.

This question can be modelled in great detail using object orientation, here is my approach, basic objects required are

Game: Stores the whole game
Movement: Stores each of the players movements
Piece abstract class represents each of the pieces
Coordinate each of the 64 squares in the chess game
Knight, Tower, Pawn... all the pieces are implementations of the abstract class Piece
Basic object design

Game 
String whitePlayer;
String blackPlayer;
boolean isBlackPlayerTurn();
boolean isWightePlayerTurn();
List

Movements:
String player;
String movement; // If you are a chess nerd, you will be familiar with stuff like "e4", "kf6" and so on :)
boolean goodMovement; // If you are familiar with chess, you know this is represented by "!"
boolean badMovement; // Again, if familiar with chess, this is represented by "?"

Piece (abstract):
String color; //Black white... we could consider an enum here
boolean alive;
boolean canMove; // In chess, sometimes a piece cannot be moved as it will be protecting the king.. that is called an illegal move, we will most likely raise a warning to the end user if he tries to do so.
List availableMovements; // All the places where a piece can move

PawnPiece (example concrete implementation):
List availableMovements; // Will need to implement this. 


Coordinate:
Char row; //From 1 to 8
Char column; // From a to h

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 recursion?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 7 problems
Interviewed by Chegg Inc.
1139 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Chegg Inc.
994 views
1 comments
0 upvotes
SDE - 1
3 rounds | 7 problems
Interviewed by Chegg Inc.
877 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Chegg Inc.
766 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114578 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57824 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34960 views
7 comments
0 upvotes