Skip to content
TutorialCup
  • Home
  • Tutorials
    • C
    • C++
    • DBMS
    • Java
    • Python
    • SQL
    • Testing
    • GitHub
    • Spring Boot
    • R
    • JavaScript
  • Interviews
    • Technical Interview Questions
    • Interview Questions

TutorialCup

  • Home
  • Tutorials
    • C
    • C++
    • DBMS
    • Java
    • Python
    • SQL
    • Testing
    • GitHub
    • Spring Boot
    • R
    • JavaScript
  • Interviews
    • Technical Interview Questions
    • Interview Questions

Minimum Moves to Equal Array Elements Leetcode Solution

Problem Statement In this problem, we are given an array of integers. Also, we are allowed to perform a certain set of operations on this array. In one operation, we can increment ” n – 1″ (all elements except any one) elements in the array by 1. We need to …

Read more

Categories LeetCode Solutions Tags Amazon, Apple, Coursera, Drawbridge, Easy, Factset, Indeed, JPMorgan, Math, Mathworks, Microsoft, Swiggy

Maximum sum of pairs with specific difference

The problem “Maximum sum of pairs with specific difference” states that you are given an array of integers and an integer K. Then we are asked to find out the maximum sum of independent pairs. We can pair two integers if they have an absolute difference of less than K. …

Read more

Categories Dynamic Programming Interview Questions Tags Accolite, Array, Coursera, Delhivery, Dynamic Programming, Easy, Fourkites, Snapdeal

Largest subarray with equal number of 0s and 1s

You are given an array of integers. The integers are only 0 and 1 in the input array. The problem statement asks to find out the largest sub-array that can have equal count of 0s and 1s. Example arr[]={0,1,0,1,0,1,1,1} 0 to 5 (total 6 elements) Explanation From the array position …

Read more

Categories Hashing Interview Questions Tags Amazon, Array, Coursera, GreyOrange, Hash, MakeMyTrip, Medium, Morgan Stanley, Paytm, Synopsys, Times Internet

Binary array after M range toggle operations

You are given a binary array, which consists of 0 initially and Q number of queries. The problem statement asks to toggle the values (converting 0s into 1s and 1s into 0s). After the Q queries performed, print the resultant array. Example arr[] = {0, 0, 0, 0, 0} Toggle(2,4) …

Read more

Categories Dynamic Programming Interview Questions Tags Amazon, Array, Coursera, Goldman Sachs, Google, GreyOrange, Medium, Query Problem, Snapchat

Queries for counts of array elements with values in given range

Problem Statement The problem “Queries for counts of array elements with values in given range” states that you have an integer array and two number x and y. The problem statement asks to find out the count of numbers present in array that lies between the given x and y. …

Read more

Categories Array Interview Questions Tags Array, Bits, Coursera, DE Shaw, Google, Hard, PayU, Query Problem, Snapdeal, Times Internet, Yahoo

Text Justification

Problem Statement The problem “Text Justification” states that you are given a list s[ ] of type string of size n and an integer size. Justify the text such that each line of text consists of size number of characters. You can use space(‘ ‘) as a character to complete …

Read more

Categories String Interview Questions Tags Amazon, Coursera, Google, Hard, Indeed, LinkedIn, Microsoft, Pinterest, Snapchat, String

Distinct adjacent elements in an array

Problem Statement Suppose we have an integer array. The problem “Distinct adjacent elements in an array” asks to determine if it is possible to get the array in which all the adjacent numbers are distinct or not by swapping up two adjacent or neighbour elements in an array if it …

Read more

Categories Array Interview Questions Tags Array, Coursera, DE Shaw, Easy, Hike, IBM, Kuliza, Nagarro, Opera, OYO Rooms, Zoho

Count subarrays with equal number of 1’s and 0’s

Problem Statement The problem “Count subarrays with equal number of 1’s and 0’s” states that you are given an array consisting of 0’s and 1’s only. The problem statement asks to find out the count of sub-arrays consisting equal no of 0’s ad 1’s. Example arr[] = {0, 0, 1, …

Read more

Categories Hashing Interview Questions Tags Array, Cisco, CouponDunia, Coursera, Databricks, Easy, Hash, Karat, SAP Labs, Tesla

Binary Tree to Binary Search Tree Conversion using STL set

Problem Statement We are given a binary tree and we need to convert it into a binary search tree. The problem “Binary Tree to Binary Search Tree Conversion using STL set” asks to do conversion using STL set. We have already discussed converting the binary tree into BST but we …

Read more

Categories Tree Interview Questions Tags Amazon, Binary Search Tree, Binary Tree, Coursera, Google, Indeed, Medium, Microsoft, OYO Rooms, Tree

Find the minimum distance between two numbers

Problem Statement You have given an array and two numbers called x and y. The problem “Find the minimum distance between two numbers” asks to find out the minimum possible distance between them. The array given can have common elements. You can assume that both x and y are different. …

Read more

Categories Array Interview Questions Tags Array, CouponDunia, Coursera, Delhivery, Easy, Moonfrog Labs, PayPal, Paytm, Snapchat
Post navigation
Older posts
1 2 Next →

Search




© TutorialCup 2021 | Feeds | Privacy Policy | Terms | Contact Us | Linkedin | About Us
Scroll back to top
Next Page »