Specialist Programmer
70+ Specialist Programmer Interview Questions and Answers

Asked in Infosys

Q. Find the first occurrence of the target value in a sorted array. (Duplicates are allowed)
Find the first occurrence of target value in a sorted array with duplicates.
Use binary search to find the target value.
If found, check if the previous element is also the target value.
If not, return the index of the target value.
If yes, continue binary search on the left subarray.

Asked in Infosys

Q. Given an array with positive and negative integers, find the maximum subarray sum.
Find the maximum subarray sum in an array with positive and negative integers.
Use Kadane's algorithm to find the maximum subarray sum.
Initialize two variables, one for current maximum and one for global maximum.
Iterate through the array and update the variables accordingly.
Return the global maximum.
Example: [-2, 1, -3, 4, -1, 2, 1, -5, 4] returns 6 (subarray [4, -1, 2, 1])
Specialist Programmer Interview Questions and Answers for Freshers

Asked in Infosys

Q. Which process scheduling algorithms do you know, and can you explain each one?
Process scheduling algorithms determine the order in which processes are executed by the CPU.
First Come First Serve (FCFS) - Processes are executed in the order they arrive.
Shortest Job Next (SJN) - Process with the shortest burst time is executed next.
Round Robin (RR) - Each process is assigned a fixed time slice for execution.
Priority Scheduling - Processes are executed based on priority levels assigned to them.
Multi-Level Queue Scheduling - Processes are divided into diffe...read more

Asked in Infosys

Q. What is deadlock in OS and how can it be overcome?
Deadlock in OS occurs when two or more processes are unable to proceed because each is waiting for the other to release a resource.
Deadlock happens when processes have acquired resources but are waiting for additional resources that are held by other processes.
Four conditions must hold for deadlock to occur: mutual exclusion, hold and wait, no preemption, and circular wait.
Deadlock can be prevented by using techniques like resource allocation graphs, deadlock detection algori...read more

Asked in Infosys

Q. Write a SQL query to print the nth highest salary with full details.
SQL query to retrieve the n'th highest salary with full details
Use the ORDER BY clause to sort salaries in descending order
Use the LIMIT clause to retrieve the n'th highest salary
Join with the employee table to get full details

Asked in Infosys

Q. Describe how you would design a path for visiting all the popular places in your city.
Design a path for visiting all popular places of your city.
Identify all popular places in the city
Group them based on their proximity to each other
Create a route that covers all groups in an efficient manner
Consider transportation options and time of day
Include breaks for meals and rest
Test the route to ensure it is feasible and enjoyable
Specialist Programmer Jobs




Asked in Infosys

Q. What are the types of joins in DBMS, and can you explain each one?
Joins in DBMS are used to combine rows from two or more tables based on a related column between them.
Inner Join: Returns rows when there is at least one match in both tables.
Left Join: Returns all rows from the left table and the matched rows from the right table.
Right Join: Returns all rows from the right table and the matched rows from the left table.
Full Outer Join: Returns rows when there is a match in one of the tables.
Self Join: Joining a table with itself to combine r...read more

Asked in Infosys

Q. What is inheritance, and can you explain each type?
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Types of inheritance: single inheritance, multiple inheritance, multilevel inheritance, hierarchical inheritance, hybrid inheritance
Single inheritance: a class inherits from only one base class
Multiple inheritance: a class inherits from multiple base classes
Multilevel inheritance: a class inherits from a class which in turn inherits from another class
Hier...read more
Share interview questions and help millions of jobseekers 🌟

Asked in Infosys

Q. What are late binding and early binding?
Late binding and early binding are concepts in programming related to when the binding of a method to its implementation occurs.
Early binding refers to the process of linking a method call to the method implementation at compile time.
Late binding refers to the process of linking a method call to the method implementation at runtime.
Early binding is also known as static binding, while late binding is also known as dynamic binding.
Late binding allows for more flexibility and ex...read more

Asked in Infosys

Q. Write a code to convert camel casing to snake casing and vice versa.
Code to convert camel casing to snake casing and vice versa.
For camel to snake case, iterate through the string and add '_' before every uppercase letter except the first one.
For snake to camel case, iterate through the string and remove '_' and capitalize the letter after it.
Handle edge cases like consecutive uppercase letters or underscores in the input string.
Use built-in string functions like split(), join(), and replace() for efficient implementation.

Asked in Infosys

Q. Write a memory sorting code given 3 RAMs and the quantity of data present in them.
Sorting code for given 3 RAMs and data quantity
Determine the size of each RAM and the quantity of data in them
Choose a sorting algorithm based on the size of data and available RAM
Divide the data into chunks that can fit into the available RAM
Sort each chunk using the chosen algorithm
Merge the sorted chunks into a single sorted list

Asked in Infosys

Q. Design a promise wrapper that accepts two parameters: a promise function and an integer timeout value. If the promise function resolves before the timeout, resolve it; otherwise, reject it.
Design a promise wrapper with timeout for resolving or rejecting a promise function.
Create a function that takes a promise function and timeout value as parameters.
Inside the function, create a new Promise that wraps the original promise function.
Use Promise.race to race between the original promise and a timeout promise.
If the original promise resolves before timeout, resolve the wrapper promise with the result.
If the original promise rejects or the timeout occurs first, rej...read more

Asked in Infosys

Q. Given a time and date API, how would you display the time on screen and update it every second like a clock using React?
Create a React component that displays the current time and updates every second like a clock.
Use React's useState to manage the current time state.
Use useEffect to set up an interval that updates the time every second.
Format the time using toLocaleTimeString for better readability.
Clear the interval on component unmount to prevent memory leaks.

Asked in Infosys

Q. Why is virtual DOM manipulation faster than actual DOM manipulation in React?
Virtual DOM manipulation is faster in React due to its ability to batch updates and minimize actual DOM operations.
Virtual DOM allows React to batch multiple updates into a single operation, reducing the number of actual DOM manipulations needed.
React compares the virtual DOM with the actual DOM and only updates the parts that have changed, instead of re-rendering the entire DOM.
Virtual DOM operations are performed in memory, which is faster than directly manipulating the act...read more

Asked in Infosys

Q. What are three drawbacks of pandas, what are middleware, CDNs etc
Three drawbacks of pandas are performance issues with large datasets, limited visualization capabilities, and lack of built-in support for time series analysis.
Performance can be slow with large datasets due to pandas being memory intensive
Limited visualization capabilities compared to tools like Matplotlib or Seaborn
Lack of built-in support for time series analysis, requiring additional libraries like Statsmodels or Prophet

Asked in Infosys

Q. Can you describe the cloud processes you have utilized in your work?
I have utilized various cloud processes including deployment, data storage, and serverless computing in my projects.
Implemented CI/CD pipelines using AWS CodePipeline for automated deployments.
Utilized AWS S3 for scalable data storage and backup solutions.
Developed serverless applications using AWS Lambda to reduce infrastructure management.
Leveraged Azure Functions for event-driven processing in real-time applications.
Used Google Cloud Pub/Sub for asynchronous messaging betw...read more

Asked in Infosys

Q. What is a Binary Search Tree, and how does it function?
A Binary Search Tree (BST) is a data structure that maintains sorted order for efficient searching, insertion, and deletion.
A BST is a tree where each node has at most two children.
The left child contains values less than the parent node.
The right child contains values greater than the parent node.
Example: Inserting 10, 5, 15 results in a tree with 10 as root, 5 as left child, and 15 as right child.
Searching for a value starts at the root and traverses left or right based on ...read more

Asked in Infosys

Q. Write a program to print the frequencies of elements in an array.
Program to print frequencies of elements in an array.
Create a dictionary to store the frequency of each element.
Iterate through the array and update the frequency in the dictionary.
Print the dictionary to display the frequency of each element.

Asked in Infosys

Q. How would you apply Dijkstra's Algorithm in a real-life scenario?
Dijkstra's Algorithm finds the shortest path in graphs, useful for navigation, logistics, and network routing.
1. Navigation Systems: Used in GPS to find the shortest route between two locations.
2. Network Routing: Helps in determining the most efficient data packet paths in computer networks.
3. Logistics: Optimizes delivery routes for transportation companies to minimize travel time and costs.
4. Urban Planning: Assists in designing efficient public transport routes by analyzi...read more


Q. Given an array of integers, return the frequency of each element in the array.
Count the frequency of elements in an array.
Iterate through the array and use a hash table to keep track of the frequency of each element.
Alternatively, use a dictionary in Python or a map in C++ to achieve the same result.
If the array is sorted, you can use binary search to find the first and last occurrence of each element and calculate the frequency.
Time complexity can be improved to O(n) using a modified counting sort algorithm.

Asked in Infosys

Q. How do you swap two numbers without using a third variable?
To swap two numbers without using third variable, use arithmetic operations.
Add the two numbers and store the result in the first variable.
Subtract the second variable from the sum and store the result in the second variable.
Subtract the second variable from the original sum and store the result in the first variable.

Asked in Atina Technology Pvt. Ltd.

Q. What is the difference between JavaScript and TypeScript?
JavaScript is a dynamic scripting language, while TypeScript is a statically typed superset of JavaScript.
JavaScript is dynamically typed, while TypeScript is statically typed.
TypeScript supports type checking at compile time, while JavaScript does not.
TypeScript allows for the use of interfaces and advanced OOP features, while JavaScript does not.
TypeScript code needs to be transpiled to JavaScript before it can be executed in a browser.

Asked in Infosys

Q. Given a sorted 2D matrix, how would you search for an element?
Search an element in sorted 2d matrix.
Start from the top right corner or bottom left corner and move towards the target element
If the current element is greater than target, move left. If it's smaller, move down
Repeat until target is found or all elements are traversed

Asked in Infosys

Q. Given a list of natural numbers, find the largest increasing subsequence from it.
Find the largest increasing subsequence from a list of natural numbers
Use dynamic programming to keep track of the longest increasing subsequence ending at each index
Iterate through the list and update the longest increasing subsequence for each element
Return the maximum length of the increasing subsequence

Asked in Infosys

Q. What is normalization? Explain with an example.
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization involves breaking down data into smaller, more manageable tables and establishing relationships between them.
It helps in reducing data redundancy and inconsistencies.
There are different normal forms such as 1NF, 2NF, 3NF, BCNF, and 4NF.
For example, in a database of students and courses, instead of storing all student details in the same table as course d...read more

Asked in Infosys

Q. What is immutability in Python?
Immutability in Python refers to the property of objects that cannot be changed after creation.
Immutable objects cannot be modified once created
Immutable objects include numbers, strings, and tuples
Immutable objects are useful for caching and as dictionary keys

Asked in Infosys

Q. What are the pros and cons of Monolith and microservice architecture?
Monolith vs microservice architecture pros and cons
Monolith: easier to develop and test, simpler deployment process
Monolith: can be harder to scale and maintain as it grows
Microservices: scalable and flexible, easier to update and maintain
Microservices: complex to develop and deploy, requires more monitoring and management
Example: Monolith - traditional web applications, Example: Microservices - Netflix, Amazon

Asked in Infosys

Q. Describe a Dynamic Programming problem you were asked during an interview and how you solved it on paper.
Dynamic Programming (DP) is a method for solving complex problems by breaking them down into simpler subproblems.
DP is used in optimization problems, like the Knapsack problem.
Example: Finding the longest increasing subsequence in an array.
DP can be implemented using memoization or tabulation techniques.
Example: Fibonacci sequence can be computed efficiently using DP.

Asked in Infosys

Q. Compare the time and space complexity of an array list versus a linked list.
Array list has O(1) time complexity for accessing elements but O(n) for insertion/deletion, while linked list has O(n) time complexity for accessing elements but O(1) for insertion/deletion.
Array list has constant time complexity O(1) for accessing elements by index, but linear time complexity O(n) for insertion/deletion operations due to shifting elements.
Linked list has linear time complexity O(n) for accessing elements as it requires traversing from the head node, but cons...read more

Asked in Infosys

Q. A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3 steps at a time. Implement a function to count the number of possible ways that the child can run up the stairs.
The staircase problem involves finding the number of ways to climb stairs with given steps.
Dynamic Programming Approach: Use an array to store the number of ways to reach each step.
Base Cases: For 0 stairs, there's 1 way (stay put); for 1 stair, there's also 1 way (one step).
Recurrence Relation: To reach step n, you can come from step n-1 or n-2, so dp[n] = dp[n-1] + dp[n-2].
Example: For 3 stairs, ways = dp[3] = dp[2] + dp[1] = 2 + 1 = 3 (ways: 1-1-1, 1-2, 2-1).
Time Complexit...read more
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Specialist Programmer Related Skills

Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary


Reviews
Interviews
Salaries
Users

