0% found this document useful (0 votes)
13 views2 pages

Coding Test Questions

Common Easy DSA Problems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Coding Test Questions

Common Easy DSA Problems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Find the Missing Number in an Array

● Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find


the missing number.

2. Longest Substring Without Repeating Characters

● Given a string, find the length of the longest substring without repeating
characters.

3. Kth Largest Element in an Array

● Given an array, find the kth largest element in the array.

4. Merge Intervals

● Given a collection of intervals, merge all overlapping intervals.

5. Check if a String is a Valid Parentheses

● Given a string containing just the characters '(', ')', '{', '}', '[', ']', determine if the
input string is valid.

6. Rotate Array

● Given an array, rotate the array to the right by k steps, where k is non-negative.

7. Climbing Stairs Problem

● You are climbing a staircase. It takes n steps to reach the top. Each time you can
either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

8. Two Sum Problem

● Given an array of integers nums and an integer target, return the indices of the
two numbers such that they add up to the target.

9. Palindrome Linked List

● Given the head of a singly linked list, determine if it is a palindrome.

10. Find the Duplicate Number


● Given an array of integers containing n + 1 integers where each integer is
between 1 and n inclusive, find the duplicate number.

11. Container With Most Water

● 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.

12. Product of Array Except Self

● Given an array nums of n integers, return an array output such that output[i] is
equal to the product of all the elements of nums except nums[i].

13. Search in Rotated Sorted Array

● Suppose an array sorted in ascending order is rotated at some pivot unknown to


you beforehand. You are given a target value to search. If found in the array return
its index, otherwise return -1.

14. Reverse a Linked List

● Reverse a singly linked list.

15. Implement Queue using Stacks

● Implement a first in first out (FIFO) queue using only two stacks. The implemented
queue should support all the functions of a normal queue (push, pop, peek, and
empty).

You might also like