Closed Abhijit2505 closed 4 years ago
1)Find and return the equilibrium index of an array. Equilibrium index of an array is an index i such that the sum of elements at indices less than i is equal to the sum of elements at indices greater than i. Element at index i is not included in either part. If more than one equilibrium index is present, you need to return the first one. And return -1 if no equilibrium index is present. Sample Input: 7 -7 1 5 2 -4 3 0 Sample Output: 3
2)An array is monotonic if it is either monotone increasing or monotone decreasing.
An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j].
Return true if and only if the given array A is monotonic.
Example 1:
Input: [1,2,2,3] Output: true
Example 2:
Input: [6,5,4,4] Output: true
Example 3:
Input: [1,3,2] Output: false
Example 4:
Input: [1,2,4,5] Output: true
Example 5:
Input: [1,1,1] Output: true
These are the question I will be solving next so I put this question here. question 1 link - https://codezen.codingninjas.com/practice/465/31/array-equilibrium-index question 2 link - https://leetcode.com/problems/monotonic-array/
1)Find and return the equilibrium index of an array. Equilibrium index of an array is an index i such that the sum of elements at indices less than i is equal to the sum of elements at indices greater than i. Element at index i is not included in either part. If more than one equilibrium index is present, you need to return the first one. And return -1 if no equilibrium index is present. Sample Input: 7 -7 1 5 2 -4 3 0 Sample Output: 3
2)An array is monotonic if it is either monotone increasing or monotone decreasing.
An array A is monotone increasing if for all i <= j, A[i] <= A[j]. An array A is monotone decreasing if for all i <= j, A[i] >= A[j].
Return true if and only if the given array A is monotonic.
Example 1:
Input: [1,2,2,3] Output: true
Example 2:
Input: [6,5,4,4] Output: true
Example 3:
Input: [1,3,2] Output: false
Example 4:
Input: [1,2,4,5] Output: true
Example 5:
Input: [1,1,1] Output: true
These are the question I will be solving next so I put this question here. question 1 link - https://codezen.codingninjas.com/practice/465/31/array-equilibrium-index question 2 link - https://leetcode.com/problems/monotonic-array/
Please post only question links instead of the questions next time. Also, try to mention if it has been asked in any company interview.
@abhinavmaharana , both the questions are nice. Good job. Now try to find if these questions were asked in any company interview before? If yes then mention the company names in a reply to this comment.
If they are not being asked in any company interview, then we will look into other possible questions based on array data structure.
Great 😃
question 1: https://practice.geeksforgeeks.org/problems/remove-duplicate-elements-from-sorted-array/1/?track=ppc-arrays&batchId=221 [Asked in: Morgan Stanley; Samsung; Wipro; Xome; Zoho.]
question2: https://practice.geeksforgeeks.org/problems/first-repeating-element4018/1/?track=ppc-arrays&batchId=221 [Asked in: Amazon ; Oracle ]
@abhinavmaharana , both the questions are nice. Good job. Now try to find if these questions were asked in any company interview before? If yes then mention the company names in a reply to this comment.
If they are not being asked in any company interview, then we will look into other possible questions based on array data structure.
Great smiley
It is not asked in any company so should i solve it for getting the answer as the question is great and may in future it can be asked.
@abhinavmaharana , both the questions are nice. Good job. Now try to find if these questions were asked in any company interview before? If yes then mention the company names in a reply to this comment. If they are not being asked in any company interview, then we will look into other possible questions based on array data structure. Great smiley
It is not asked in any company so should i solve it for getting the answer as the question is great and may in future it can be asked.
Let's try finding the questions which have been asked in an interview before. Don't be in a hurry to solve the problems, everyone will be given sufficient time to prepare the solution and the documentation.
so @abhinavmaharana, please find some questions that have already been asked in the interview in past, related to the array data structure.
Because there are thousands of problems available and we must focus on problems which are already been asked in the interviews.
question 1: https://practice.geeksforgeeks.org/problems/remove-duplicate-elements-from-sorted-array/1/?track=ppc-arrays&batchId=221 [Asked in: Morgan Stanley; Samsung; Wipro; Xome; Zoho.]
question2: https://practice.geeksforgeeks.org/problems/first-repeating-element4018/1/?track=ppc-arrays&batchId=221 [Asked in: Amazon ; Oracle ]
These are awesome
Question 1: https://practice.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1 [ Asked in: Amazon, Adobe, Paytm, Ola, Qualcomm]
Question 2: https://practice.geeksforgeeks.org/problems/left-out-candies/0 [Asked in: Amazon]
Q1).Max Sum Contiguous Subarray https://www.interviewbit.com/problems/max-sum-contiguous-subarray/ Asked in: Facebook Paypal Yahoo Microsoft LinkedIn Amazon Goldman Sachs
Q2).Pascal Triangle https://www.interviewbit.com/problems/pascal-triangle/ Asked in: Google Amazon
https://www.interviewbit.com/problems/wave-array/ [ Asked in : Google, Adobe, Amazon ]
https://www.interviewbit.com/problems/find-duplicate-in-array/ [Asked in: Amazon, VMWare, Riverbed]
1.) https://www.interviewbit.com/problems/add-one-to-number/ [ Asked in : Google,Amazon ]
2.) https://www.interviewbit.com/problems/maximum-absolute-difference/ [ Asked in : Amazon ]
Basic Array question was asked in interviews also. if you don't like the first one then
3) https://www.interviewbit.com/problems/min-steps-in-infinite-grid/ [ Asked in : Directi ]
Q1) https://www.interviewbit.com/problems/max-min-05542f2f-69aa-4253-9cc7-84eb7bf739c4/ (Asked in : Google)
Q2)https://www.geeksforgeeks.org/next-greater-element/ (Asked in : Amazon)
Q1)https://www.interviewbit.com/problems/rotate-matrix/ ASKED IN- GOOGLE ,FB,AMAZON Q2)https://www.interviewbit.com/problems/first-missing-integer/ ASKED IN- Model N,InMobi,Amazon
Q1)https://practice.geeksforgeeks.org/problems/count-the-zeros/0 Asked in-Amazon,yahoo Q2)https://practice.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s4231/1 Asked in-Amazon,,Adobe,SAP,Microsoft,etc
1]https://practice.geeksforgeeks.org/problems/find-the-fine/0 Asked in - Microsoft
2]https://practice.geeksforgeeks.org/problems/convert-array-into-zig-zag-fashion/0 Asked in -Amazon ,Paytm
You can use any programming site like Leetcode, Codeforces etc to get two questions based on array which are of basic level. Only get two questions first. No need to get the answers or solve them for this issue.
Find two such questions on the array and post the link as a reply to this issue.
Deadline - 28th July 6.00PM