Logo
PublicationTech InterviewYouTubeSay Hello

#DSA

Popular Tags
  • #JAVASCRIPT
  • #ANDROID
  • #NODEJS
  • #BACKEND
  • #MACHINE_LEARNING
AfterAcademy Tech

AfterAcademy Tech

Find Nth Factorial

Write a program to find the factorial of a given number n. n is a non-negative integer. Factorial of a non-negative integer n is the multiplication of all integers smaller than or equal to n.

14 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Sort List - Merge Sort

Sort a linked list using Merge Sort. This is a very famous interview problem that demonstrates the concept of recursion. This problem is quite similar to Merge Sort in Arrays.

12 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Smallest Multiple With 0s and 1s

You are given an integer n, write a program to find the smallest multiple of n which consists of 0 and 1. The resultant number could be quite large so return it in the form of a string. This problem is a good example of graph-based problems.

11 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Detect and Remove Loop In A Linked List

You are given the head of a linked list which probably contains a loop. If the list contains a loop, you need to find the last node of the list which points to one of its previous nodes to create a loop and make it point to NULL, thereby removing the loop.

09 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Knight on chessboard

Given a square chessboard of A x B size, the position of Knight (C, D) and the position of a target (E, F) is given. Write a program to find out the minimum steps a Knight will take to reach the target position. This problem is a good example of BFS algorithm.

07 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Largest Element In An Array

Given an array arr[] of size n , write a program to find the largest element in it. To find the largest element we can just traverse the array in one pass and find the largest element by maintaining a max variable.

04 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Merge Two BST

Given two binary search trees with root nodes as tree1 and tree2 of size n and m, write a program to return an array of integers that contains all the elements of tree1 and tree2 in non-decreasing order. The expected time complexity is O(m+n).

01 Sep 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Odd Even Linked List

Given a singly linked list, write a program to group all odd nodes together followed by the even nodes. You should try to do it in place and the program should run in O(n) time complexity.

21 Aug 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Wave Array

You are given an unsorted array of integers(arr) of length n, write a program to sort it in wave form. The array elements in the resultant array must be such that arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] ... and so on. If there are multiple sorted orders in wave-form, return the one which is lexicographically smallest.

20 Aug 2020
Thumbnail

AfterAcademy Tech

AfterAcademy Tech

Merge Two Sorted Arrays

You are given two sorted arrays arr1[ ] and arr2[ ] of sizes m and n respectively. Write a program to merge them in such a way that the resultant array is sorted too.

17 Aug 2020
Thumbnail

  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 17

Popular Tags
  • #JAVASCRIPT
  • #ANDROID
  • #NODEJS
  • #BACKEND
  • #MACHINE_LEARNING
CONNECT WITH US

© Copyright 2025 AfterAcademy
Privacy Policy
Terms And Conditions
Cookie Policy
This website uses cookies to ensure you
get the best experience on our website.
Read More