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

SDE - 1

Chegg Inc.
upvote
share-icon
3 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Journey
My personal journey is very challenging coming from a middle-class family, I need not have the access to a computer for a long time. I came to know about computer when i joined my college but from there I never looked back again.
Application story
This is an on-campus placement opportunity for me the company visited my campus for the placement .
Why selected/rejected for the role?
This was a great experience for me i was able to perform well, and i am satisfied with the effort i have put forward.
Preparation
Duration: 5 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Prepare your resume well. 
Tip 2 : Deploy your projects so that the interviewer can view it. Also provide a hyperlink on your resume.
Tip 3 : Be thorough with Data Structures and Algorithms. Also prepare well topics such as OS,DBMS.

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

Tip 1 : Deploy your projects so that the interviewer can view it. Also, provide a hyperlink on your resume
Tip 2 : It's not important to have fancy projects. Only mention those on which you're confident.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date16 Aug 2022
Coding problem2

1. Puzzle

Here are 10 stacks of 10 coins each.
Each coin weights 10 gms. However, one stack of coins is defective and each coin in that stack weights only 9 gms.

What is the minimum number of weights you need to take to find which stack is defective? How?

Problem approach

We will take,
1 coin from the first stack,
2 coins from the second,
3 from the third
and
so on.

In total we will have 55 coins.
If all of them were non-defective, they would weigh 550 gms.
If stack 1 is defective, the measure would read 549 gms.
If stack 2 is defective, you will read 548 gms.
and so on.

So by taking one measurement you can identify, which is the defective stack.

2. Next Smaller Element

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

You are given an array 'ARR' of integers of length N. Your task is to find the next smaller element for each of the array elements.

Next Smaller Element for an array element is the first element to the right of that element which has a value strictly smaller than that element.

If for any array element the next smaller element does not exist, you should print -1 for that array element.

For Example:

If the given array is [ 2, 3, 1], we need to return [1, 1, -1]. Because for  2, 1 is the Next Smaller element. For 3, 1 is the Next Smaller element and for 1, there is no next smaller element hence the answer for this element is -1.
Problem approach

You are given an array 'ARR' of integers of length N. Your task is to find the next smaller element for each of the array elements.
Next Smaller Element for an array element is the first element to the right of that element which has a value strictly smaller than that element.
If for any array element the next smaller element does not exist, you should print -1 for that array element.

Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date16 Aug 2022
Coding problem2

1. Best Time to Buy and Sell Stock

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

You are given an array/list 'prices' where the elements of the array represent the prices of the stock as they were yesterday and indices of the array represent minutes. Your task is to find and return the maximum profit you can make by buying and selling the stock. You can buy and sell the stock only once.

Note:

You can’t sell without buying first.
For Example:
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
Problem approach

Given chocolate and its prices change each day. Rahul can buy one chocolate at a time, and he must sell it before buying chocolate on another day.
To sell and buy the chocolate requires some transaction fee. Given 'N' number of days and an array 'PRICES' of size 'N' price of the chocolate each day. and variable 'FEE' fee for the transaction. Find the maximum profit Rahul can achieve by trading on the chocolate.

Try solving now

2. Arithmetic Expression Evaluation

Moderate
30m average time
70% success
0/80
Asked in companies
AdobeFacebookMicrosoft

You are given a string ‘expression’ consists of characters ‘+’, ‘-’, ‘*’, ‘/’, ‘(‘, ‘)’ and ‘0’ to ‘9’, that represents an Arithmetic Expression in Infix Notation. Your task is to evaluate this Arithmetic Expression.

In Infix Notation, operators are written in-between their operands.

Note :
1. We consider the ‘/’ operator as the floor division.

2. Operators ‘*’ and ‘/’ expression has higher precedence over operators‘+’ and ‘-’ 

3. String expression always starts with ‘(‘ and ends with ‘)’.

4. It is guaranteed that ‘expression’ represents’ a valid expression in Infix notation.

5. It is guaranteed that there will be no case that requires division by 0.

6. No characters other than those mentioned above are present in the string. 

7. It is guaranteed that the operands and final result will fit in a 32-bit integer.
For example :
Consider string ‘expression’ = ‘((2+3)*(5/2))’. 
Then it’s value after evaluation will be ((5)*(2)) = 10. 
Problem approach

You are given a string ‘expression’ consists of characters ‘+’, ‘-’, ‘*’, ‘/’, ‘(‘, ‘)’ and ‘0’ to ‘9’, that represents an Arithmetic Expression in Infix Notation. Your task is to evaluate this Arithmetic Expression.
In Infix Notation, operators are written in-between their operands

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date16 Aug 2022
Coding problem3

1. Technical Questions

What is the real life use of the projects I made?
Which technology is used for making projects and why?
Which framework is used to develop the project?
Explain the functionality of the project.

Problem approach

Tip 1 : Practice coding questions on a notepad before your interview
Tip 2 : Try to explain the concept before jumping to the solution
Tip 3 : Study your project deeply and make sure to know all the aspects of your project.

2. Check If The String Is A Palindrome

Easy
10m average time
90% success
0/40
Asked in companies
SprinklrCIS - Cyber InfrastructureSamsung

You are given a string 'S'. Your task is to check whether the string is palindrome or not. For checking palindrome, consider alphabets and numbers only and ignore the symbols and whitespaces.

Note :

String 'S' is NOT case sensitive.

Example :

Let S = “c1 O$d@eeD o1c”.
If we ignore the special characters, whitespaces and convert all uppercase letters to lowercase, we get S = “c1odeedo1c”, which is a palindrome. Hence, the given string is also a palindrome.
Problem approach

Given a string, determine if it is a palindrome, considering only alphanumeric characters.

Try solving now

3. Maximum Product Subarray

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

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.

For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3]. 
For Example:
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Follow Up:
Can you solve this in linear time and constant space complexity?
Problem approach

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

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

Choose another skill to practice
Similar interview experiences
SDE - 1
2 rounds | 5 problems
Interviewed by Chegg Inc.
1080 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Chegg Inc.
995 views
1 comments
0 upvotes
SDE - 1
3 rounds | 7 problems
Interviewed by Chegg Inc.
878 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Chegg Inc.
767 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes