0% found this document useful (0 votes)
39 views5 pages

TCS NQT Coding Practice: 100 Questions

Uploaded by

Sakshi Devadiga
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)
39 views5 pages

TCS NQT Coding Practice: 100 Questions

Uploaded by

Sakshi Devadiga
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

TCS NQT Coding Practice Set (100 Questions)

Level 1: Basic Logic & Loops (20 Qs)

1. Print sum of first N natural numbers

2. Check if a number is prime

3. Reverse a number

4. Count digits in a number

5. Find factorial of a number

6. Check palindrome number

7. Print Fibonacci series up to N terms

8. Find greatest of three numbers

9. Check armstrong number

10. Print sum of digits

11. Find power of a number without using pow()

12. Convert Celsius to Fahrenheit

13. Find LCM and GCD of two numbers

14. Print even and odd numbers in a range

15. Count even digits in a number

16. Swap two numbers without using third variable

17. Check if year is leap year

18. Find ASCII value of a character

19. Print multiplication table of N

20. Calculate simple interest

Level 2: Arrays & Strings (25 Qs)

21. Find largest and smallest element in array

22. Find sum and average of array elements

23. Find duplicates in array


24. Remove duplicates from array

25. Reverse an array

26. Find missing number in array (1 to n)

27. Find frequency of each element in array

28. Merge two sorted arrays

29. Rotate array by k positions

30. Second largest element in array

31. Check if two arrays are equal

32. Find intersection of two arrays

33. Sort array without using built-in function

34. Count even and odd numbers in array

35. Move all zeros to end

36. Find pair of elements with given sum

37. Left rotate array by one position

38. Find subarray with maximum sum (Kadane’s Algorithm)

39. Count occurrences of each character in string

40. Check if a string is palindrome

41. Reverse words in a sentence

42. Remove vowels from string

43. Find first non-repeating character

44. Check if two strings are anagrams

45. Count words in a sentence

Level 3: Intermediate DSA (25 Qs)

46. Binary search in array

47. Linear search

48. Bubble sort

49. Insertion sort


50. Selection sort

51. Find majority element

52. Find leaders in array

53. Check subarray sum = 0 exists

54. Count distinct elements

55. Merge intervals

56. Find equilibrium index

57. Move negative elements to one side

58. Find duplicate character in string

59. Remove spaces from string

60. Check if a string contains only digits

61. Find longest word in a sentence

62. Replace spaces with ‘%20’ (URLify problem)

63. Find common prefix among strings

64. Print frequency of each character

65. Longest substring without repeating characters

66. Check if brackets are balanced

67. Convert Roman to Integer

68. Convert Integer to Roman

69. Implement custom strstr()

70. Check pangram

Level 4: Logical & Pattern-Based (15 Qs)

71. Print pyramid star pattern

72. Print inverted triangle pattern

73. Print Floyd’s triangle

74. Print Pascal’s triangle

75. Print diamond pattern


76. Print 0-1 triangle pattern

77. Print number pattern (1, 22, 333...)

78. Print alphabet pattern

79. Print right-angled triangle with numbers

80. Hollow square pattern

81. Print Fibonacci triangle

82. Print X pattern

83. Print cross pattern

84. Print border square with stars

85. Print continuous numbers triangle

Level 5: Advanced Logic & Company-Type (15 Qs)

86. Find trailing zeros in factorial

87. Count total set bits from 1 to n

88. Find missing and repeating number in array

89. Count pairs with given difference

90. Check if number is power of two

91. Rearrange array alternatively positive and negative

92. Find subarray with given sum

93. Rearrange array in wave form

94. Longest common prefix among strings

95. Longest palindromic substring

96. Matrix spiral traversal

97. Transpose of matrix

98. Rotate matrix 90 degrees clockwise

99. Count frequency of words in a string

100. Maximum product subarray

You might also like