Hike
80+ Startek Interview Questions and Answers
Q1. Design an photo viewing app which will show images from the disk in the list, and one item in the list should take half of the screen. (Android app design question, have to explain all the components used in it...
read moreAn Android photo viewing app with a list of images from disk, one taking half the screen.
Use RecyclerView to display the list of images
Use a custom adapter to bind the images to the RecyclerView
Use a GridLayoutManager with span count of 2 to achieve the half-screen effect
Load images from disk using a library like Glide or Picasso
Implement click listeners to handle item selection and display the selected image
Q2. Rearrange Linked List Problem Statement
Given a singly linked list in the form 'L1' -> 'L2' -> 'L3' -> ... 'Ln', your task is to rearrange the nodes to the form 'L1' -> 'Ln' -> 'L2' -> 'Ln-1', etc. You must not...read more
Q3. LRU Cache Design Question
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherwise, re...read more
Q4. Palindrome Permutation - Problem Statement
Determine if a permutation of a given string S
can form a palindrome.
Example:
Input:
string S = "aab"
Output:
"True"
Explanation:
The permutation "aba" of the string ...read more
Q5. Find Missing Number In String Problem Statement
You have a sequence of consecutive nonnegative integers. By appending all integers end-to-end, you formed a string S
without any separators. During this process, ...read more
Q6. You have to design screen in which at a time on screen 10 nearest restaurants will be shown in a list. The screen will keep adding more options while scrolling. Scroll in the list should be uninterrupted as pos...
read moreDesign a screen to show 10 nearest restaurants in a list with uninterrupted scrolling.
Use a RecyclerView to display the list of restaurants
Implement a custom adapter to populate the data in the list
Use a location service to get the user's current location
Sort the restaurants based on their distance from the user's location
Load more restaurants as the user scrolls to the end of the list
Q7. K Largest Elements Problem Statement
Given an unsorted array containing 'N' integers, you are required to find 'K' largest elements from the array and return them in non-decreasing order.
Input:
The first line ...read more
Q8. Reverse Words in a String: Problem Statement
You are given a string of length N
. Your task is to reverse the string word by word. The input may contain multiple spaces between words and may have leading or trai...read more
Q9. Minimum Number of Swaps to Sort an Array
Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.
Input:
T (number of test cases)
For each test case:
N (size of the...read more
Q10. Average Marks Problem Statement
Given the initial letter of a student's name and three integer marks for that student, calculate and display the student's initial letter followed by the integer part of their av...read more
Q11. Pair Sum in Binary Search Tree
Given a Binary Search Tree (BST) and a target value 'K', determine if there exist two unique elements in the BST such that their sum equals the target 'K'.
Explanation:
A BST is a...read more
Q12. You have application which shows list of all contacts, the Name/Numbers can be duplicated. How will you go on and do searching in this. Search term can either exist in Name or in Number.
To search for contacts with duplicate names or numbers, iterate through the list and compare each contact's name and number with the search term.
Iterate through the list of contacts
Compare the search term with each contact's name and number
Return the contacts that match the search term
Q13. Maximum Size Rectangle Sub-matrix with All 1's Problem Statement
You are provided with an N * M
sized binary matrix 'MAT' where 'N' denotes the number of rows and 'M' denotes the number of columns. Your task is...read more
Q14. Sorting of a Rotated Sorted Array Problem Statement
You are provided with a rotated sorted array of size N
. Your task is to sort the given array in increasing order.
Example:
Input:
N = 4
Array = [2, 3, 4, 1]
Ou...read more
Q15. You have application which shows list of all contacts, the Name can be duplicated, also it can contain duplicated numbers (0XXXXX, XXXXX etc). How will you go on and do searching in this. Search term can either...
read moreTo search for contacts with duplicate names and numbers, create a search function that checks both fields.
Create a function that takes a search term as input
Iterate through the list of contacts
Check if the search term exists in the Name field or Num field
Return the contacts that match the search term
Q16. Java/Android : Given an Object 'Ball'. How will you transfer this ball object from one thread to another. Same ball object pass from Thread to MainThread.
To transfer the Ball object from one thread to another, we can use Handler or AsyncTask.
Use Handler to post a Runnable to the main thread's message queue
Use AsyncTask to perform background operations and update the UI on the main thread
Pass the Ball object as a parameter or use a shared variable between threads
Q17. Next Greater Number Problem Statement
Given a string S
which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequency from...read more
Q18. Binary Tree Traversals
Your task is to compute the In-Order, Pre-Order, and Post-Order traversals for a given Binary Tree with 'N' nodes, where each node has an integer value.
Input:
T For each test case, the i...read more
Q19. Maximum Size Rectangle Sub-Matrix with All 1's
Given an N x M binary matrix 'MAT', where N is the number of rows and M is the number of columns, determine the maximum area of a submatrix consisting entirely of ...read more
Q20. Maximum Difference in Matrix
Given an n x n
matrix mat[n][n]
of integers, find the maximum value of mat[c][d] - mat[a][b]
for all possible indices where c > a
and d > b
.
Input:
The first line contains a single ...read more
Q21. Peak Element Finder
For a given array of integers arr
, identify the peak element. A peak element is an element that is greater than its neighboring elements. Specifically, if arr[i]
is the peak, then both arr[i...read more
Q22. Ninja and Sorted Array Merging Problem
Ninja is tasked with merging two given sorted integer arrays ARR1
and ARR2
of sizes 'M' and 'N', respectively, such that the merged result is a single sorted array within ...read more
Q23. Statistics From A Large Sample Task
Calculate various statistical measures given a large sample of integers in the range [0, 255]. For efficiency, you are provided with an array 'count' where the i-th element s...read more
Q24. If you were asked to make your own HashMap, how will you do it. (As it was used in the first question)
To create my own HashMap, I would use an array of linked lists to handle collisions and implement key-value pairs using a hash function.
Create an array of linked lists to store the key-value pairs
Implement a hash function to generate an index for each key
Handle collisions by adding elements to the linked list at the corresponding index
Support operations like put(key, value), get(key), and remove(key)
Q25. Maximum Sum Path in a Binary Tree
Your task is to determine the maximum possible sum of a simple path between any two nodes (possibly the same) in a given binary tree of 'N' nodes with integer values.
Explanati...read more
Q26. Binary Tree Maximum Path Sum Problem Statement
Determine the maximum path sum for any path in a given binary tree with 'N' nodes.
Note:
- A 'path' is defined as any sequence of adjacent nodes connected by an edg...read more
Q27. Prefix to Infix Conversion
Transform a string representing a valid Prefix expression, which may contain operators '+', '-', '*', '/', and uppercase letters, into its corresponding Infix expression.
Example:
Inp...read more
Q28. Level Order Traversal Problem Statement
Given a binary tree of integers, return the level order traversal of the binary tree.
Input:
The first line contains an integer 'T', representing the number of test cases...read more
Q29. You have to design screen in which at a time on screen 10 nearest restaurants will be shown in a list. How will you go on design this. (Need to keep UI as un interrupted as possible).
Design a screen to show 10 nearest restaurants in a list while keeping the UI uninterrupted.
Use a scrollable list view to display the restaurants
Implement a location-based search algorithm to find the nearest restaurants
Include a search bar to allow users to search for specific restaurants
Display relevant information for each restaurant such as name, rating, and distance
Implement filters or sorting options to allow users to customize the list
Consider using a map view to show ...read more
Q30. Number of Islands II Problem Statement
You have a 2D grid of dimensions 'N' rows by 'M' columns, initially filled with water. You are given 'Q' queries, where each query contains two integers 'X' and 'Y'. Durin...read more
Q31. Infix to Postfix Conversion
Convert a given infix expression, represented as a string EXP
, into its equivalent postfix expression.
Explanation:
An infix expression is formatted as a op b
where the operator is p...read more
Q33. Reverse Alternate Levels of a Perfect Binary Tree Problem Statement
Given a perfect binary tree consisting of 'N' nodes, reverse the nodes at alternate levels in the tree (i.e., reverse level 2, level 4, level ...read more
Q34. how does looper/handlers work internally when you pass object from one thread to another.
Looper/handlers allow passing objects between threads in Android.
Looper is a message loop that runs in a thread and processes messages from a message queue.
Handlers are used to send messages to the message queue of a looper.
When an object is passed from one thread to another using a handler, it is encapsulated in a message and added to the receiving thread's message queue.
The receiving thread's looper then processes the message and delivers it to the handler's callback method...read more
Q35. Given an array, which consist of natural numbers only. The elements are in random order, tell the first missing natural number in the array. e.g 4,6,3,1,6,8 o.p - 2 1,2,3 O/P - 4
Given an array of natural numbers, find the first missing natural number.
Sort the array and iterate through it to find the first missing number.
Use a hash set to keep track of the numbers present in the array.
The first missing number will be the smallest positive integer not present in the array.
Q36. Running Median Problem
Given a stream of integers, calculate and print the median after each new integer is added to the stream.
Output only the integer part of the median.
Example:
Input:
N = 5
Stream = [2, 3,...read more
Q37. Design a weather app. (One image for every weather is there on a server) Take care of half downloaded image, try not to consume data of user again.
A weather app that displays images for different weather conditions, taking care of half downloaded images and minimizing data consumption.
Implement image caching to store downloaded images locally
Check if the image is already downloaded before making a network request
Use a progress bar to indicate the download status of the image
Handle cases where the download is interrupted or incomplete
Implement a mechanism to resume the download from where it left off
Optimize image loadin...read more
Q38. Given an Object 'Ball'. How will you transfer this ball object from one thread to another in Android.
To transfer the Ball object from one thread to another in Android, we can use Handler or AsyncTask.
Use Handler to post the Ball object from one thread to another
Create a Handler in the receiving thread and use its post() method to receive the Ball object
Alternatively, use AsyncTask to perform the transfer in the background thread and update the UI thread with the Ball object
Q42. What are the different android components and concepts such as Recycler View, View Model, ANR and how do they function internally?
Android components like Recycler View, View Model, ANR are essential for building robust Android applications.
Recycler View: Efficient way to display large data sets by recycling views as they scroll off the screen.
View Model: Manages UI-related data in a lifecycle-conscious way, surviving configuration changes.
ANR (Application Not Responding): Dialog shown to the user when the main thread of an app is blocked for too long.
Understanding how these components work internally is...read more
Q45. Given a cartesian x-y plane and lot of points in that plane with x and y coordinates and 1 more point(say x,y) is given, so we have to find all the points in that plane which are lying in a radius of length r f...
read moreGiven a point and a radius, find all points in a cartesian plane within the radius.
Calculate the distance between the given point and all other points in the plane using the distance formula.
If the distance is less than or equal to the radius, add the point to the result set.
Return the result set of points within the radius of the given point.
Q46. Design the ImageDownloader, with efficiently handling parallel API calls.
ImageDownloader efficiently handles parallel API calls.
Use a thread pool to manage parallel API calls.
Implement caching to avoid redundant API calls.
Use a priority queue to prioritize image downloads.
Optimize network requests by using HTTP/2 or multiplexing.
Consider using a library like Picasso or Glide for image loading and caching.
Q48. How do you do DeepLinking in android.
Deep linking in Android allows users to navigate directly to specific content within an app.
Deep linking is achieved by defining intent filters in the app's manifest file.
The intent filter specifies the URL scheme and host that the app can handle.
When a deep link is clicked, Android checks if any app can handle the URL and prompts the user to choose.
The chosen app receives the deep link data in the intent's data field.
Deep linking can be used to open specific screens, perform...read more
Q49. how you will find out 3rd smallest element from an array
To find the 3rd smallest element from an array, sort the array and return the element at index 2.
Sort the array in ascending order
Return the element at index 2
If the array has less than 3 elements, return null
Q50. Design a photo viewer app (Technical architecture) for android device.
A photo viewer app for Android devices.
Use RecyclerView to display a grid of photos
Implement a caching mechanism to improve performance
Support gestures for zooming and swiping between photos
Integrate with a cloud storage service for photo storage and retrieval
Implement a search feature to allow users to find specific photos
Q54. What is STLC and how you work in different layers of it?
STLC stands for Software Testing Life Cycle. It is a process used to test software applications from planning to deployment.
STLC consists of phases like requirement analysis, test planning, test design, test execution, and test closure.
As a Senior Software Quality Engineer, I work in different layers of STLC by creating test plans, designing test cases, executing tests, and analyzing results.
I collaborate with developers, product managers, and other stakeholders to ensure hig...read more
Q55. What is Hr To manage business Hr basic rules? Processing, Planing, price
HR is the management of human resources to achieve business goals.
HR involves recruiting, training, and managing employees.
HR policies and procedures ensure compliance with laws and regulations.
HR also includes compensation and benefits management.
Effective HR planning can help organizations achieve their objectives.
HR analytics can provide insights into workforce trends and performance.
Q56. Designing a LRU Cache which is thread safe and can be scaled
Design a thread-safe LRU cache that can be scaled.
Use a ConcurrentHashMap to ensure thread safety.
Implement a doubly linked list to keep track of the least recently used items.
Use a HashMap to store the cache items for fast retrieval.
Implement a size limit for the cache and remove the least recently used item when the limit is reached.
To scale the cache, use a distributed cache like Redis or Memcached.
Q57. Write code to get maximum and second maximum element of a stack. The given function should be in O(1) complexity
Code to get max and second max element of a stack in O(1) complexity.
Create two variables to store max and second max values
Update the variables whenever a new element is pushed or popped from the stack
Return the max and second max values when required
Q58. Given a biotonic array ( first numbers increase and then decrease ) write code to search a given number. Time complexity O(logn)
Code to search a given number in a biotonic array with O(logn) time complexity.
Use binary search to find the peak element in the array.
Divide the array into two subarrays and perform binary search on each subarray.
Return the index of the element if found, else return -1.
Q60. Launch Mode of Activity in Android
Launch mode determines how a new instance of an activity is created and added to the task stack.
Standard: Creates a new instance of the activity each time it is launched.
SingleTop: If an instance of the activity already exists at the top of the stack, it will be reused.
SingleTask: If an instance of the activity already exists in the stack, it will be brought to the front and cleared of any activities above it.
SingleInstance: The activity will be launched in a new task and no ...read more
Q61. How does Stack work internally and what data it holds?
Stack is a data structure that follows LIFO (Last In First Out) principle.
Stack holds a collection of elements
It has two main operations: push (adds element to top) and pop (removes element from top)
It also has peek operation (returns top element without removing it)
Stack can be implemented using arrays or linked lists
Examples: undo-redo functionality in text editors, back-forward navigation in web browsers
Q63. Launch Mode of Activity.
Launch mode determines how an activity is launched and how it behaves in the task stack.
Standard: Creates a new instance of the activity on each launch.
SingleTop: Reuses the existing instance if it's already at the top of the stack.
SingleTask: Creates a new task and places the activity at the root of the task.
SingleInstance: Creates a new task and places the activity as the only one in the task.
Q64. Experience on huge infrastructure, how to make decisions of scaling, performance and availability?
Scaling, performance, and availability decisions on huge infrastructure require a data-driven approach.
Analyze data on usage, traffic, and resource utilization to identify bottlenecks and areas for improvement.
Consider the impact of scaling on cost, user experience, and maintenance.
Implement monitoring and alerting systems to quickly identify and address issues.
Use load testing and performance profiling to optimize system performance.
Implement redundancy and failover mechanis...read more
Q65. A sorted array is rotated K times. Sort it in o(n) traversal without extra space
Sort a rotated sorted array in O(n) time without extra space
Find the index of the minimum element using binary search
Reverse the two subarrays on either side of the minimum element
Reverse the entire array
Example: [4,5,6,7,0,1,2] -> [0,1,2,4,5,6,7]
Q66. do you know spell checker in micro soft word
Yes, spell checker is a built-in feature in Microsoft Word.
Spell checker automatically checks for spelling errors as you type.
It underlines misspelled words in red and suggests corrections.
You can also customize the spell checker settings and add words to the dictionary.
To access the spell checker, go to the Review tab and click on Spelling & Grammar.
Alternatively, you can use the shortcut key F7 to run the spell checker.
Q68. Write the test cases regarding Facebook posts and set their priorities.
Test cases for Facebook posts with priorities
Verify that a user can create a new post
Check that a user can edit their own post
Ensure that a user can delete their own post
Test that a user can like a post
Verify that a user can comment on a post
Q69. Write the test cases to delete a node from a linked list
Test cases to delete a node from a linked list
Test deleting the first node in the linked list
Test deleting a node in the middle of the linked list
Test deleting the last node in the linked list
Test deleting a node that does not exist in the linked list
Q70. two pair with a given sum in a bst with o(log n) space
Finding two pairs with a given sum in a BST using O(log n) space.
Traverse the BST in-order and store the nodes in an array
Use two pointers approach to find the pairs with the given sum
Time complexity: O(n), Space complexity: O(log n)
Optimized approach: Use two stacks to traverse the BST in-order and find the pairs
Time complexity: O(log n), Space complexity: O(log n)
Q71. K random numbers from infinite stream of array with equal probability
To select k random numbers from an infinite stream of array with equal probability.
Use reservoir sampling algorithm to randomly select k numbers from the stream
Maintain a reservoir array of size k to store the selected numbers
For each incoming number, generate a random number between 0 and the total count of numbers seen so far
If the generated number is less than k, replace the corresponding number in the reservoir array with the incoming number
At the end, the reservoir array...read more
Q72. How to debug a full functionality of an API
Debugging a full functionality of an API involves thorough testing, logging, and using debugging tools.
Start by reviewing the API documentation to understand its functionality and expected behavior.
Write test cases to cover all possible scenarios and edge cases.
Use logging to track the flow of data and identify any issues.
Utilize debugging tools like Postman, Swagger, or browser developer tools to inspect API requests and responses.
Check for error messages and status codes to...read more
Q73. How to analyze usage history of a application
Usage history of an application can be analyzed by tracking user actions and behavior.
Collect data on user interactions with the application
Analyze the frequency and duration of usage
Identify patterns and trends in user behavior
Use data visualization tools to present findings
Consider user feedback and reviews for additional insights
Q74. How would you launch a new onboarding experience UI
I would launch a new onboarding experience UI by conducting user research, designing a user-friendly interface, testing with a small group, and gradually rolling out to all users.
Conduct user research to understand user needs and pain points
Design a user-friendly interface with clear instructions and intuitive navigation
Test the new onboarding experience with a small group of users to gather feedback and make improvements
Gradually roll out the new UI to all users while monito...read more
Q76. Methods of IPC in android.
IPC (Inter-Process Communication) methods in Android allow communication between different processes.
Binder: Android's default IPC mechanism, provides high-performance communication between processes.
AIDL (Android Interface Definition Language): Used to define the programming interface for IPC using Binder.
Intents: Used for asynchronous communication between components within an application or between different applications.
Content Providers: Allow sharing data between applic...read more
Q77. Implement Inorder Traversal with and without using recursion
Inorder Traversal can be implemented using recursion or without recursion.
Inorder Traversal using recursion involves traversing the left subtree, visiting the root node, and then traversing the right subtree.
Inorder Traversal without recursion involves using a stack to keep track of the nodes to be visited.
For each node, push it onto the stack and traverse its left subtree until there are no more left nodes.
Pop the top node from the stack, visit it, and then traverse its righ...read more
Q78. Designing a file sharing mechanism between two users
Design a file sharing mechanism between two users
Use a secure protocol like HTTPS or SFTP
Implement access control to ensure only authorized users can access the files
Consider implementing encryption to protect the files during transit and at rest
Provide a user-friendly interface for uploading and downloading files
Implement version control to track changes made to the files
Consider implementing a notification system to alert users of new file uploads or changes
Q79. Write the Test Cases about Amazon Gift Card
Test cases for Amazon Gift Card
Verify that the gift card balance is correctly displayed
Test redeeming a gift card code
Check if multiple gift cards can be applied to a single purchase
Ensure that expired gift cards are not accepted
Test the functionality of sending a gift card to someone else
Q80. Reverse alternate levels of a binary tree
Reverse alternate levels of a binary tree
Traverse the tree level by level
Reverse the nodes of alternate levels
Use a queue or stack to keep track of nodes at each level
Recursively apply the same process to the children of reversed nodes
Q81. Implement an LRU cache
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a hashmap to store key-value pairs for quick access
Use a doubly linked list to keep track of the order of items based on their usage
When an item is accessed, move it to the front of the list
When the cache is full, remove the least recently used item from the end of the list
Q82. Why manhole is round ?
Manholes are round because it prevents them from falling into the hole and allows for easy movement of the cover.
Round covers cannot fall into the hole as they cannot fit through diagonally
Round covers can be easily moved in any direction
Round shape distributes weight evenly
Round shape is easier to manufacture and install
Q83. Explain the architecture of transformer models.
Q84. Median of a stream of array
Finding the median of a stream of array in real-time.
Use two heaps to keep track of the median
Maintain a max heap for the lower half and a min heap for the upper half
If the heaps are balanced, the median is the average of the top elements of both heaps
If the heaps are unbalanced, the median is the top element of the heap with more elements
Q85. Largest vertical rectangle in array
Find the largest vertical rectangle in an array of strings
Iterate through each column in the array
For each column, find the consecutive vertical rectangles of '1's
Calculate the area of each rectangle and keep track of the largest one
Q86. Sell a water bottle
Stay hydrated on the go with our durable and stylish water bottle.
Highlight the durability of the water bottle
Emphasize the convenience of staying hydrated while on the go
Mention the stylish design to appeal to fashion-conscious customers
Q87. Sell a laptop cover
Protect your laptop in style with our sleek and durable laptop cover.
Made from high-quality materials to ensure maximum protection
Available in various sizes to fit different laptop models
Stylish designs to suit your personal taste
Easy to clean and maintain for long-lasting use
Interview Process at Startek
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month