Flipkart GRID 7.0 OA || 2025 || Discussion (All 3 Complete Problems)
Anonymous User
1172

Hey everyone!

I recently gave the Flipkart GRID 7.0 Online Assessment, and here's a quick breakdown of all 3 coding questions asked during the test.

I’m posting the exact problem statements to help others prepare better.

--Duration-90 minutes


🚩 Problem 1: Geeta and the Logs

Difficulty: Easy-Medium

Geeta wants to cross a river by jumping over a sequence of logs.
There are N logs placed in a line, each with a certain length and hold parallel to each other. Geeta knew she could only jump a fixed distance to her right and to her left. So if the logs were more apart than that, she would have to turn back and reach her starting position. Her first priority was to reach the opposite bank, but if left with no choice she would return back to her starting position.

✅ Problem Statement:
Write a program to print the number of jumps Geeta makes before reaching either the opposite end or her starting position.

Read the input from STDIN and print the output to STDOUT.
Do not write arbitrary strings anywhere in the program, as these contribute to the standard output and testcases will fail.

🔒 Constraints:
N ≥ 1, the number of logs

X, Y ≥ 0; maximum distance Geeta can jump in left and right directions, respectively

Length of any log ≥ 1

📥 Input Format:
The first line of input contains N, X and Y separated by a single white space.

The second line of input contains N integers separated by a single white space, which represent the lengths of the logs.

📤 Output Format:
The output contains the number of jumps.

🧪 Example

Input-1
5 1 5
1 6 5 4 6
Output-1
6

Input-2
5 1 5
1 6 5 4 1
Output-2
8


🚩 Problem 2: Minimum Side of Axis-Aligned Square

Difficulty: Medium-Hard

You are given a set of N distinct points on a 2D plane. Each point is represented by its integer coordinates (xi, yi).
Each point can act as a corner of a square whose sides are parallel to the X and Y axes (i.e., axis-aligned). A valid square consists of exactly 4 of the given points.
Your task is to find the minimum possible side length of such a square that can be formed using any 4 of the given points.

📥 Input Format:
N
x1 y1
x2 y2
...
xN yN
N: Number of points

📤Output Format:
An integer representing the side length of the smallest axis-aligned square that can be formed using 4 of the given points.

If no such square can be formed, print -1.

🔒 Constraints:
4 ≤ N ≤ 1000

🧪 Example:
5
0 0
0 1
1 0
1 1
2 2
Output:
1


🚩 Problem 3: Broken Keypad and Fastest Station Access

Difficulty: Hard

There are N stations (numbered 1 to N) in the tunnel where the pod can stop.
There is a number pad with digits 0 to 9, and an Enter button.
One can enter the number of the station one wants to go to, press Enter, and the pod will go to that station.

There are also two additional buttons:

  • F to move just one station forward (e.g., from station 34 to station 35), and
  • B to move just one station backward (e.g., from station 38 to station 37).

One need not press 'Enter' after pressing F or B.


❗ Problem Scenario:

One morning, it was discovered that some digits on the number pad had stopped functioning, although buttons E (Enter), F, and B were working fine.

Since the repair work cannot be done immediately, engineers are trying to figure out the fastest way to reach any station using only the functioning digits.

✅ Task:

Write a program to help the engineers find the fewest button presses required to reach their destination station from where they are.
Print the number of button presses as the output.

📥 Input Format:

Read the input from STDIN and print the output to STDOUT.
Do not write arbitrary strings anywhere in the program, as these contribute to the standard output and test cases will fail.

🔒 Constraints:

  • N < 10000

Output Format:

Minimum number of button presses


  • I was able to solve the first two questions successfully, would really appreciate if someone can crack the 3rd problem(thanks in advance).

  • Personally, I found the platform experience a bit lacking. The problem statement for the first question was not clearly framed — it wasn’t mentioned anywhere that the first log on the starting bank can be jumped onto directly and that the last log connects directly to the opposite bank. This ambiguity cost me nearly 30 minutes debugging, thinking I had a logic bug, when in fact it was a problem with the statement itself.
    Eventually, I considered this implicit rule in my final solution and was able to pass the test cases.

  • Also, it was a bit disappointing that standard STL usage was restricted. That felt unnecessary, especially for a timed assessment.

Overall, it was a decent OA a few tweaks to clarity and tooling could’ve made it much better.


Comments (9)