Hiring Volume
- Total Hires: 300+ freshers
- SDE-1: 270+ selections
- Focus Areas: DSA, System Design, E-commerce domain knowledge
Download Flipkart placement papers 2024 PDF with previous year online assessment questions, solutions, and exam pattern analysis.
This page contains Flipkart placement papers from 2024 with previous year questions, solutions, and exam patterns.
| Section | Questions | Time | Difficulty |
|---|---|---|---|
| Coding Problems | 2-3 | 60 min | Medium-Hard |
| Debugging | 1 | 30 min | Medium |
This section contains real coding questions from Flipkart placement papers 2024 based on candidate experiences from GeeksforGeeks, LeetCode, and interview forums.
Problem: Given an array of integers, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
Example:
Input: [-2, 1, -3, 4, -1, 2, 1, -5, 4]Output: 6Explanation: [4, -1, 2, 1] has the largest sum = 6Solution (Java):
public int maxSubArray(int[] nums) { int maxSoFar = nums[0]; int maxEndingHere = nums[0];
for (int i = 1; i < nums.length; i++) { maxEndingHere = Math.max(nums[i], maxEndingHere + nums[i]); maxSoFar = Math.max(maxSoFar, maxEndingHere); }
return maxSoFar;}Time Complexity: O(n), Space Complexity: O(1)
Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution.
Example:
Input: nums = [2, 7, 11, 15], target = 9Output: [0, 1]Explanation: Because nums[0] + nums[1] == 9, we return [0, 1]Solution (Java):
public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) { int complement = target - nums[i]; if (map.containsKey(complement)) { return new int[]{map.get(complement), i}; } map.put(nums[i], i); }
return new int[]{};}Time Complexity: O(n), Space Complexity: O(n)
Problem: Given a string s, find the length of the longest substring without repeating characters.
Example:
Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3Solution (Java):
public int lengthOfLongestSubstring(String s) { Map<Character, Integer> map = new HashMap<>(); int maxLen = 0; int start = 0;
for (int end = 0; end < s.length(); end++) { char ch = s.charAt(end); if (map.containsKey(ch) && map.get(ch) >= start) { start = map.get(ch) + 1; } map.put(ch, end); maxLen = Math.max(maxLen, end - start + 1); }
return maxLen;}Time Complexity: O(n), Space Complexity: O(min(n, m)) where m is charset size
Problem: Merge two sorted linked lists and return it as a sorted list.
Example:
Input: list1 = [1,2,4], list2 = [1,3,4]Output: [1,1,2,3,4,4]Solution (Java):
public ListNode mergeTwoLists(ListNode list1, ListNode list2) { ListNode dummy = new ListNode(0); ListNode current = dummy;
while (list1 != null && list2 != null) { if (list1.val <= list2.val) { current.next = list1; list1 = list1.next; } else { current.next = list2; list2 = list2.next; } current = current.next; }
current.next = (list1 != null) ? list1 : list2; return dummy.next;}Time Complexity: O(n + m), Space Complexity: O(1)
Problem: Given a string s containing just the characters ’(’, ’)’, ', ', ’[’ and ’]’, determine if the input string is valid.
Example:
Input: s = "()[]{}"Output: trueSolution (Java):
public boolean isValid(String s) { Stack<Character> stack = new Stack<>();
for (char c : s.toCharArray()) { if (c == '(' || c == '{' || c == '[') { stack.push(c); } else { if (stack.isEmpty()) return false; char top = stack.pop(); if ((c == ')' && top != '(') || (c == '}' && top != '{') || (c == ']' && top != '[')) { return false; } } }
return stack.isEmpty();}Time Complexity: O(n), Space Complexity: O(n)
Problem: Given the root of a binary tree, return the level order traversal of its nodes’ values.
Example:
Input: root = [3,9,20,null,null,15,7]Output: [[3],[9,20],[15,7]]Solution (Java):
public List<List<Integer>> levelOrder(TreeNode root) { List<List<Integer>> result = new ArrayList<>(); if (root == null) return result;
Queue<TreeNode> queue = new LinkedList<>(); queue.offer(root);
while (!queue.isEmpty()) { int levelSize = queue.size(); List<Integer> currentLevel = new ArrayList<>();
for (int i = 0; i < levelSize; i++) { TreeNode node = queue.poll(); currentLevel.add(node.val);
if (node.left != null) queue.offer(node.left); if (node.right != null) queue.offer(node.right); }
result.add(currentLevel); }
return result;}Time Complexity: O(n), Space Complexity: O(n)
Problem: Debug the following code that rotates an array to the right by k positions.
Buggy Code:
public void rotate(int[] nums, int k) { k = k % nums.length; for (int i = 0; i < k; i++) { int temp = nums[nums.length - 1]; for (int j = nums.length - 1; j > 0; j--) { nums[j] = nums[j - 1]; } nums[0] = temp; }}Issues Found:
Optimized Solution:
public void rotate(int[] nums, int k) { k = k % nums.length; reverse(nums, 0, nums.length - 1); reverse(nums, 0, k - 1); reverse(nums, k, nums.length - 1);}
private void reverse(int[] nums, int start, int end) { while (start < end) { int temp = nums[start]; nums[start] = nums[end]; nums[end] = temp; start++; end--; }}Time Complexity: O(n), Space Complexity: O(1)
Hiring Volume
Salary Packages
Question Trends
Based on candidate experiences from 2024 Flipkart interviews:
2024 Interview Process:
Common 2024 Interview Topics:
2024 Interview Questions Examples:
Success Tips:
For detailed interview experiences, visit Flipkart Interview Experience page.
Practice 2024 papers to understand Flipkart’s pattern and prepare effectively!