Вы находитесь на странице: 1из 11

Coding

Easy -
1) Given an array and a number X, find if there exists 2 elements in array whose sum is X.
(Shivam)
2) Given an array and a number X, find if there exists 3 elements in array whose sum is X.
(Vijay)
3) Find smallest value in a sorted array that has been rotated along a pivot.(Shivam)
4) Given an array of integers. Find the pair in an array which has minimum XOR
value.(Shivam)
5) https://www.geeksforgeeks.org/minimum-delete-operations-make-elements-
array/ (Vijay)
6) https://www.geeksforgeeks.org/maximum-distance-two-occurrences-element-
array/ (Vijay)
7) Next greater element(Shivam)
8) https://www.geeksforgeeks.org/find-sum-non-repeating-distinct-elements-array/
Time - O(n^2) / O(nlogn)
Space - O(1) (Vijay)
9) https://codeforces.com/contest/1150/problem/C (Vijay)
10) No of substrings of string S which are anagrams to another string Z (Vijay)
11) Count number of pairs having xor equal to K (Vijay)

12) Given a complete binary tree, such that level order traversal is sorted.
Find an element K in this tree efficiently. (better than O(n))- Akash
13) Draw a circle without floating point arithmetic (#Microsoft)
https://www.geeksforgeeks.org/draw-circle-without-floating-point-arithmetic/ (Muskan)
14) Split a 3*n array into n triplets (x,y,z) where x<=y<=z such that y1+y2+-----+yn is
maximum (Vijay)
15) https://codeforces.com/contest/1003/problem/D greedy (Ayush)
16) https://practice.geeksforgeeks.org/problems/arrange-the-balls/0
17) https://codeforces.com/problemset/problem/75/C
Medium -
1) https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/
2) https://leetcode.com/problems/shortest-common-supersequence/
3) https://ideone.com/kMqI9d (Vijay)
4) (i) Find minimum steps to sort an array when the operation allowed is swapping
adjacent elements (Vijay)
(ii) Minimum number of swaps to sort an array when any 2 elements can be swapped.
(Muskan)
5) Find the largest subarray whose all elements are distinct (Shivam) Bonus:- O(n)
6) Find the maximum size subset whose xor is K. Bonus:- Print the largest size subset if
present (Vijay)
7) https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-
dimensional/practice-problems/algorithm/vanya-and-gcd-array/(Shivam)
8) https://codeforces.com/contest/1130/problem/C (Vijay)
9) https://codeforces.com/contest/1095/problem/C (Vijay)
10) No of subarrays with K distinct elements (Vijay)
11) https://www.geeksforgeeks.org/rearrange-array-maximum-minimum-form-set-2-o1-extra-
space/(Shivam)

12) Shortest Word Edit Path


Given two words source and target, and a list of words, find the length of the shortest
series of edits that transforms source to target.
Each edit must change exactly one letter at a time, and each intermediate word (and the
final target word) must exist in the list of words.
If the task is impossible, return -1.
(Akash)

13) Maximum subarray xor (Vijay)


14) If there are files that are dependent on each other and I need to compile them. In what
order should they be executed that all of them would get successfully compiled? (-Aman)
(Solution is Topological sorting)

15) https://www.hackerearth.com/challenges/competitive/july-circuits-19/algorithm/xor-
thingy-36fea7be/ (Aayush)
18) Given n red balls and m blue balls. Find the no of ways to arrange the balls %
1e9+7 such that there are atmost k consecutive balls of same color. (1<=n<=100 ,
1<=m<=100 , 1<=k<=100) (Vijay) …. Anybody with soln for values<=1e3 can include it
in hard too!! …. (sure buddy :) )....
19) https://leetcode.com/problems/trapping-rain-water/ (Vijay)

20) Given a tree rooted at 1. You have to remove the maximum no of vertices by
performing atmost K operations. In one operation you choose a leaf and remove all the
vertices from the leaf to all its predecessors. (Vijay)
21) Next permutation for 2nd year asked in many interview (Naman)

22) Given height h[i] of n trees and length of wood ‘w’ to be collected. All the trees
have to be cut at the same height and the length of wood above this height is collected.
Find the height ‘l’ at which the trees should be cut so that exactly ‘w’ wood is collected in
total. (#PhonePe) (Binary Search) (Ridhima)

23) Given n cities connected by bi-directional edges. Some aliens appear magically
in some of the cities. Find the minimum time in which they will reach all the cities.
(Multisource-bfs) (#phonepe) (Ridhima)

24) Given a 3*4 board with ‘X’ marked at cell (1,1) , (1,4) , (3,1) , (3,4) . You need to
fill the remaining cells with numbers from 1 to 9 such that for any cell (x,y) no adjacent
values appear in cells (x,y-1) , (x-1,y) , (x,y+1) , (x+1,y) . (Vijay)

25) https://leetcode.com/problems/binary-tree-maximum-path-sum/ (Ridhima).

26) You are given a tree (a simple connected graph with no cycles).
Find the maximum number of edges you can remove from the tree to get a forest such that
each connected component of the forest contains an even number of nodes.
https://www.hackerrank.com/challenges/even-tree/problem (Ayush) (greedy)

27) https://www.hackerrank.com/challenges/torque-and-development/problem
(Ayush)
28) https://www.geeksforgeeks.org/painters-partition-problem/ (Amulya)
29) Given n currencies, m linear relations (eg : c1=2*c2, c1=c3/2) between them, q
queries and in each query two currencies are mentioned. For each query, find whether
there is any relation between these 2 currencies, if yes then state the relation otherwise
the answer is no. Queries should be precomputed. (#PhonePe) (Graph) (Ridhima)
30) Given Q queries of the form “x and d” where 1<=x<=1e6 and d is a divisor of x.
Find the numbers which have gcd(j,x) = d , i.e. no of j <=x such that gcd(x,j)=d
(Something related to it was asked in Amazon)
31) https://codeforces.com/problemset/problem/348/A (Ayush) (Binary search)
32) https://www.geeksforgeeks.org/merging-intervals/ (Asked in interviews of
Amazon and Google)
33) https://www.geeksforgeeks.org/find-the-point-where-maximum-intervals-overlap/
34) https://www.spoj.com/problems/PPATH/ (BFS + sieve)
35) https://www.geeksforgeeks.org/maximum-product-subarray/
36) Given a traffic signal with two types of lights - green and red. Two consecutive
signals cannot have red lights. A man starts his journey from his home and has to reach
the destination. In his way, there are N such traffic signals. Find the number of ways the
man can reach the destination crossing the N signals. (The first signal is always green)
(Dp)(Ans: fibonacci(N)) - (Ayush)
37) https://www.hackerearth.com/problem/algorithm/chocolates-41/ (Adhoc) (Ayush)

Hard -
Find the no of substrings of a string A which occur as anagram substrings of another string B
( Easy = 1<=|A|<=100 , Hard= 1<=|A|<=1000 ). (Vijay)
LIS in O(NlogN)
https://codeforces.com/contest/1076/problem/E (Vijay)
https://leetcode.com/problems/cut-off-trees-for-golf-event/
Largest size prefix which occurs as a suffix in a string (Vijay)
Largest size suffix which occurs anywhere in the string as a substring (Vijay)
Given Q queries, with each query consisting of two integers L and R, the task is to
find the total numbers between L and R (Both inclusive), having atmost k set bits
in their binary representation.(1<=L<=R<=1e18). (Shivam)
Given an undirected weighted graph . Answer Q queries - No of connected
components considering edges with weight<=x (Vijay)
Given an array, the task is to divide it into two sets S1 and S2 such that the
absolute difference between their sums is minimum.(Shivam)
https://codeforces.com/contest/1095/problem/E (Vijay)
Number of pairs in an array with bitwise AND = 0. (Aayush)
Multiple Queries for distance between two nodes in a tree. (Aayush)
Problem on Topological sorting + dp (Something like number of ways to reach a
particular node from source). (Aayush)
Given a permutation of numbers from 1 to n, you have to answer Q queries, in
each query L to R is given. You have to reverse the segment from L to R and
output the parity of inversion count. All queries are performed one after another.
(Aayush)
You’re given a read only array of n integers. Find out if any integer occurs more
than n/3 times in the array in linear time and constant additional space.
(Priyanshu) https://www.interviewbit.com/problems/n3-repeat-number/

Given a complete binary tree with sorted levels search for an element ( no extra
space )(flipkart FTE)(Naman)

https://www.geeksforgeeks.org/flipkart-interview-experience-for-sde-1-on-
campus-2019/

Find the maximum frequency digit sum between numbers [a,b] . 1<=a,b<=1e18 (Vijay)

https://stackoverflow.com/questions/1701612/find-number-of-permutations-of-a-given-
sequence-of-integers-which-yield-the-same (Amit)
OOPS - Java/C++
1) Polymorphism(Run Time - Compile Time)

2) What are virtual functions – Write an example?What is a pure virtual function?

What are VTABLE and VPTR?

3) Structure vs class in C++

4) Malloc() vs new / Delete vs Free

5) Copy Constructor in C++. Why const reference parameter inside copy

constructor? Can we make copy constructor private?


6) Shallow copy / Deep copy

7) What are the differences between references and pointers?

8) How an object gets eligible for garbage collection in Java

9) Final, Finally, finalize(Surbhit), try, catch

10) What if there is an exception in catch/finally block?

11) How to restrict a class to have only one object max? Ans: Using singleton class

12) What was the need of inheritance (Vijay)

13) Explain polymorphism by taking this room as an example. (Aman)

14) What is Abstraction?(Naman)

15) Given a program which contain pointer whose address value is 100 and there is another
program which has a pointer with value 100, run the first program there is a breakpoint
before printing address value of pointer, at the time of breakpoint we run second
program in which value of pointer is changed to 200, in the end what will be printed by
first program after breakpoint? (Khyati)
16) How to create threads in java (using runnable and thread class) - (Ayush)

17) Operator overloading in C++. (Aayush)

18) Creating an immutable class in java. (Amulya)

19) Interface vs abstract class. (Amulya)

20) Diamond problem.(Amulya)

21) Dangling pointer problem in C. (Deshaw) (Kaun ho bhai “deshaw” )


22) Why main method is static (Amit)

23) Number of ways to create an object in java (Amit)

24) What is classpath? (Amit)

25) What is Garbage collector and how it works(Amit)

26) What is constructor in python? (Surbhit)


OS / DBMS / Networking / ML(for people having
ML in their resume)

1. How to handle missing data in a dataset?(#ML)


https://www.analyticsindiamag.com/5-ways-handle-missing-values-
machine-learning-datasets/ (Aman)
2. Difference between Classification and Regression(#ML) (Aman)
3. LRU Cache implementation (#OS) (Aman)
4. Basics of K-means, KNN, SVM, Decision Tree. (Aayush)
5. Difference between (i) Mutex and Semaphore, (ii) Process and Thread. (#OS)
(Muskan)
6. Grep, awk, sed and other linux commands. (Aayush)
7. Deadlock, necessary condition for it; it's prevention and avoidance(Naman)
8. What is thrashing?(#OS) (Muskan)
9. What is Belady’s Anomaly?(Naman)
10. How can we find out the maximum size of page table that can be accumulated,
you are not given the number of entries in table? {Khyati)
11. Types of Indexing. (Khyati)
12. Kernel vs OS (AMit)
13. What happens when the system boots up.(Amit)
#MayankPandeyKaFavQuestion

Networking

1. What are layers in OSI model?(Naman)


2. Differences between Hub, Switch and Router?(Naman)
3. What is DHCP, how does it work?(Naman)
4. What do you mean by Proxy server?(#Networking) (Aman)
5. Explain full process after typing www.google.com in address bar(#Networking)
(Aman)
6. Explain NAT and use of NAT.(khyati)
7. TCP and UDP difference. What to use when? (Ayush)
8. Explain working of ARP (AMit)
9. Limited broadcasting vs direct broadcasting on network layer(Amit)
10. Explain process of fragmentation on Network layer (Amit)
11. What’s the difference b/w connection less and connection oriented .(Amit)
12. Subnetting, VLSM, CIDR (Surbhit)
13. What is port forwarding, UPnP? (Surbhit)
System Design
1) Design URL shortener service (Ayush)
2) Design Uber ( Amulya)
3) Design airport parking management (Amulya)
4) Design google autocomplete with top 10 suggestions (trie + max heap) (Ayush)
5) Design Book my show https://www.geeksforgeeks.org/design-movie-ticket-booking-
system-like-bookmyshow/
6) Design WhatsApp
7) Design facebook
8) Design Instagram, Youtube, Netflix (Aayush) Wow!!
9) Design an ice-cream vending machine. (Visa FTE interview) (Muskan)
10) Design filtration feature of e-commerce site, (Khyati)
11) Design delhi metro then on simplification with the features short it down to ticket booking
system. (Khyati)
12) Design version control system like git. (Amulya)
13) Concurrency Control for seat bookings on BookMyShow.(Amit)
14) Design CUT COPY PASTE UNDO REDO. (Amit) Nice Nigga
15)
Technical(DS/Algo/Language)

1. Which Data Structure Should be used for implementing LRU cache?


(Solution is Queue using doubly linked list/Hash) (Aman)
2. Inner implementation of Set, Map in C++. (Aayush)
3. Storage classes in C (Aman)
4. What was the problem with 1’s complement that we needed to introduce 2’s
complement? (Aman) #interestingQuestion
5. Data structure used for dictionary and spell checker.
https://www.geeksforgeeks.org/data-structure-dictionary-spell-checker/ (Muskan)
6. Difference between Map and Unordered Map. (In terms of data structure used,
search time, ordering etc.) (Muskan)
7. Advantages of BST over Hash table. (Muskan)
8. Add two numbers without using arithmetic operators
https://www.geeksforgeeks.org/add-two-numbers-without-using-arithmetic-
operators/ (Priyanshu)
9. Design a data structure for implementing a debugger. (Amulya)
10. Given two linked lists. Tell if they intersect or not without using any extra
space(not even an integer). (Amulya)
11. Design a data structure to
a) Find max element in O(1).
b) Find min element in O(1).
c) remove element in O(log n).
d) insert element in O(log n)
( #phonepe ) (doubly linked list+BST) (Ridhima)

12. Stack vs Heap Memory (Akash)

13. Implement Math.rand() function. (Akash)

14. Applications of favourite data structure. (Akash)

15. Hashing. Collision Resolution. Load Factor. Rehashing. (Akash)

Вам также может понравиться