What are initial load and full load?
In ETL, the initial load is the process for populating all data warehousing tables for the very first time. In full load, when the data is loaded for the first time, all set records are loaded at a stretch depending on its volume. It would erase all contents from the table and would reload the fresh data.
Preparing for Accenture Technical Interview Questions
Q1. Write an efficient program for printing k largest elements in an array. Elements in array can be in any order.
For example, if given array is [1, 23, 12, 9, 30, 2, 50] and you are asked for the largest 3 elements i.e., k = 3 then your program should print 50, 30 and 23.
There are many methods to approach this problem.
Method 1
1) Store the first k elements in a temporary array temp[0..k-1]. 2) Find the smallest element in temp[], let the smallest element be min. 3-a) For each element x in arr[k] to arr[n-1]. O(n-k) If x is greater than the min then remove min from temp[] and insert x. 3-b)Then, determine the new min from temp[]. O(k) 4) Print final k elements of temp[]
Time Complexity: O((n-k)*k). If we want the output sorted then O((n-k)*k + k*log(k))
Method 3
1) Sort the elements in descending order in O(n*log(n)) 2) Print the first k numbers of the sorted array O(k).
#include
using
namespace
std;
void
kLargest(
int
arr[],
int
n,
int
k)
{
sort(arr, arr + n, greater<
int
>());
for
(
int
i = 0; i < k; i++)
cout << arr[i] <<
" "
;
int
arr[] = { 1, 23, 12, 9, 30, 2, 50 };
int
n =
sizeof
(arr) /
sizeof
(arr[0]);
int
k = 3;
Q2. What are class and object in C++? A class is a user-defined data type that has data members and member functions. Data members are the data variables and member functions are the functions that are used to perform operations on these variables. An object is an instance of a class. Since a class is a user-defined data type so an object can also be called a variable of that data type. class
A {
private: int data; public: void fun() { } };
Q3. Given an array of integers, write a function that returns true if there is a triplet (a, b, c) that satisfies a2 + b2 = c2.
static boolean isTriplet(int ar[], int n)
{
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
for (int k = j + 1; k < n; k++) {
int x = ar[i] * ar[i], y = ar[j] * ar[j], z = ar[k] * ar[k];
if (x == y + z || y == x + z || z == x + y)
return true;
}
}
}
public static void main(String[] args)
{
int ar[] = { 3, 1, 4, 6, 5 };
int ar_size = ar.length;
if (isTriplet(ar, ar_size) == true)
System.out.println("Yes");
else
System.out.println("No");
}
}
Q4. What is operator overloading?
Now this could be asked both in C++ and in Java.
Operator Overloading is a very essential element to perform the operations on user-defined data types. By operator overloading we can modify the default meaning to the operators like +, -, *, /, <=, etc.
1 What do you mean by ETL Pipeline?
As the name suggests, ETL pipelines are the mechanisms to perform ETL processes. This involves a series of processes or activities required for transferring data from one or more sources into the data warehouse for analysis, reporting and data synchronization. It is important to move, consolidate, and alter source data from multiple systems to match the parameters and capabilities of the destination database in order to provide valuable insights.
Among its benefits are: