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

Chat-Gpt Coding Questions

Uploaded by

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

Chat-Gpt Coding Questions

Uploaded by

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

Sure, here are 30 commonly asked array coding questions for intermediate-level

technical interviews:

Two Sum

Maximum Subarray (Kadane's Algorithm)

Merge Intervals

Product of Array Except Self

Find Minimum in Rotated Sorted Array

Search in Rotated Sorted Array

3Sum

Container With Most Water

Longest Consecutive Sequence

Subarray Sum Equals K

Majority Element

Find All Duplicates in an Array

Find the Duplicate Number


Top K Frequent Elements
Longest Increasing Subsequence
Best Time to Buy and Sell Stock
Problem: Given an array, where each element represents the price of a stock on that
day, find the maximum profit you can achieve by buying and selling one share of the
stock.
Set Matrix Zeroes
Problem: Given an m x n integer matrix, if an element is 0, set its entire row and
column to 0.
Spiral Matrix
Problem: Given an m x n matrix, return all elements of the matrix in spiral order.
Rotate Image
Problem: Given an n x n 2D matrix, rotate the image by 90 degrees (clockwise).
Word Search
Problem: Given a 2D board and a word, find if the word exists in the grid.
Combination Sum
Problem: Given an array of distinct integers and a target integer, return all
unique combinations in the array where the chosen numbers sum to the target.
Jump Game
Problem: Given an array of non-negative integers, where each element represents the
maximum jump length at that position, determine if you can reach the last index.
Trapping Rain Water
Problem: Given n non-negative integers representing an elevation map where the
width of each bar is 1, compute how much water it can trap after raining.
Permutations
Problem: Given a collection of distinct integers, return all possible permutations.
Find Peak Element
Problem: Given an array, find a peak element. A peak element is an element that is
greater than its neighbors.
Find First and Last Position of Element in Sorted Array
Problem: Given an array of integers sorted in ascending order, find the starting
and ending position of a given target value.
First Missing Positive
Problem: Given an unsorted integer array, find the smallest missing positive
integer.
House Robber
Problem: Given an integer array representing the amount of money of each house,
determine the maximum amount of money you can rob tonight without alerting the
police.
Word Break
Problem: Given a string and a dictionary of words, determine if the string can be
segmented into a space-separated sequence of one or more dictionary words.
Longest Substring Without Repeating Characters
Problem: Given a string, find the length of the longest substring without repeating
characters.
These problems cover a wide range of topics and techniques related to arrays and
will help you solidify your understanding and problem-solving skills.

You might also like