0% found this document useful (0 votes)
31 views10 pages

Interview

interview questions

Uploaded by

rajithakambotula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views10 pages

Interview

interview questions

Uploaded by

rajithakambotula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

some questions for interview with answers from

infosys company. role =Digital Specialist Engineer


(DSE) . BTECH CSE sudent
For the Infosys Digital Specialist Engineer (DSE) interview, B.Tech CSE students can expect
questions covering technical concepts, coding, problem-solving, as well as some HR and logical
questions. Here are several common questions along with model answers tailored for this role,
based on recent candidates’ experiences:
1. Self-Introduction
Q: Tell me about yourself.
A: I am a B.Tech CSE student with strong skills in Python, Java, Data Structures, and OOPS. I
have completed projects in [mention one or two relevant project topics]. I'm passionate about
solving complex problems and eager to contribute to Infosys as a Digital Specialist Engineer by
leveraging my technical and analytical abilities [1] [2] [3] .
2. Coding and DSA
Q: Can you write a program to reverse a string or check if a string is a palindrome?
A: [If asked to code, proceed to code in your preferred language.]
A string can be reversed using a loop from the end to the start, or simply using built-in functions.
For palindrome, compare the string with its reverse and check for equality [2] . (Be ready to code
on paper or online.)
Q: What is the difference between stack and queue?
A: Stack is a Last-In-First-Out (LIFO) structure while Queue is First-In-First-Out (FIFO). Stack
supports push and pop; queue supports enqueue and dequeue. Example: Undo functionality
uses stack; Printer task scheduling uses queue [4] [2] .
3. SQL and DBMS
Q: What is the difference between DDL and DML? Give examples.
A: DDL (Data Definition Language) includes commands like CREATE, ALTER, DROP for defining
or altering table structure. DML (Data Manipulation Language) involves SELECT, INSERT,
UPDATE, DELETE for managing data in tables [1] .
Q: Write a SQL query to find the top three highest salary earners.
A:

SELECT DISTINCT salary FROM employee ORDER BY salary DESC LIMIT 3;

4. OOPS Concepts
Q: What are the four pillars of OOPS?
A: The four main principles are Encapsulation, Abstraction, Inheritance, and Polymorphism.
Encapsulation hides data, abstraction hides complexity, inheritance enables properties reuse,
and polymorphism allows multiple forms for methods [1] [5] [3] .
Q: What is a Singleton Design Pattern?
A: Singleton ensures that only one instance of a class is created, with a global point of access to
that instance. Commonly used in configuration or logging modules [2] .
5. Operating System & Networking
Q: How is memory management done in OS?
A: The OS manages memory through techniques like paging, segmentation, and virtual memory.
It allocates memory space, keeps track of each byte, and frees memory when not needed [2] .
Q: Explain the difference between OSI and TCP/IP layers.
A: OSI has seven layers; TCP/IP has four. OSI is a conceptual model; TCP/IP is practical and
widely implemented. Both standardize network communications [2] .
6. Project/Resume-based and Logical Questions
Q: Explain any project you have done.
A: Briefly describe the project goals, your role, tech stack used, challenges faced, and what you
learned [5] [3] .
Q: Puzzles & Logical Thinking (sample)
Why are manhole covers round?
Round covers cannot fall into the hole and are easy to move [6] .
Bulb and Switch problem; Heaven-Hell gate puzzle (be prepared for logical questions and
explain your approach) [6] .
7. HR/Behavioral
Q: Why do you want to join Infosys?
A: Infosys is a leading IT company recognized for innovation and career growth opportunities. I
want to work in an environment that encourages learning and contributes to digital
transformation projects.
Q: What can you teach me in two minutes?
A: Pick a simple concept, such as the principle of recursion, how binary search works, or a basic
SQL command, and explain step-by-step [6] .
8. Python vs Java
Q: Why do you prefer Python over Java or vice versa?
A: Python is preferred for its simpler syntax and rapid prototyping, while Java is better for
enterprise applications and has strong memory management. Choice depends on application
requirements [2] .
Be prepared for hands-on coding on arrays, strings, dynamic programming, and algorithms
(greedy, divide and conquer, etc.), as well as fundamentals in DBMS, OOPS, OS, and
networking. Practice coding, review your projects, and be ready for logic puzzles and
“why/how” type questions to demonstrate depth of understanding [4] [1] [7] [6] [2] [5] [3] .

What specific coding challenges are common in


the DSE online test at Infosys
The Infosys Digital Specialist Engineer (DSE) online test typically includes 2–3 coding challenges
covering a range of difficulty: one easy, one medium, and one hard problem. The focus is on
data structures, algorithms, and problem-solving skills relevant to the role.
Common coding challenge patterns and topics:
Data Structures: Arrays, strings, linked lists, stacks, and queues are very common. You may
be asked to perform operations like reversal, searching, removing duplicates, or cycle
detection [8] [9] [10] [11] .
Algorithms: Sorting (Quick Sort, Merge Sort), searching (Binary Search), and classic
algorithmic patterns such as greedy algorithms (activity selection, coin change), dynamic
programming (Fibonacci, knapsack, partition problems), and backtracking (N-Queens) [8] [9]
[10] .

String manipulation: Palindrome checking, substring search, character counting, anagram


detection, and string reversal [8] [12] .
Mathematical or logical problems: Prime number generation, factorial calculation,
GCD/LCM, combinatorial logic (e.g., Pascal’s triangle), and matrix operations [8] [12] .
Typical question pattern:
Easy level: Simple applications of basic algorithms or data structures.
Medium level: Often based on greedy algorithms, requiring local optimal solutions at
each step.
Hard level: Usually dynamic programming, combining subproblem solutions
efficiently [10] [11] .
Sample question types based on real experiences:
Implement string or array transformations (e.g., reverse an array, rotate array, remove
duplicates).
Solve optimization problems using DP or greedy approaches (e.g., maximum sum subarray,
coin change).
Analyze recursive or iterative patterns (e.g., print Fibonacci sequence, ways to climb stairs).
Partitioning or grouping problems (e.g., distribute items into boxes for maximum value—a
classic DP pattern in recent DSE rounds [11] ).
You are expected to write clean, efficient code in a supported language (Python, Java, or C++),
handle all edge cases, and make sure your solution passes all test scenarios, not just the
examples [11] . Time limits (60–120 minutes) require effective time management, especially for
harder problems.
Practicing on platforms like LeetCode, GeeksforGeeks, and reviewing previous years' problems
will help you prepare for these specific types of questions [12] [11] .

ask questions based on above topics


Sure! Here are practice coding and technical questions based on the common topics asked in
the Infosys DSE online test. These cover data structures, algorithms, string handling,
mathematical logic, and dynamic programming—mirroring the typical test structure.

1. Data Structures & Arrays


a. Array Manipulation
Reverse the elements of an array in place.
Given a sorted array, remove all duplicates such that each element appears only once.
Return the new length.
Sample Question:
Write a function that rotates an array to the right by k steps.

2. String Manipulation
a. Palindrome & Anagram
Check if a given string is a palindrome (ignoring spaces and case).
Determine if two strings are anagrams.
Sample Question:
Given a string s, return the length of the longest substring without repeating characters.

3. Algorithms
a. Sorting & Searching
Implement Quick Sort or Merge Sort on a given array.
Use binary search to find the index of a target element in a sorted array.
Sample Question:
Given an array of integers, return indices of the two numbers such that they add up to a specific
target.

4. Dynamic Programming / Greedy


a. DP & Greedy
Find the maximum subarray sum (Kadane’s Algorithm).
Implement the coin change problem: Given coins of given denominations and a total, find
the minimum number of coins needed.
Sample Question:
Given an integer n, return the number of unique ways to climb a staircase if you can take 1 or 2
steps at a time.

5. Mathematical & Logical


a. Number Theory
Check if a number is prime.
Compute the factorial of a number using recursion.
Sample Question:
Print all the prime numbers between 1 and 100.

6. Matrix Operations
Rotate a matrix 90 degrees clockwise.
Find the transpose of a matrix.

7. Puzzles & Reasoning


Why are manhole covers round?
There are 3 bulbs in a room and 3 switches outside. Find the mapping by entering the room
only once.

8. SQL/Database
Write a SQL query to find employees with the second highest salary.
Write a query to count the total number of students in each department in the STUDENT
table.

Practice Tip
Try to write code for a few of the above problems in Python or Java. Start with simple problems
(reverse array) and attempt medium to hard problems (coin change, unique paths stairs) for
best results! If you want solutions or explanations for any question above, let me know.

give answers too


Here are sample answers and explanations for the practice coding and technical questions
relevant to the Infosys DSE online test. Wherever needed, Python code examples are included.
These answers both demonstrate correct logic and highlight the type of answers expected in
real test scenarios.
1. Data Structures & Arrays
a. Reverse the elements of an array in place
Python:

def reverse_array(arr):
return arr[::-1]
# Example: reverse_array([1,2,3]) => [3,2,1]

Explain: This uses Python list slicing to reverse.


b. Remove all duplicates in a sorted array (in-place), return new length
Python:

def remove_duplicates(arr):
if not arr:
return 0
i = 0
for j in range(1, len(arr)):
if arr[j] != arr[i]:
i += 1
arr[i] = arr[j]
return i + 1
# Example: [1,1,2,3] -> length 3 (array becomes [1,2,3,...])

Sample: Rotate array to the right by k steps

def rotate(arr, k):


n = len(arr)
k = k % n
return arr[-k:] + arr[:-k]
# Input: [1,2,3,4,5], k=2 => Output: [4,5,1,2,3]

2. String Manipulation
Check if a string is a palindrome (ignore spaces, case)

def is_palindrome(s):
cleaned = ''.join(c.lower() for c in s if c.isalnum())
return cleaned == cleaned[::-1]
# "A man a plan a canal Panama" -> True

Determine if two strings are anagrams

def are_anagrams(s1, s2):


return sorted(s1) == sorted(s2)
# "listen", "silent" -> True

Length of the longest substring without repeating characters

def length_of_longest_substring(s):
seen = {}
start = max_len = 0
for end, char in enumerate(s):
if char in seen and seen[char] >= start:
start = seen[char] + 1
seen[char] = end
max_len = max(max_len, end - start + 1)
return max_len
# "abcabcbb" -> 3 ("abc")

3. Algorithms
Implement Quick Sort

def quick_sort(arr):
if len(arr) <= 1:
return arr
pivot = arr[^4_0]
less = [x for x in arr[1:] if x <= pivot]
more = [x for x in arr[1:] if x > pivot]
return quick_sort(less) + [pivot] + quick_sort(more)
# [4,1,3,2] -> [1,2,3,4]

Binary search for target index

def binary_search(arr, target):


left, right = 0, len(arr)-1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
# [1,2,3,4], target=3 => 2

Two sum problem: indices of two numbers adding up to target

def two_sum(nums, target):


d = {}
for i, num in enumerate(nums):
if (target - num) in d:
return [d[target - num], i]
d[num] = i
# [2,7,11,15], target=9 => [0,1]

4. Dynamic Programming / Greedy


Maximum subarray sum (Kadane's Algorithm)

def max_subarray_sum(nums):
max_current = max_global = nums[^4_0]
for num in nums[1:]:
max_current = max(num, max_current + num)
max_global = max(max_global, max_current)
return max_global
# [-2,1,-3,4,-1,2,1,-5,4] -> 6 ([4,-1,2,1])

Coin change (minimum coins for total)

def coin_change(coins, total):


dp = [float('inf')] * (total + 1)
dp[^4_0] = 0
for coin in coins:
for x in range(coin, total+1):
dp[x] = min(dp[x], dp[x-coin]+1)
return dp[total] if dp[total] != float('inf') else -1
# coins=[1,2,5], total=11 -> 3

Ways to climb stairs (n steps, 1 or 2 at a time)

def climb_stairs(n):
if n <= 2:
return n
a, b = 1, 2
for _ in range(3, n+1):
a, b = b, a + b
return b
# n=4 -> 5

5. Mathematical & Logical


Check if a number is prime

def is_prime(n):
if n <= 1:
return False
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0:
return False
return True
# 7 -> True

Factorial of a number using recursion

def factorial(n):
return 1 if n == 0 else n * factorial(n-1)
# 5 -> 120

Print all prime numbers between 1 and 100

def primes_upto_100():
primes = []
for num in range(2, 101):
if is_prime(num):
primes.append(num)
return primes

6. Matrix Operations
Rotate a matrix 90 degrees clockwise

def rotate_matrix(mat):
return list(zip(*mat[::-1]))
# [[1,2],[3,4]] -> [[3,1],[4,2]]

Transpose a matrix

def transpose_matrix(mat):
return [list(row) for row in zip(*mat)]

7. Puzzles & Reasoning


Why are manhole covers round?
Answer: Round covers cannot fall through the circular opening, making them safer and easier to
move than other shapes.
3 bulbs and 3 switches puzzle:
Turn on switch 1 and leave it on for a few minutes. Turn off switch 1 and turn on switch 2. Enter
the room:
Bulb that's on: switch 2
Bulb that's off and warm: switch 1
Bulb that's off and cold: switch 3
8. SQL/Database
a. Employees with second highest salary

SELECT MAX(salary) FROM employee WHERE salary < (SELECT MAX(salary) FROM employee);

b. Count of students in each department

SELECT department, COUNT(*) FROM student GROUP BY department;

You can select any question above for further code explanation or request more sample
problems and answers based on your focus area. For additional step-by-step code or output
examples for any specific question, just ask.

1. https://www.geeksforgeeks.org/infosys-interview-experience-for-digital-specialist-engineer-2022/
2. https://www.glassdoor.co.in/Interview/Infosys-Digital-Specialist-Engineer-Interview-Questions-EI_IE792
7.0,7_KO8,35.htm
3. https://www.glassdoor.co.in/Interview/Infosys-DSE-Role-Interview-Questions-EI_IE7927.0,7_KO8,16.htm
4. https://prepinsta.com/infosys-sp-and-dse/digital-specialist-engineer/
5. https://www.geeksforgeeks.org/interview-experiences/infosys-interview-experience-for-digital-special
ist-engineer-through-infytq/
6. https://www.geeksforgeeks.org/interview-experiences/infosys-digital-specialist-engineerdse-ses-inter
view-experience/
7. https://prepinsta.com/infosys-sp-and-dse/digital-specialist-engineer/coding-questions/
8. https://www.ccbp.in/blog/articles/infosys-coding-questions
9. https://www.iscalepro.com/post/infosys-sp-and-dse-coding-questions/
10. https://prepinsta.com/infosys-sp-and-dse/coding-questions/
11. https://www.lets-code.co.in/previousyearcodingquestion/infosys-sp-and-dse-previous-year-coding-qu
estions
12. https://www.geeksforgeeks.org/dsa/infosys-sde-sheet-interview-questions-and-answers/

You might also like