0% found this document useful (0 votes)
108 views

50 Days Coding

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

50 Days Coding

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

www.tutort.

net +91 87123 38901

Most Asked Coding Questions


50
in

Curated by

Can’t believe I made it into Google




! %$"#

-,)*+('&* 10/. AP(7(E,+<:O(:,+F*;(:,E'NH659D6LH9?5HK4>>B5HL3>5H3@H9?5HB4LI5>HB4M92

oP('&*l*(7l*('aA(_,;;:*(+A;*EN(l*'nl+(VR(+A;*k

pvtVV zƒ"|‚€~$"yƒx~‚€w



!t‘RRŽˆtv‡„v %$"#

-,)*+('&* ™˜˜— AP(7(²,+7lO('l**N(l*'nl+(49MHK£¡4KDKH>5›9?2

Ö(²,+7lO('l**½E(Rt‘RR(,E('&*(+n_²*l(AP(+A;*E(7:A+<('&¿

:A+<*E'(´7'&(PlA_('&*(lAA'(+A;*(;Aa+('A('&*(P7l'&*E'(:*7P(+A;*k

pvtVV zƒ"|‚€~$"yƒx~‚€w

ó‘VtvRvt‡vVâ‡åtvVtv‡ããv

ãVRvtvâvtRRâÚÙØtvvñVt

tRtØtV×åãVvt‡vVññtÚ
Question 3
Add Binary Easy

Given two binary strings a and b return their sum as a binary string. s

Practice Question asked in:

Question 4
Diameter of Binary Tree Easy

Given the root of a binary tree, return the length of the diameter of the tree.

The diameter of a binary tree is the length of the longest path between
any two nodes in a tree. This path may or may not pass through the root

Practice Question asked in:

From To
Anjali Joshi
Data Engineer - L2 at Twilio
ÆÅmÃk¿½
  
    &% (') ,+  ,652052021/2-53+  ;5207
@>=) 3GDC/F,6CA
N PORQTWOLRY
RRPO&WPbLLW%LLOLLJbLWbe
jlklm t{} v|yzx s}rx|zq

ÆÅmÃk¿Ç
ˆ~ml 
WR Œ'‰ ObOb&
 >() &R%bbO >()  Œ'‰ e “R >()
J&O%Je”O&% ¤£ e
´%Q%LOQO ·º=¸¶Œ» %QbQPLJWe

jlklm t{} v|yzx s}rx|zq




     

'%"#$! !%$& ( 97%57!51$%!1+!319#5 #!1!422#5 #!3##8


#4$!7#!3#$&7!1+!7#!31$&#!2 3%$>1=#!7 !5 $!;#!;4%3!9%7E
71#!3##@

]##! #!5 #!#$%%"#8!+1!#R =23#8! dcbd %!$1!51$%>##>!


2 3%$>1=#!7##@

gg ovxqwtusnxmswul

} ~|| {z 

•”’Œ”{  •”gg§
• g 
œ›š™˜—–šœ˜ œ›š™˜—–šœ˜

¾ ”g½Œ ¾ ”g½•
º´® ”ggђÀ§ Â
œ›š™˜—–šœ˜ œ›š™˜—–šœ˜
Qu –´” ³ 8
  

           ! %#  !'!&'*&

<=:<=@=69@89;=8:7>=584352=81?89;=8703/=.

OCM HCB #    QP R QS  SWVWP Y OCM#CMH \C

vv C#  \C#  w H !'QP&'QS& Y

Œ M89;=801ƒ7?7=ƒ8703/=83?9=<8:=<?1<076/89;=8?511ƒ8?755.

“™—•” •– ¤¦Ÿ¥¢£¡œ¦›¡¥£š

Qu –´” ³ 9
¶­–´”±®®³¯³•–´”™v—¨ ³—™§

À–—™•º½™–– 

ÖB    Î# ÊßÏÉÔR\# HC% ÎCCÎ CÊÁÞÔÜ

C C\%CB C # ßÏÉY

ÎÎCC#  \CC\ÁÞCíé çäÉ# HC% ÎCC

Î C \  % %CC  û  ü # HC% C  ý

## C# û  ü  Î Ê%#  % HHC%—³–” b–—

–´•–³—³”v ”´–v ).”

“™—•” •– ¤¦Ÿ¥¢£¡œ¦›¡¥£š
Question 10

Balanced Binary Tree Easy

Given a binary tree, determine if it is height-balanced.

Practice Question asked in:

Question 11

Linked List Cycle Easy

Given head , the head of a linked list, determine if the linked list has
a cycle in it.

There is a cycle in a linked list if there is some node in the list that can be
reached again by continuously following the next pointer . Internally, pos
is used to denote the index of the node that tail's next pointer is connected
to. Note that pos is not passed as a parameter.

Return true if there is a cycle in the linked list. Otherwise, return false .

Practice Question asked in:


Question 12
First Bad Version Easy

Suppose you have n versions [1, 2, ..., n] and you want to find out
the first bad one, which causes all the following ones to be bad.

You are given an API bool isBadVersion(version) which returns whether


version is bad. Implement a function to find the first bad version.

Practice Question asked in:

Tutort Benefits

1:1 Mentorship from 24x7 Live 1:1 Video based


Industry experts doubt support

Special support for Resume building & Mock


foreign students Interview Preparations
€fzxw

    

# !"  ! !!"  !" $ "+  "!& &" +

?!& " 4 ! "&"  @  A "+  &E !4 B E!4

! 4   &" +\

c eef mtv oursq lvkqusj

€fzx†

•” e’f ˜vkut–

²" ! B!! " &! µE &" ! µ !¦

«"! ¢""4 ¡"B «¢¡œ !&"

+"" &" ½»¹º·¶¼¸ !Á

½»¹º·¶¼¸ÒÊ$ÇÆ¶·Å·¶ÊÇÄÉ !Ý" &" «¢¡ !&" E& +Ô" Ý" ¶·Å·¶ÊÇÄ

Ê$ÇÆì¸ÇÒÊ$ÇÆç¸ÄÉ ¢" &" Ô!" µ &" ç¸Ä µ &" "4 "ò

voÊdÆÅuÇÒÊ$ÇÆç¸Ä,ÆÊ$ÇÆv·lu¸É ¡+B!" &" Ô!" µ &" ç¸Ä

c eef mtv oursq lvkqusj


Question 15
Container With Most Water Medium

You are given an integer array height of length n . There are n


vertical lines drawn such that the two endpoints of the i line th

are (i, 0) and (i, height[i])

Return the maximum amount of water a container can store.

Practice Question asked in:

Question 16
Kth Smallest Element in a BST Medium

Given the root of a binary search tree, and an integer k , return


the k th smallest value (1-indexed) of all the values of the nodes in the tree.

Practice Question asked in:

Best part about this academy is that before joining the program you can talk with the
Data Scientist. They have projects from companies so you will work on Real-Time
Projects and also got many job referrals from Tutort Academy & got a job as at EY.
Question 17

K Closest Points to Origin Medium

Given an array of points , where points[i] = [xi, yi]

represents a point on the X-Y plane and an integer k , return the k

closest points to the origin (0, 0)

You may return the answer in any order. ,

Practice Question asked in:

Question 18

Longest Substring Without Repeating


Characters Medium

Given a string s find the length of the longest substring without

repeating characters.

Practice Question asked in:


sXoVZknjiq
  
   
&$%!#& "$%!#&"$%!#& * /.  /. 3 /. 
3 $%!#& ?$%!#&?$%!#&..@
OQ* Q Q   Q*Q3 *  J
U[YWVZWX _ba dec`b^c e\

xk[oXojywwX[X{j|vjuVk[V
j‡ZVˆjvoVX Š YVYjWZXnWXj¢Š
XoZ‰n ›YWˆZnXj§XY[nZn‰
˜—–•”“’‘•—“ ˜—–•”“’‘•—“

¹´´jVYW¸j‡ZVˆŠ ¹´´jVYW¸jYVYj
›µ¯© WZXnWXj̍»j¢j›§½
˜—–•”“’‘•—“ ˜—–•”“’‘•—“
Question 20

Binary Tree Level Order Traversal Medium

Given the root of a binary tree, return the level order traversal
of its nodes' values. (i.e., from left to right, level by level).

Practice Question asked in:

Tutort Benefits

1:1 Mentorship from 24x7 Live 1:1 Video based


Industry experts doubt support

Special support for Resume building & Mock


foreign students Interview Preparations
¯VX9=¨¥

    

"!!! ! #

+ !)'!.(

8 :9=: BEDGHFCEA FH?

¯VX9=¨¨

U\V9R\ X8=XM99=  

k )]] qnmolp ]]u!

Ž]]+]€.] 

¡. Ž]]+ ]]. £

Ž]]

8 :9=: BEDGHFCEA FH?

Ïu Ñ

¼X98 9 ±=¶


ËÅ¡".
Question 23

Course Schedule Medium

There are a total of numCourses courses you have to take, labeled from

0 to numCourses - 1 . You are given an array prerequisites where

prerequisites[i] = [ai, bi] indicates that you must take course

bi first if you want to take course ai .

Return true if you can finish all courses. Otherwise, return false .

Practice Question asked in:

Question 24

Implement Trie (Prefix Tree) Medium

Implement the Trie class:

Trie() Initializes the trie object.

void insert(String word) Inserts the string word into the trie.

boolean sear ch(String word) Returns true if the string word is in the trie

boolean starts With(String prefi x) Returns true if there is a previously

inserted string word that has the prefi . x

Practice Question asked in:


Question 25
Coin Change Medium

You are given an integer array coins representing coins of different


denominations and an integer amount representing a total amount of money.

Return the fewest number of coins that you need to make up that amount.
If that amount of money cannot be made up by any combination
of the coins, return -1

Practice Question asked in:

Question 26
Product of Array Except Self Medium

Given an integer array nums return an array answer such that answer[i]
is equal to the product of all the elements of nums except nums[i]

You must write an algorithm that runs in O(n) time and without using
the division operation.

Practice Question asked in:


íì©êåæã

 

%$#" ##!##!! $"$" $" "


$$$ " ! # "$

.$$ $ 6543201/ ##:

6543201/=E " """R$#$#!HG$


ea5W^_[\Z=542^e0cE #$#$$$$  e0c ! !$#
ea5W^_a_=E $!$#$$$$ ! $!!t$#
542^2a_=E $#$!$$$ !t$#
542^{z2654=E $"$$#$" "$$$ " $#

Ž!#"$$ #!"! " ’=E "$!$"—t!$t "! :

¦¬© ° ³²µ¶´±³¯ ´¶­

íì©êåæò

¿ÉÇ©À¬¾©¬»º¬©© 

Ñ"$ $ Ôaa2 !tH" —$$$$" $"t""#"H" —


#$$$âÚØÖÕ

¦¬© ° ³²µ¶´±³¯ ´¶­


ß   ×Ý
     

  *)$!( !' .-,+ =<8<!7!43407:/ ?>? 4


FE'A' ?G? 4 F=3!A`!3c!TSQW]PNMQbWLKW\^JZ]R^I

h4E'44c!!:c''$(=3!'4/:!0'$(8:83 '}83y
E'4<:!g:3EE(:!!38EE(ve:c0(44c0EE/:c!' 4:/3< !'y
!EE4c!!:c''$(=3!v

€ ‚ ‚ ŠŒŽ‹‰Ž‡

ß   àä
˜ –•  –  

e:c!   .-,+ =<!8<8EE8<::/


3<!Ec4

G !7!43 073(8EE`
> !7!43 /!4<:! `:!
¬ !7!43 !:33:! v

¸3c!3<00c0c0$!:/0c343<30c43E74c3E:8EE
<4/!4<:! vÄ/3<4407:44$E`!3c! Ô>

€ ‚ ‚ ŠŒŽ‹‰Ž‡
Question 31

Search in Rotated Sorted Array Medium

There is an integer array nums sorted in ascending order (with distinct values).

Given the array nums after the possible rotation and an integer target
return the index of target if it is in nums , or -1 is not in nums

You must write an algorithm with O(log n) runtime complexity.

Practice Question asked in:

Question 32

Combination Sum Medium

Given an array of distinct integers candidates and a target integer candidates


target return a list of all unique combinations of candidates where
the chosen numbers sum to target You may return the combinations
in any order.

Practice Question asked in:


Question 33
Permutations Medium

Given an array nums of distinct integers, return all the possible permutations.
You can return the answer in any order.

Practice Question asked in:

Question 34
Merge Intervals Medium

Given an array of intervals where intervals[i] = [starti, endi]


merge all overlapping intervals, and return an array of the
non-overlapping intervals that cover all the intervals in the input.

Practice Question asked in:

The courses well structured, and I use them to learn new things every day as well as revise
concepts by solving multiple problems. It also helps you a lot when preparing for an
interview because most of the questions were similar to which I solved during the course.
­R  ¤£
      
   

5:4."-/-*:"/81-08..3-,:"+-0'.-%92.$0-#9((9"-/"#.$098- 6&-9,-029-):4.!
"9+.$-:"-0'.-08..7

;  EHGJKIFHDIKB

­R  ¤¯
  Z Y XT SR Q 

q(l%.(."0-0'.-m:(.d/l-#%/$$b
{zyxwutsv q":0:/%:†.$-0'.-08:.-9*|.#07
¢œzž–™x—s“—’z˜–‘x–“—’z˜–¢u x–z—–—zyx™—uytv
“—’z˜–˜x—s“—’z˜–‘x–z—–—zyx™—uytv

;  EHGJKIFHDIKB
Q  37

     

 $## "! /,.),' $## "!310 .=

/,.,.' $## "!3103J0 'XW,.,

'.'.m.=',))^`

ˆ.'.==,))^X.^.,))^,/=.'~

,.'),))^,'XW,.,'

.'  s s `r,))^,'){.^.W

 q s p

–  £¢¥¦¤¡£Ÿ ¤¦

Q  38

¯ ¬ «   

..² »! /,  {Á)).W.WX/,X.{^X.,'

ãm),{Á),')..WÁ)X/,,).
,.W..WX/,XW{^`

ü^'^,m.{'/,^^=,{..²ô.^)`

–  £¢¥¦¤¡£Ÿ ¤¦


Question 39

String to Integer (atoi) Medium

Implement the myAtoi(string s) function, which converts a string


string to a 32-bit signed integer (similar to C/C++'s atoi function).

Return the integer as the final result.

Practice Question asked in:

Question 40

Spiral Matrix Medium

Given an m x n matrix return all elements of the matrix in


spiral order.

Practice Question asked in:

From To
Avishkar Dalvi
MTS 3 at VMware
µ `DEO¯«
    

   '"*#*&$  *&&%'&


* 8 /%'3 2.

V/'&* ' WOEDH' B*%&H * .C * /N


'&* 'GE>OD=< =:

[=G]`] e hg jkifhd i kb

µ `DEO¯¸
x`EG=>O~= Ot`usO`< Ow` o   

 / ‚€ '"  $ '*&" B'


// B'"  *šŒ‹‰—”Œ‡ ›šŒ„ ™Œ‡ƒ ”˜‰„‡ŒŒ
¨™Œ¨Œ™›¨ ¤ ¢ ¡  ¤

[=G]`] e hg jkifhd i kb
O IE
     

#! ! " $ 3 +-5 "(-! '5&!2)3%! "! $

  ;>=@A?<>:?A8

T  USS   RQ 

licdR  f l    ~f


l  w d  
tsrqponmqso tsrqponmqso

•  ”cdf •  ”l  


w‘‹   ¨i—~w™
tsrqponmqso tsrqponmqso
Question 44

Unique Paths Medium

There is a robot on an m x n grid. The robot is initially located at the


top-left corner. The robot tries to move to the bottom-right corner
The robot can only move either down or right at any point in time.

Given the two integers m and n , return the number of possible unique
paths that the robot can take to reach the bottom-right corner.

Practice Question asked in:

Tutort Benefits

1:1 Mentorship from 24x7 Live 1:1 Video based


Industry experts doubt support

Special support for Resume building & Mock


foreign students Interview Preparations
y45
       

*+%'#!#(+%#''))#!!"''#!&)#($+(#
"$+)#(#(!+#(!"%#''))!'+%'#!#(+%
"$+"%#''))(
1"6%/)$" BAA@>@?=<;<:9 +%'#!#( ;
1"6%/)$" BAA@>@?=<;9 +%'#!#( G=@I@;F@E@=@>@=KC

M OO W^`ZY_\][ZV`[_]T

y46

h a 

~  s  s o} O $"%"' ‡† ƒ„‚A ""' †„‚A


(#!&'#‘#"!ˆ œA˜ƒ–• #(( !‘"$"'(
‡† ƒ„‚A@¶­@–º@¶­@–=@¶­@KKK@¶­@–« (‘++¼

È#!""'( ‡† ƒ„‚A !' †„‚A !''#‘#"!ˆ œA˜ƒ–•


îíàëêéàäíêÜëíâçÝßÚÙìáØìåáÙè×íãäíêÜëí׿áÙÛÚ×ÛìÛÙÖâרáÙÝÖÛÞáâì×ÚÕçÚâÔÚíÓàÒÑ
‡† ƒ„‚A êÒ †„‚A îíÒà ï ãÓíäÒí÷éôÜí÷ëúéëäôëíëòã÷ê÷ð

M OO W^`ZY_\][ZV`[_]T
À ¾¼»

     

  +*!+& +* 

*=*&&*=!=1=*&21*=&0

A  D KRTNMSPQO NJTOSQH

À ¾¼Á

h e ffA ^  ]\[YWDZ ]b  

p1 q y1{ &1!=*!&!&2&

ŽŒŽŠ‰‹ˆ‡‰† & ˆq”Љ‹ˆ‡‰† &+&2&2 ŸŒ™‰Ž‡‰†

¸=1  = +&2{&=¤=111&yª

&1=y1&*++ 0

A  D KRTNMSPQO NJTOSQH

ØßW ]b ÙÒDWDf  [Ø × ZDf¾ÍÌ [D^ DD]  ]b¾ Ê ^ D 

DÒ DßDZ[¾ À  Y D]  ]ZYD]Z¾ D  fDÊ ÈD ^ ffÊ ] D ß W f 

[ W ÇD¾ß]^ ]ZWD DßW ]b  ]¾ßWD DÍ


Day 49

Merge k Sorted Lists Hard

You are given an array of k linked-lists lists , each linked-list

is sorted in ascending order.

Merge all the linked-lists into one sorted linked-list and return it.

Practice Question asked in:

Day 50

Largest Rectangle in Histogram Hard

Given an array of integers heights representing the histogram's bar

height where the width of each bar is 1 , return the area of the largest

rectangle in the histogram.

Practice Question asked in:


  
  
 $! #"

Žn

˜˜%

|zw ypo% ‡%zE5%}z

ŽnÃ
GE¥zw%E¦G  %5 ¶ zw%wz z
¦%¨% ±z%¦%¥% 5%

lnnm

ff ff ff

) % 865  GEE%


21/-0,/+**01./ B?>A<BA;A:A?9A@>=A ^../aZIX\Y[\AX<ZI[Y=>N?:9ZU>>=_b
S=>K<Y:9:aZO<9><A<Q<ZL]..H0

You might also like