DEV Community

cloudytech147
cloudytech147

Posted on

Crack Infosys Interview Questions

Infosys is an Indian MNC that is among the most prominent IT players in the world. It could be a dream company for many Indian developers and an excellent platform to start your career in IT.

Infosys Interview Questions

List of Infosys Interview Questions

Here I've compiled with top question asked in infosys interview for developers. Know the answers from this blog on Infosys Interview Questions.

  1. Name some high-level programming languages.
  2. C is sometimes considered a low-level programming language. Why so?
  3. What is a preprocessor in C?
  4. Name basic OOPs concepts.
  5. What is inheritance? Name its types.
  6. Please enumerate the various types of inheritance.
  7. What are tokens in C++?
  8. What is the difference between multi-level and multiple inheritances?
  9. Give some differences between C++ and Java.
  10. How encapsulation and abstraction are complementary?
  11. What are arrays?
  12. What is a pointer in C?
  13. Give some differences between C and C++.
  14. What is a NULL pointer?
  15. Give logic to swap two numbers without using a temporary variable.

Conclusion

In this article, we have provided the top Infosys technical interview questions. After reading all the Infosys technical interview questions, you will notice that most of the questions are from C and C++, which also includes OOPs concept with data structure because these are the basis of programming languages, and a developer should have knowledge of basic technical stuff.

Top comments (1)

Collapse
 
slowcheetah profile image
SlowCheetah

import math

def is_perfect_square(n):
sqrt_n = int(math.sqrt(n))
return sqrt_n * sqrt_n == n

def find_last_three_digits_factorial(n):
factorial = math.factorial(n)
factorial_str = str(factorial)

# Find the index of the last non-zero digit
non_zero_index = next(i for i in range(len(factorial_str) - 1, -1, -1) if factorial_str[i] != '0')

# Extract the last three digits
last_three_digits = factorial_str[max(0, non_zero_index - 2):non_zero_index + 1]

return int(last_three_digits)
Enter fullscreen mode Exit fullscreen mode

def process_input_string(input_str):
input_numbers = [int(num) for num in input_str.split(',')]

perfect_squares = [num for num in input_numbers if is_perfect_square(num)]

if not perfect_squares:
return -1

output = [find_last_three_digits_factorial(square) for square in perfect_squares]

return ', '.join(map(str, output))

Enter fullscreen mode Exit fullscreen mode




Example usage

input_str = "2,4,6,9,35,100"
output_result = process_input_string(input_str)
print("Output:", output_result)