Join Regular Classroom : Visit ClassroomTech

Tata Cliq Overall Interview Questions + Coding Solutions – codewindow.in

Hot Topics

Tata Cliq Solution

Technical Round

You have two jugs one 5 liters and other 3 liters you have to measure 4 liters of water?

  • Fill the 3 liter jug to full.
  • Pour 3 liter jug into 5 liter jug.
  • Again fill up 3 liter jug.
  • Pour 3 liter jug into 5 liter jug.
  • After filling up 5 liter jug fully you will have 1 liter left in 3 liter jug.
  • Empty the 5 liter jug and pour 1 liter from 3 liter jug.
  • Fill up the 3 liter jug again and pour it into 5 liter jug.
Now we got total 1+3 liter i.e. 4 liters in 5 liters jug.

Question about regression and SQL

Regression is a statistical technique used to analyze the relationship between a dependent variable (also known as the response variable) and one or more independent variables (also known as predictors or explanatory variables). The goal of regression is to build a model that can be used to predict the value of the dependent variable based on the values of the independent variables.
SQL (Structured Query Language) is a programming language used to manage and manipulate relational databases. It is used to insert, update, and retrieve data from databases, as well as to create, modify, and manage the structure of the database itself.
It is possible to use SQL to perform regression analysis by querying a database and then analyzing the resulting data using statistical software or programming languages such as R or Python. This is commonly used in data analysis and business intelligence applications.

Mention your previous projects and what challenges did you face while implementing it.

Tell about your projects which you did in your past and the difficulties you faced in completing the project.

Find the first occurrences of 1 in a sorted array of 0’s and 1’s.

One way to find the first occurrence of 1 in a sorted array of 0’s and 1’s is to use a binary search algorithm. The basic idea is to repeatedly divide the search interval in half until the target value is found. Here is an example of a binary search algorithm implemented in Python:
def first_occurrence(arr):
    left = 0
    right = len(arr) - 1
    result = -1
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] == 1:
            result = mid
            right = mid - 1
        else:
            left = mid + 1
    return result
This algorithm starts by setting the left and right pointers to the first and last elements of the array, respectively. It then repeatedly divides the search interval in half by updating the left and right pointers. If the element at the middle index is equal to 1, it updates the result variable to the current index and moves the right pointer to the left, otherwise it moves the left pointer to the right. If the search interval becomes empty, the algorithm returns the result variable, which will be -1 if no 1’s were found or the index of the first occurrence of 1 if one was found.
This algorithm has a time complexity of O(log n), which makes it efficient for large arrays.
Note that this algorithm assumes that the array is sorted, otherwise this method will not work.

How you scale the platform both horizontally and vertically?

Scaling a platform horizontally and vertically are two different ways to increase the capacity of a system to handle more load or to handle more data.
Scaling horizontally, also known as scaling out, involves adding more servers or instances to the system. This increases the total capacity of the system by distributing the load across multiple servers. This can be achieved by adding more machines to a load balancer, setting up a cluster of machines, or using a cloud-based solution like autoscaling. This approach is useful when the system’s load is increasing or when the system needs to handle more data, but it may require more complex configuration and management.
Scaling vertically, also known as scaling up, involves increasing the resources of an existing server or instance. This increases the capacity of the system by adding more memory, disk space, or CPU power to a single server. This can be achieved by upgrading the hardware of the server or by using a cloud-based solution like resizing an instance. This approach is useful when the system is using all available resources and the load is increasing, but it may be more expensive in terms of hardware costs.
Both horizontal and vertical scaling have their own advantages and disadvantages and the choice of which approach to use depends on the specific requirements of the system and the use case. In general, horizontal scaling is more suitable for handling more load, while vertical scaling is more suitable for handling more data. Both can be used together in a hybrid approach, where you start by scaling vertically, and when you hit the limit of a single machine, you start scaling horizontally.
It’s also important to mention that scaling the platform also involves monitoring and testing the platform performance and capacity, making sure that the platform is well-architected and designed, and having a solid disaster recovery and failover plan in place.

Write a program to remove duplicate elements from lists.

#include <iostream>
#include <list>
#include <unordered_set>
using namespace std;

void removeDuplicates(list<int>& myList) {
    unordered_set<int> set;
    for (auto it = myList.begin(); it != myList.end();) {
        if (set.find(*it) != set.end()) {
            it = myList.erase(it);
        }
        else {
            set.insert(*it);
            ++it;
        }
    }
}

int main() {
    list<int> myList = {1, 2, 3, 3, 4, 5, 5, 6};
    removeDuplicates(myList);
    for (auto i : myList) {
        cout << i << " ";
    }
    return 0;
}
/*
OUTPUT
1 2 3 4 5 6 
*/

Architecture of chess board game.

The architecture of a chess board game can be divided into several components:
  1. Game rules: This component defines the rules of the game, such as how the pieces move, how a game is won or lost, and any special conditions that may apply.
  2. Game engine: This component is responsible for implementing the game rules and logic. It keeps track of the state of the game, including the positions of the pieces on the board, the current player’s turn, and any special conditions that may apply. It also handles input from the players, such as their move selections, and enforces the rules of the game.
  3. User interface: This component allows the players to interact with the game. It may include a graphical user interface (GUI) that displays the board, the pieces, and the players’ move options, as well as a command-line interface (CLI) for text-based input and output.
  4. Game data: This component includes all the data required for the game, such as the initial positions of the pieces, the names of the players, and the history of moves.
  5. AI player: This component allows the game to be played against computer-controlled opponents. The AI player uses algorithms to determine its move choices based on the current state of the game.
  6. Network: This component allows the game to be played over a network, allowing players to play remotely.
  7. Persistence: This component allows the game to save and load the state of the game.
  8. Security: This component ensures that the game is secure and that players cannot cheat.
These components interact with each other to create a functioning chess game. The architecture can be designed to be flexible and extensible, so that new features can be added or existing features can be modified without affecting other parts of the system.
It is also worth noting that there are several different frameworks and libraries available for building chess games, such as Stockfish, which is a powerful chess engine, and chess.js, which is a JavaScript library for creating chess games in web browsers.

Nagarro Solved

Automata Fixing

      

We Love to Support you

Go through our study material. Your Job is awaiting.

Recent Posts
Categories