/tcs-digital-prep

Programs I solved during the two weeks while I was preparing for TCS Digital.

Primary LanguageC++MIT LicenseMIT

tcs-digital-prep

This repository contains everything I practised in my 2-week prep time for the technical areas of TCS Digital examination.

More about TCS Digital examination here: https://www.tcs.com/

More on my prep strategy, in-depth, here.

Contents

CodeVita

This folder contains the program I solved in TCS CodeVita, 2018, that ultimately let to my selection in the interview.

 • fibo.c The Modified Fibonacci program solved with brute-force.
 • fibo-less.c A space-optimized version of the same program that uses LRU technique to cut the memory used from O(n) to O(k), where n can go as high as 106 while k can be 10 at max.

STL

I don't really do competitve coding, and this was one of my first stints in doing so. Naturally, I had to learn the Standard Template Library of C++ for better and faster implementation of certain algorithms.

This repository contains some basic STL containers and their example programs, like:

  • Pairs
  • Vectors
  • Lists
  • Sets
  • Maps

Sorting

Implementation of various sorting algorithms in C++, such as:

  • Heap sort
  • Insertion sort
  • Merge sort
  • Quick sort

DP

Bunch of dynamic programming problems I solved during this time period.

All the questions, with more solutions than mine, are available on GeeksForGeeks, here: https://www.geeksforgeeks.org/dynamic-programming/

Other programs

These are programs that I solved in addition to the above ones, just for some more practise.

They include:

  • Printing a square matrix in spiral order (spiral.c)
  • Print if a number is even or odd without using arithmetic operators (even-odd-constraints.py, even-odd-constraints.c)

Disclaimer

All codes written are my own. I did not copy any code nor do I intend to make any copyright infringement. Similarities, if found, are purely coincidental.

Furthermore, if it helps, you may use my repository to prepare for your coding tests, but do not use my codes for your homework problems.