Company-style OA practice sets with full problem statements, sample test cases, and solutions.
Have you recently taken Flipkart's Online Assessment or coding test? Share the questions, test cases, or assessment patterns you encountered. Earn SWE180 Coins for every verified submission and use them to unlock other company OA sets and premium tools for free!
Light-cycle racing takes place inside a rectangular grid. The lower-left corner of the grid is (0,0), and the upper-right corner is (W, D). Coordinates on the boundary are inside the grid.
Two players, A and B, start at different positions and move simultaneously. Both players initially face east, toward the positive x-axis.
Each player's path consists of movement segments in the form [T, k], where:
- T is 'S' (continue straight), 'L' (turn 90 degrees left), or 'R' (turn 90 degrees right).
- k is the number of grid units to move after turning.
A player moves one grid unit per second. Every coordinate occupied by a player becomes an impassable wall, including the starting coordinate.
A player dies when the player:
1. Moves outside the grid boundary [0, W] x [0, D];
2. Moves into a coordinate previously occupied by either player; or
3. Moves into the same coordinate as the other player during the same second.
Both players move simultaneously. If both players enter the same coordinate during a second, both players die.
The race ends immediately after a second in which at least one player dies. The race also ends at the current time when either player completes all movement segments (no additional movement is performed).
Print the time at which the race ends, followed by each player's final coordinate and status ('A' if alive, 'D' if dead).
Example 1
Input
10 10 1 1 2 S 5 L 4 9 9 2 S 5 L 4
Output
9 6 5 A 4 5 A
Explanation
Both players execute their segments without colliding with walls, boundaries, or each other's trails. The race ends when movement segments complete.
You are provided a maze of size m X n. Each cell can be either empty ('.') or a wall ('X'). A ball is initially placed at the start point ('s') and must reach the end point ('e'). There is exactly one 's' and 'e' in the maze.
The ball moves using gravity by rotating the maze 90 degrees to the left (counter-clockwise) or to the right (clockwise). Your goal is to find C, the number of cells the ball passes through while moving from start point to end point (both excluded).
Rules:
1. The ball must come to rest on 'e'. Merely passing through 'e' during motion does not complete the task.
2. Gravity initially acts downward. Before the first rotation, the ball falls downward until it hits a wall or falls off the maze.
3. Find a valid solution that uses the minimum number of maze rotations.
4. Left rotation (counter-clockwise) has priority over right rotation (clockwise) if multiple solutions use the same minimum number of rotations.
5. After every rotation, the ball slides continuously in the direction of gravity until the next cell is a wall. It is possible for the ball to fall off the grid (invalid path).
Example 1
Input
5 5 s.... XXXX. ..... .XXXX ....e
Output
8
Explanation
The ball falls downward, rests, and with minimal rotations rolls towards cell 'e', resting exactly on 'e' after traversing 8 intermediate cells.
A jewellery manufacturing company wants to identify workshops that are experiencing production-quality and order-fulfilment problems. The company records workshop details, category production standards, manufacturing batches, customer orders, and return reports.
Your task is to analyse the available records with respect to a fixed referenceDay and identify workshops whose risk level is CRITICAL or WARNING.
Risk Assessment Rules:
1. Defect Rate (% of manufactured items with defects):
- If defect rate exceeds category tolerance threshold by >= 15%: CRITICAL
- If defect rate exceeds category tolerance threshold by >= 5%: WARNING
2. Fulfilment Delay (% of orders shipped after referenceDay or past promised delivery):
- If delay rate >= 20%: CRITICAL
- If delay rate >= 10%: WARNING
3. High Return Volume (% of items returned due to quality):
- If return rate >= 10%: CRITICAL
- If return rate >= 5%: WARNING
Overall Workshop Risk:
- If any metric is CRITICAL, overall risk is CRITICAL.
- Else if any metric is WARNING, overall risk is WARNING.
- Otherwise, NORMAL (do not print).
Print qualifying workshops sorted by risk level (CRITICAL first, then WARNING), and alphabetically by workshopName.
Example 1
Input
referenceDay: 100 Workshops: [W1, Royal Gold, GOLD], [W2, Silver Craft, SILVER] Defect Rates: W1 has 22% defect rate (standard 5% -> diff +17%) Delay Rates: W2 has 12% delay rate
Output
W1 Royal Gold CRITICAL W2 Silver Craft WARNING
Explanation
Workshop W1 exceeds gold tolerance by 17% (>= 15%), triggering CRITICAL risk. Workshop W2 has a 12% fulfilment delay rate, triggering WARNING risk.
Gain complete transparency into the Flipkart online assessment process. Prepare effectively with real, verified coding challenges, test patterns, and platform details.
Wondering what top companies are actually asking in their initial screening rounds? We provide exact Data Structures, Algorithms, and logical reasoning questions reported by candidates who recently took the Flipkart online tests. Stop guessing and start practicing the right problems.
Understand exactly how many questions to expect, the typical time limits, and the platforms used (e.g., HackerRank, Codility, CodeSignal). Knowing the format in advance is the first step to clearing the Flipkart OA.