head

Tuesday, September 30, 2014

Unix Commands

                                                          Unix Commands


1)nohup scriptname & - Automatically runs the jobs in the background even after exit

2)disown -h jobID--runs the jobs even if you exit from the terminal
   disown -r  -deletes all the running jobs
   disown jobid -Removes specific running active job
   disown -a  --deletes or removes all the active jobs

3)exit or CTRL+D - exit from the terminal

4)ps aux           ... list the status of all jobs by process  identifier (PID)
   PS -A   --Process of All users
   PS -u Vivek --Process of  Single users

5) jobs -l -displays all the running and non running jobs

6)rm -rf foo/bar/baz-- removing the present directory
   rmdir name_of_directory--remove directories if empty
   rmdir -p foo/bar/baz--removing the present directory and its parent directories even if files exists
   rm filename - Contents are recoverble
   rm -Rf filename - Force remove -- contents are not recoverable

7)ls -l             ... list all files in the current working directory, along with each file's   permission, owner, size in bytes and date  of last modification.

8) ctrl  c           Abort the program currently running
    ctrl z           Suspend the program currently running (use  fg or bg to resume the program in the foreground or background, respectively)
 

9)KILL -15 <>--CLEANUP operations and Uses SIGTERM signal
 

10)KILL -9 <> -No CLEANUP operations and Uses SIGKILL signal
 

11)shred option filename -Overwriting the existing file multiple times and securely deleting the file

12)grep -a1 "fedora" sample.dat -- Print the serched line plus the above and below 1 lines
      grep -A1 "fedora" sample.dat-- Print the serched line plus above the serached pattern one line
      grep -B1 "fedora" sample.dat--Print the serched line plus  below the serached pattern one line

13)set number -sets the line number in the unix sh file.

14)ls -F --list filenames with a special character at the end that tells you what kind of file it is ("/" for directory, "*" for unix executable, "@" for alias/symlink, etc)

15) grep -n "search string" filename will display the serched string and the line number
For Ex:
1ABC
2ABC

16)Hard Link  -- ln filename pointerfilename--contains inode number of that file--Once deleted hardlink ,still the contents are visible
   New File is not created and the file is just a mirror of the original file. 
   Cannot be used across filesystems    ,Consumes extra space since new file
   with new inode number  is created.   
  
     Soft Link-- ln -s filename pointerfilename--contains  file name to reference the file--
    Once deleted softlink ,the contents are not visible
                            New File is not created and the file is just a mirror of the original file.
              Can be used across filesystems,does not consume extra space since new file with new inode number is not created.
http://www.maxi-pedia.com/difference+between+symbolic+link+and+hard+link

ls -il --To see the hard and soft links in the particular directory

ls -F--When Soft link is created , the filename ends with @symbol which can be seen and identified as softlink by using this command.

  



Saturday, September 27, 2014

TCS Interview Questions



--Informatica--

1)If there is a word "VIRUS" while transforming job in informatica then abort the jobs
2)What will you do after a job is aborted ?
3)Dynamic lookup??
4)Source Qualifier ?? can we remove the source qualifier and use only the source transformation?
5)Router and Filter transformation difference ?


--QC--
1)How will the requirements be written and mapped to the test cases?
ANS)http://www.softwaretestinghelp.com/hp-quality-center-tutorial-day-3-requirements-and-release-cycle-management-with-example/

2)Regression suite developed ?
ANS)http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/Creating-Regression-Suite-in-HPQC/td-p/5901657


--Unix--

1)soft link and hard link :

ANS)

Hard Link  -- ln filename pointerfilename--
contains inode number of that file--Once deleted hardlink ,still the contents are visible
New File is not created and the file is just a mirror of the original file.
Cannot be used across filesystems ,Consumes extra space since new file with new inode number is created.

Soft Link-- ln -s filename pointerfilename--contains  file name to reference the file--Once deleted softlink ,the contents are not visible
New File is not created and the file is just a mirror of the original file.
Can be used across filesystems,does not consume extra space since new file with new inode number is not created.

http://www.maxi-pedia.com/difference+between+symbolic+link+and+hard+link

ls -il --To see the hard and soft links in the particular directory

ls -F--When Soft link is created , the filename ends with @symbol which can be seen and identified as softlink by using this command.


2)display the 33rd line in a file
head -X <<>> | tail -Y > <<>>
head -33 abc.sh | tail -1

3)if a job fails in unix what is the error code received , if it passes what is the error code?
answers) 1 and 0 (failure and success)

4)if you want to find a string in the present working directory what is the command in unix ?
ls -lrt | grep "avi" .

5)tile keyword in unix ?


6)concatenate 2 files in unix
cat file1.txt file2.txt > new.txt    --if new file is empty
cat file1.txt file2.txt >> new.txt   --if new file is not empty and append the contents to new.txt

7)Run a shell job in the background and retreive the result once it is completed
To place a foreground process in the background: suspend the foreground process (with Ctrl-z) then enter the bg command to move the process into the background.
Show the status of all background and suspended jobs: jobs
Bring a job back into the foreground: fg %jobnumber
Bring a job back into the background: bg %jobnumber

8)nohup command
nohup scriptname & -Automatically runs the jobs in the background even after exit

9)disown command--runs the jobs even if you exit from the terminal
http://www.cyberciti.biz/faq/unix-linux-disown-command-examples-usage-syntax/

10)ls -lrt .... what is lrt ?
long listing files in time in reverse order

11)find all the process for all users running in the system
ps -A
PS -U vivek
ps aux

12)Retrieve the above 2 lines and below 2 lines in  file of unix if you are in 3rd line
grep -a2 "search pattern" sample.dat -- Print above and below 2 lines


13)what is the size of the file in unix kb or mb?
bytes

13)delete a directory if there are files in it ?
rm -rf *.*
rmdir directory_name

14)delete a .sh file in unix in present directory ?
rm -Rf .

15)overwrite a unix file
shred option filename -Overwriting the existing file multiple times and securely deleting the file

16)display the line number and the line in a file if the word "DONE" is present in a particular file
grep -n "DONE" filename

17)how to schedule a job in unix ?
crontab -e
opens the scheduler window

* * * * * *  touch abc.txt

save and quit(wq!)

18)cat > f1

cat >> f1 >> f2 >> f3

What will cat f2 display?

Ans) Nill because all the contents are transferred to f3.

Please refer this site also-->http://www.washington.edu/computing/unix/commands.html

--DWH--

1)Disadvantages of datawarehouse model(snowflake or star)

2)Why do we need to have a datwarehouse model.
    can this be done without star or snowflake schema ?

3)What is the approach to load dimension table
Initial
Incremental

4)Is dimension table load a daily load?
static table
Dynamic table

5)Challenges faced in data migration project ?
*capacity, performance, availability, connectivity
*Availability of the data - The data will not be ready all the time so for a client , it is called downtime.
*During data movement the data will not be availble to the end user which is done only during off hours.
*The infrastructure team has even more work to do behind the scenes: are the data protection mechanisms (backup, replication, DR, etc.) working as expected, do the monitoring and reporting tools work, and so on.
*failback provisions are made if something doesn't work as expected
*Since Customer data is fragmented across multiple source systems,
This makes developing a unified customer-centric view extremely difficult.


--SQL--

1)union and union all ... which is faster?
Union all

2)Truncate Parent and child  table at one go.
Answer: Cascade delete

3)How to test a junk data coming from the Production source ?
Data profiling
http://en.wikipedia.org/wiki/Data_profiling

4)EMPLOYEE WHO JOINED AND RELEASED IN THE SAME MONTH
select * from tabl_name where to_char(start_date,'mm-dd-yy') like 'OCT%' and to_char(end_date,'mm-dd-yy') like 'OCT%'
select * from table_name where extract(month from start_date) like 'OCT%' and extract(month from end_date)
like 'OCT%'

5)rowid and rownum? which is permanent ?
rowid is permanent
delete from table_name where rowid not in (select min(rowid) from table_name)--this query is used to remove the
duplicates that has occured and by retaining the first duplicate.

6)File to table data comparison?
FROM excel import the file and use the delimiter functionality to seperate the data.
Data Menu -->From Text


7)inline query ...
Multiple sub Queries enclosed in a sinle line by aliasing it
Ex:
select a,b from (select a,b,c,d from tab_name) where rownum<=5
select d.a,e.b from table_name d,(select a,b,c,d from tab_name)e where d.a=e.b

8)Uncorrelated sub query ..
SELECT customer_name FROM customer_dimension    WHERE (customer_gender, annual_income) IN     (SELECT customer_gender, MAX(annual_income)       FROM customer_dimension      GROUP BY customer_gender);
Correlated sub query..
SELECT employee_number, name
   FROM employees AS Bob
   WHERE salary > (
     SELECT AVG(salary)
       FROM employees
       WHERE department = Bob.department);
In this example we are finding the list of all employees whose salary is above average for their departments
The subquery is evaluated once for each row processed by the outer query

9)views? If the base table is deleted... what is the error encountered when querying for the view?
Views can join and simplify multiple tables into a single virtual table.
Views can represent a subset of the data contained in a table. Consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.View Doesnot contain data. But
Materialized view Contains data. Because Materialised view
contains results of a Query.
Base table or view not found.

10)Materialized views
Stores the result to a table and consumes little space
The data is available anytime unlike the view where the query  will be fired and result has to be fetched that time
Records will be aggregated at regular intervals.



11)Advantages of normalised and de-normalised schemas

--Testing--

1)what is the requirement traceability matrix? What comppnent is it mapped to ?
The Matrix is created at the very beginning of a project as it forms the basis of the project's scope and deliverables that will be produced.
Requirement ID
Risks
Requirement Type
Requirement Description
Trace to Design Specification
Unit Test Cases
Test Case Number
Test STATUS
PHASE AND MODULE COVERED
Integration Test Cases
System Test Cases
User Acceptance Test Cases
Trace to Test Script


2)What is the difference between test strategy and test plan ?
Test Strategy: derived from the Business Requirement Specification document.
one Test Strategy document and different number of Test Plans for each phase or level of testing.
•Test automation and tools
•Risks and mitigation
•Training plan
Test Plan:derived from the software Requirement Specification document.
what to test, how to test, when to test and who will do what test.
usually prepared by the Test Lead
•Features to be tested
•Suspension criteria
•Test techniques



3)sanity and smoke testing ... before starting the project which is done ?
Before and after

Before:
table is present
No data is present before the job is run.

After:
table is present
Data is present afer the job is run.


Excel:

1)Macros and automation










Friday, October 11, 2013

Use you analytic Thinking !!!!




Question 1
Table T1 Table T2
Column A Column B ColumnB Code
1 4 4 XYZ
2 5 5 ABC
3 6    
       
       
1>What will be Output if we use inner join between T1 and T2
2>What will be Output if we use Left outer join between T1 and T2
3>What will be Output if we use Right outer join  between T1 and T2
Question 2
1.Write a Query for below requirement
Table A Lookup Table B
Column A Column B ColumnF Code
1 1                  F
XYZ
2 Null Null -99
3 -1    
-1 22    
       
1.Retrive Code value by doing a lookup between Table A.Column B=Table B.ColumnF
Coditions
If Column A>0 then retrive code value from Table B
If Column A>0 and Column B is Null then do null value transformation
If Column A>0 and Column B=-1 then convert -1 to Null and do the Null value transformation
If Column A<0 as="" blank="" code="" td="" the="" then="" update="" value="">
So Output should be
Column A Column B Code
1 1 XYZ
2 Null -99
3 -1 -99
-1 22 Null
     
Question 3
 1 . Write a query to retrive data exists before '@' in email id.It should work dynamicaly for all the email ids.
 2. Remove all the specical characters and number from the email id column dynamicaly.
Examples
Email Id Expected result after transformation
abcd@gmail.com abcd
abcdefgh@facebook.com abcdefgh
abcd12@yahoo.co.in abcd12
Question 4 Write a Query for below requirement
Table T1
Column A Column B Column C
XYZ ABC T1
XYZ ABC T2
ABC XYZ T3
     
     
Table A2 Table A3
Column D Column E Column F Column G
T1 S1 S1 XYZ
T1 S2 S1 Null
T2 S3 S1 -1
T3 S4 S2 ABC
S3 DWF

1. Eliminate the duplicate records from Table A1 based on columns A and B
2. Then do a Lookup Between Table A1 and Table A2 on TableA1.Column C=Table A2.column D
3. If more than one values found in Table A2 for the same record in Column E then conider only latest record
4. Do a Lookup  between Table A2 and Table A3 on A2.Column E=A3.Column F to retrieve column G from Table A3
5. If any 'Null' and '-1' values exists in Column G of Table A3  then don’t consider those records
Output should be 
Column A Column B Column G
ABC XYZ XYZ


Question 5
What will be the out put if you do Union and Union all betwee Table A and Table B
                                                                        Table A        Table B
36 36
36 36
36 36
36 36
36 36
36 36

Thomson Reuters


1.Explain about your current project?
2.What are Data marts?why do you use ?
3.What is STLC?
4.What is UAT?When does it perform?
5.What is Smoke Testing?
6.What are the Scenarios you cover in ETL Testing?
7.How will you validate Duplicates?
8.Difference between Int and Bigint
9.Difference between Varchar and nvarchar
10.Difference between Unique key and Primary Key
11.Surrogate key use
12.Indexing
13.SubString,String
14.Date Function (How wil you validate the date column?)
15,Pivot in SQL
16.Difference between Union and Full outer join
17.How will you run the jobs in Data stage
18.How to find the maximum salary of the employees.
19.Write the SQL-How will you find the 5th Highest salary from Employee table(Rank and Dense Rank)
20.Difference between Verification and validation of code
21.Unix basic commands
22.What is look up? and How will you validate Foreign Key
23.Normalization(What is it?)
24. RDBMS
25.Indexes(Clustered)




Saturday, June 1, 2013

NESS Interview Questions



1.ETL Architecture


2. Things we need to test in ETL (Ans : Count, Data, Duplicates, Special Char)

3. Difference between group by and order by

4. Having clause

5. Elements of star schema

6. What is fact and dimension

7. 23rd Rank – SQL query

8. Documents we need for testing

9. What we test in Database testing (Ans : Data consistency – count check, Data Validity – data check, Data Integrity- FK check)

10. Process followed in your project

TANGOE Tech Interview Questions

1.What is metadata?


2.ETL Architecture used in your project.

3.Can ETL Testing be used in all domains?(Healthcare and all?)

ANS:Yes

4.Which ETL tool used in your project?

5.How did you load the data from source till datawarehouse??

Using Control M Job scheduler tool

6.What kind of testing you do in your project?

Sistem integration testing-V-model

7.What are the testings you do?

Regression testing,Retesting,Adhoch testing,

8.Explain Defect lifecycle

9.How will you validate the data in ETL testing??Scenarios?

10.Write the query to get minimum,maximum,and avg of col2 of table A in a single query.

11.How will you validate duplicates?

12.What is the difference b/w Where and Having clause???

13.Difference b/w Truncate and Duplicate.Explain in detail

14.Left outer join,inner join and right outer join.

15.Where will you find the log files after job run ? how will you test log files?

16.How will you validate flat files.

17.List out the commands you know in unix

18.what is GREP in unix ?

19.What is PS ?

20.What is cd ?

21.How will you connect to Oracle SQL developer?

DELOITTE INTERVIEW Questions



1.Explain ETL Architecture used in your project


2. How to delete duplicate rows in a table

3. How to find third highest salary

4. Different types of indexes

5. Difference between partition by and group by

6. What is Test Plan? What are the contents in it?

7. Difference between Test strategy and test plan

8. How the sampling would be done for a table with 1million records

9. How the setting up of data had done, and how you identify which all data are needed to test?

10. What is boundary value analysis, and how it can be used in ETL testing

11. Explain about your one day in office

12. The incident which made you to frustrate a lot, and provided happiness at the end

13. What all risks identified in the project

14. What is smoke testing, whether it can be implemented in ETL testing, and how?

15. Why we need foundation tables, while the reporting is mapped to Semantic layer, and why we cannot design without foundation?

16. Why landing area is required, if it is the mirror of source and no transformations are applied between sources and landing?

17. Write test cases that can be used between landing and staging

18. In your project effort estimation is done on the basis of which method.