i
Apple
Filter interviews by
I appeared for an interview in May 2021.
Round duration - 45 minutes
Round difficulty - Medium
This round was scheduled in the morning hours from 10:30 to 11:15 AM. I was informed about the round 2 days earlier through an e-mail and a phone call both.
Ninja, a boy from Ninjaland, receives 1 coin every morning from his mother. He wants to purchase exactly 'N' candies. Each candy usually costs 2 coins, but it is available for 1 ...
Calculate the earliest day on which Ninja can buy all candies given the number of candy types, special offers, and Ninja's candy preferences.
Iterate through each day and check if any special offers are available for the candies Ninja wants to buy.
Keep track of the remaining candies Ninja needs to buy and the coins he has each day.
Consider both regular price and sale price while making purchases.
Return the earliest day
Round duration - 45 minutes
Round difficulty - Hard
After the first round, some candidates were shortlisted and I was one of them which was scheduled 2 days later at the same time.
You are provided with ‘N’ types of umbrellas, where each umbrella type can shelter a certain number of people. Given an array UMBRELLA
that indicates the number of people each um...
Given 'N' types of umbrellas with different capacities, find the minimum number of umbrellas required to shelter exactly 'M' people.
Iterate through the umbrella capacities and try to cover 'M' people using the minimum number of umbrellas.
Keep track of the total number of people covered and the number of umbrellas used.
If it is not possible to cover 'M' people exactly, return -1.
Return the minimum number of umbrellas re
It's Christmas and Santa has 'K' gifts to distribute. There are 'N' children standing in a straight line in the park due to COVID restrictions. You are given an array distance
...
Find the minimum distance Santa must travel to distribute 'K' gifts to 'K' different children standing in a straight line.
Sort the array 'distance' to easily calculate the minimum distance Santa has to walk.
Calculate the difference between adjacent elements in the sorted array and sum the first 'K-1' differences to get the minimum distance.
Return the minimum distance Santa has to walk for each test case.
Round duration - 30 minutes
Round difficulty - Medium
It was a simple conversation, no shortlisting was done here, all of the students who passed the previous round were offered the role.
Tip 1 : Aptitude is must.
Tip 2 : Practice puzzle problems.
Tip 3 : Do atleast 2 projects.
Tip 1 : projects should be well mentioned
Tip 2 : also don't forget to mention your grades of all academic levels
I appeared for an interview in Mar 2021.
Round duration - 45 minutes
Round difficulty - Hard
Interview was conducted at zoom in the evening hours.
Given an array of positive integers, determine the Greatest Common Divisor (GCD) of a pair of elements such that it is the maximum among all possible pairs in the array. The...
Find the maximum GCD of a pair of elements in an array of positive integers.
Iterate through all pairs of elements in the array to find their GCD.
Keep track of the maximum GCD found so far.
Use Euclidean algorithm to calculate GCD efficiently.
Return the maximum GCD value found.
Kevin has 'N' buckets, each consisting of a certain number of fruits. Kevin wants to eat at least 'M' fruits. He is looking to set a marker as high as possible such ...
Find the marker value needed for Kevin to eat at least 'M' fruits from 'N' buckets.
Iterate through each test case and calculate the marker value needed based on the number of fruits in each bucket.
Subtract the marker value from the number of fruits in each bucket and check if the total is at least 'M'.
Return the highest possible marker value for each test case.
Round duration - 30 minutes
Round difficulty - Medium
This round was scheduled in the morning hours from 10:30 to 11 am. The interviewer was cool-minded and I really enjoyed talking to him.
Tip 1 : Data structures and algorithms are the most fundamental and important thing to prepare.
Tip 2 : Don't ignore OOPS.
Tip 3 : Solve DSA questions regularly.
Tip 1 : Avoid unnecessary details like hobbies, date of birth, parent's name, photo, etc., and keep it one-pager.
Tip 2 : Add a link to your GitHub, LinkedIn, website, phone number, etc.
Top trending discussions
I applied via Naukri.com and was interviewed before Jun 2021. There were 2 interview rounds.
Networking and linux internals
I appeared for an interview before Oct 2020.
Round duration - 120 Minutes
Round difficulty - Medium
Round 1 was of 2 hours duration. 1 hour for MCQs (60 MCQs) and 1 hour for coding questions(3 Coding Questions). MCQs were aptitude based (Verbal + Data Interpretation + Quantitative Aptitude).
Given a singly linked list of integers, return the head of the reversed linked list.
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed link...
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Bob and his wife are in the famous 'Arcade' mall in the city of Berland. This mall has a unique way of moving between shops using trampolines. Each shop is laid out in a st...
Find the minimum number of trampoline jumps Bob needs to make to reach the final shop, or return -1 if it's impossible.
Use Breadth First Search (BFS) to find the minimum number of jumps needed.
Keep track of the visited shops to avoid revisiting them.
If a shop has an Arr value of 0, it is impossible to reach the last shop.
Return -1 if the last shop cannot be reached.
Tip 1 : Revise properly
Tip 2 : Strong DS algo
Tip 3 : try all the standard question of each topic
Tip 1 : One page
Tip 2 : 2-3 projects
Tip 3 : Mention your achivemnts
Tip 4 : mention your cgpa
I appeared for an interview before Nov 2020.
Round duration - 150 Minutes
Round difficulty - Medium
Have to attempt 2 programming questions within 2:30 hours. Can take any time over the weekend. Relatively easy problems. Questions were long, but the solution code was small.
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 ...
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.
You are given a Singly Linked List of integers. Your task is to sort the list using the 'Merge Sort' algorithm.
The input consists of a single line contain...
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
Round duration - 240 Minutes
Round difficulty - Medium
Had to solve 1 programming question in 4 hours. It was in the morning on a weekend. The environment was not so good. It was a small institute and got very crowded. The platform was also buggy. but the question was not difficult. Was able to solve it in just 1 hour and leave.
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 prod...
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.
Round duration - 30 Minutes
Round difficulty - Easy
It was in the afternoon. The interviewer basically asked me what technologies I have worked on. Checked my knowledge of those technologies with simple questions. Told me what I'll be working on if I get selected.
Given an integer array arr
of size 'N' containing only 0s, 1s, and 2s, write an algorithm to sort the array.
The first line contains an integer 'T' representing the n...
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.
E...
Round duration - 90 Minutes
Round difficulty - Hard
It was also in the afternoon. The interviewer was the member of the team I'll be working on if I get selected. He asked me some basic questions about related technologies.
Gave me 2-3 DS & Algo problems and asked me to solve them.
Calculate the sum of all elements in an array of length N
.
Line 1: An integer N indicating the size of the array.
Line 2: N integers, the elements of the array, separated by ...
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.
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 wor...
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.
Tip 1 : It's a Daily process. Not weekly, Not monthly. DAILY!
Tip 2 : Take part in Online Contests. HackerEarth is best for Contests posted by companies.
Tip 3 : Even after you have solved some problem, try to find a better solution for it online. Companies don't want a solution, they want optimized solution.
Tip 1 : Modify resume for each job you are applying for. It should show why you are suitable for that particular job.
Tip 2 : Remove any extra things like interests and hobbies. No one cares.
Balloon Burst Problem - Given n balloons, each with a number of coins, maximize the number of coins collected by bursting the balloons.
Use dynamic programming to solve the problem
Consider each balloon as the last balloon to be burst
Calculate the maximum coins that can be collected for each subarray of balloons
Use the calculated values to find the maximum coins for the entire array
I appeared for an interview before Jan 2021.
Round duration - 120 Minutes
Round difficulty - Hard
This round had 3 preety good questions to be solved under 2 hours . The first question was from Graphs and DSU , the second question was related to DP and the third one was from Recursion.
On a 2-D plane, there are ‘N’ stones placed at some integer coordinate points. Each coordinate point can have at most one stone. A stone can be removed if it sh...
Given a 2-D plane with stones at integer coordinate points, find the maximum number of stones that can be removed by sharing the same row or column.
Iterate through the stones and create a graph where stones in the same row or column are connected.
Use depth-first search (DFS) to find connected components in the graph.
The maximum number of stones that can be removed is the total number of stones minus the number of conne
You are provided with a gold mine, represented as a 2-dimensional matrix of size N x M with N rows and M columns. Each cell in this matrix contains a positive integer represent...
The task is to determine the maximum amount of gold a miner can collect by moving in allowed directions in a gold mine represented as a 2D matrix.
Create a 2D DP array to store the maximum gold collected at each cell
Iterate through the matrix from left to right and update the DP array based on the allowed directions
Return the maximum value in the last column of the DP array as the final result
Given a positive integer N
, generate all possible sequences of balanced parentheses using N
pairs of parentheses.
A sequence of brackets is called bala...
Generate all possible sequences of balanced parentheses using N pairs of parentheses.
Use backtracking to generate all possible combinations of balanced parentheses.
Keep track of the number of opening and closing parentheses used.
Add opening parentheses if there are remaining, and add closing parentheses only if there are more opening parentheses than closing.
Recursively generate all valid combinations.
Return the list o
Round duration - 60 Minutes
Round difficulty - Medium
This round had 2 questions from DSA. Both the questions were preety straightforward and were asked to check my implementation skills and how well do I handle Edge Cases for tricky problems.
Develop a Stack Data Structure to store integer values using two Queues internally.
Your stack implementation should provide these public functions:
Implement a stack using two queues to store integer values.
Use two queues to simulate stack operations: push elements to one queue, then move all elements to the other queue to simulate pop and top operations.
Maintain the size of the stack and check for empty stack using the size of the queues.
Handle edge cases such as popping or getting top element from an empty stack.
Ensure the implementation follows the specified pu...
Given a square matrix 'MATRIX' of non-negative integers, rotate the matrix by 90 degrees in an anti-clockwise direction using only constant extra space.
Rotate a square matrix by 90 degrees in an anti-clockwise direction using constant extra space.
Iterate through each layer of the matrix and swap elements in groups of 4
Transpose the matrix and then reverse each row to achieve the rotation
Ensure to handle edge cases like odd-sized matrices
Round duration - 60 Minutes
Round difficulty - Medium
This round also had 2 questions related to DSA where I was first expected to explain my approaches and then discuss the time and space complexities of my solution. After that , I was asked some core concepts related to OOPS and OS.
Given an array ARR
consisting of N
integers, find all distinct triplets in the array that add up to a given number K
.
T = 2
N = 5
ARR = [1, 2, 3, 4, 5]
K = 9
N = 4
...
Find all distinct triplets in an array that add up to a given number.
Use three nested loops to iterate through all possible triplets.
Sort the array first to easily skip duplicates.
Use two-pointer technique to find the remaining element for each triplet.
Handle edge cases like empty list or no triplet summing up to K.
You are given a long type array/list ARR
of size N
, representing an elevation map. The value ARR[i]
denotes the elevation of the ith
bar. Your task is to determine th...
Calculate the total amount of rainwater that can be trapped between given elevations in an array.
Iterate through the array and calculate the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped at each bar by taking the minimum of the maximum heights on the left and right.
Sum up the trapped water at each bar to get the total trapped water for the entire array.
Diamond Problem is a multiple inheritance issue in C++ where a class inherits from two classes that have a common base class.
Diamond Problem occurs when a class inherits from two classes that have a common base class, leading to ambiguity in accessing members.
It can be resolved in C++ using virtual inheritance, where the common base class is inherited virtually to avoid duplicate copies of base class members.
Example: c...
Thrashing in operating systems occurs when the system is spending more time swapping data between memory and disk than actually executing tasks.
Occurs when the system is constantly swapping data between memory and disk
Causes a decrease in system performance as it spends more time on swapping than executing tasks
Usually happens when the system does not have enough physical memory to handle the workload efficiently
Round duration - 30 Minutes
Round difficulty - Easy
This was my last round and I hoped it to go good just like the other rounds. The interviewer was very straight to point and professional. The interview lasted for 30 minutes.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I appeared for an interview before Sep 2020.
Round duration - 60 minutes
Round difficulty - Easy
The round was taken on Cocubes platform with video enabled . The time I chose was 3:00 P.M.
Given a linked list where each node contains a single digit, your task is to construct the largest possible number using these digits.
Print ...
Given a linked list of single digits, construct the largest number possible.
Traverse the linked list to extract the digits
Sort the digits in descending order
Concatenate the sorted digits to form the maximum number
Round duration - 60 Minutes
Round difficulty - Medium
The coding problems were medium and it was held online on Cocubes at 4:00 PM
Given a binary tree with 'N' nodes, identify the path from a leaf node to the root node that has the maximum sum among all root-to-leaf paths.
All the possibl...
Find the path from a leaf node to the root node with the maximum sum in a binary tree.
Traverse the binary tree from leaf to root while keeping track of the sum of each path.
Compare the sums of all paths and return the path with the maximum sum.
Use recursion to traverse the tree efficiently.
Consider negative values in the tree when calculating the sum of paths.
Determine if a given graph is bipartite. A graph is considered bipartite if its vertices can be divided into two disjoint sets, 'U' and 'V', such that every edge connects a vertex in...
Check if a given graph is bipartite by dividing its vertices into two disjoint sets.
Create two sets 'U' and 'V' to divide the vertices
Check if every edge connects vertices from different sets
Use graph traversal algorithms like BFS or DFS to determine bipartiteness
Tip 1 : Prepare OS, DBMS and OOPs also
Tip 2 : Do Competitive Coding Contest from CodeForces.
Tip 3 : Do leetcode 2 months before interviews.
Tip 1 : Have some good coding profiles on various platforms
Tip 2 : Mention some projects or past experience relevant to your stream
I appeared for an interview in May 2017.
String is immutable because it ensures data integrity and allows for efficient memory management.
Immutable strings prevent accidental modification of data.
Immutable strings can be easily shared and reused, improving memory efficiency.
Immutable strings enable efficient string interning and caching.
Immutable strings support thread safety in concurrent environments.
Yes, @RequestParam has a default value if not specified.
If a @RequestParam is not provided in the request, it will use its default value.
The default value can be set using the 'defaultValue' attribute of @RequestParam annotation.
If no default value is specified, the parameter will be considered as required and an exception will be thrown if not provided.
Abstract classes are required to provide a common interface and share code among related classes.
Abstract classes allow for code reusability and promote modular design.
They provide a common interface for a group of related classes.
Abstract classes can define abstract methods that must be implemented by subclasses.
They can also provide default implementations for common methods.
Abstract classes cannot be instantiated, b
based on 1 review
Rating in categories
Software Engineer
194
salaries
| ₹18 L/yr - ₹61.1 L/yr |
Ipro
108
salaries
| ₹2 L/yr - ₹5 L/yr |
Software Developer
107
salaries
| ₹29.4 L/yr - ₹47 L/yr |
Sales Executive
104
salaries
| ₹1.6 L/yr - ₹5 L/yr |
Senior Software Engineer
89
salaries
| ₹15.9 L/yr - ₹60 L/yr |
Amazon
Microsoft Corporation
Samsung