Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,244 views

Bonus : Best Image2Pdf feature is here : https://www.desiqna.in/image2pdf/

All past online assesments of Microsoft  can be found using the tag "microsoft_oa" in the search bar.

Here is the link : https://www.desiqna.in/tag/microsoft_oa

in Online Assessments by Expert (4,460 points) | 1,244 views

2 Answers

0 like 0 dislike

Microsoft Online Assessment (OA) - Jump Game

 

You are given an array of non-negative integers arr and a start index. When you are at an index i, you can move left or right by arr[i]. Your task is to figure out if you can reach value 0.

Example 1:

Input: arr = [3, 4, 2, 3, 0, 3, 1, 2, 1], start = 7

Output: true

Explanation:

left -> left -> right

Example 2:

Input: arr = [3, 2, 1, 3, 0, 3, 1, 2, 1], start = 2

Output: false

by Expert (4,460 points)
0 like 0 dislike

Microsoft Online Assessment (OA) - Unique Integers That Sum Up To 0

Given an integer n, return any array containing n unique integers such that they add up to 0.

Example 1:

Input:5

Output: [-4,-2,0,2,4]

Example 2:

Input:3

Output: [-2, 0, 2]

Example 1:

Input:1

Output: [0]

by Expert (4,460 points)