Add office photos
Employer?
Claim Account for FREE

Samsung Research

3.2
based on 992 Reviews
Video summary
Filter interviews by

Paras Super Mart Interview Questions and Answers

Updated 25 Jun 2024
Popular Designations

Q1. Batch Photography Problem

Alex has acquired a machine that can photocopy photos in batches of a minimum size 'K'. Given 'N' photos with resolutions represented in an integer array photos, the machine produces a...read more

Ans.

Minimize maximum error by splitting photos into batches of size at least 'K'.

  • Sort the array of resolutions in ascending order.

  • Iterate through the array and calculate the error for each possible batch.

  • Return the minimum possible maximum error found.

Add your answer
Q2. ...read more

Array Sum Calculation

Calculate the sum of all elements in an array of length N.

Input:

Line 1: An integer N indicating the size of the array.
Line 2: N integers, the elements of the array, separated by spaces.
Ans.

Calculate the sum of all elements in an array of length N.

  • Iterate through the array and add each element to a running sum.

  • Return the final sum as the output.

Add your answer

Q3. The Skyline Problem

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette when viewed from a distance. Each building is descri...read more

Ans.

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette.

  • Iterate through the buildings and create a list of critical points (x, y) where the height changes.

  • Sort the critical points based on x-coordinate and process them to generate the skyline.

  • Merge consecutive horizontal segments of equal height to ensure no duplicates in the output.

Add your answer

Q4. Sort 0 1 2 Problem Statement

Given an integer array arr of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.

Input:

The first line contains an integer 'T' representing the number of...read more
Ans.

Sort an integer array containing only 0s, 1s, and 2s in linear time complexity.

  • Use three pointers to keep track of the positions of 0s, 1s, and 2s in the array.

  • Iterate through the array and swap elements based on the values encountered.

  • Maintain left pointer for 0s, right pointer for 2s, and current pointer for traversal.

  • Example: If current element is 0, swap it with element at left pointer and increment both pointers.

  • Example: If current element is 2, swap it with element at r...read more

Add your answer
Discover Paras Super Mart interview dos and don'ts from real experiences

Q5. MergeSort Linked List Problem Statement

You are given a Singly Linked List of integers. Your task is to sort the list using the 'Merge Sort' algorithm.

Input:

The input consists of a single line containing the ...read more
Ans.

Sort a Singly Linked List using Merge Sort algorithm.

  • Implement the Merge Sort algorithm for linked lists.

  • Divide the list into two halves, sort each half recursively, then merge them.

  • Use a fast and slow pointer to find the middle of the list for splitting.

  • Handle the base case of a single node or empty list.

  • Example: Input: 4 3 2 1 -1, Output: 1 2 3 4

Add your answer

Q6. Ninja and Alien Language Order Problem

An alien dropped its dictionary while visiting Earth. The Ninja wants to determine the order of characters used in the alien language, based on the given list of words fro...read more

Ans.

Determine the order of characters in an alien language based on a list of words.

  • Create a graph where each character is a node and there is a directed edge from character 'a' to character 'b' if 'a' comes before 'b' in any word.

  • Perform a topological sort on the graph to get the order of characters.

  • Return the order as a string in lexicographical order.

Add your answer

Q7. Trie Implementation

Ans.

Trie is a tree data structure used for efficient retrieval of key-value pairs.

  • Trie is also known as prefix tree.

  • Each node in a trie represents a single character of a key.

  • Trie is commonly used in autocomplete and spell checking algorithms.

  • Example: Inserting 'apple' and 'app' into a trie would result in a structure where 'app' is a prefix of 'apple'.

Add your answer

Q8. LRU Implementation

Ans.

LRU (Least Recently Used) is a cache eviction policy that removes the least recently used items first.

  • LRU cache stores key-value pairs with a maximum capacity.

  • When the cache is full, the least recently used item is removed to make space for new items.

  • Each time a key is accessed, it is moved to the front of the cache to indicate it was recently used.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Paras Super Mart

based on 7 interviews
2 Interview rounds
Coding Test Round
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.2
 • 35 Interview Questions
3.0
 • 25 Interview Questions
3.7
 • 23 Interview Questions
4.2
 • 23 Interview Questions
3.5
 • 14 Interview Questions
3.7
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter