DronaBlog

Tuesday, August 14, 2018

Java Interview Questions and Answers - Part I

 Are you looking for which questions are asked during a Java interview? If so, then refer to this question and answer article on Java and supporting technologies. This article explains all Java related concepts in detail. This is the first article of the Java Interview Questions and Answers series.


Q1: What are the differences between Java and C++?
Answer:

Sr. No.
Java
C++
1
Java does not support pointers. Pointers are inherently tricky to use and troublesome.
C++ supports pointers.
2
Java does not support multiple inheritances because it causes more problems than it solves.
C++ supports multiple inheritances.
3
Java does not support destructors but adds a finalize() method. Finalize methods are called by the garbage collector prior to reclaiming the memory occupied by the object.
C++ supports destructors which are automatically invoked when the object is destroyed.
4
Java does not include structures or unions because the traditional data structures are implemented as an object oriented framework.
C++ includes structures.
5
Java includes automatic garbage collection.
C++ requires explicit memory management.
6
Java has built in support for threads. In Java, there is a Thread class that you inherit to create a new thread and override the run() method.
C++ has no built in support for threads. C++ relies on non-standard third-party libraries for thread support.
7
Pointers, references, and pass-by-value are supported for all types (primitive or user-defined).
All types (primitive types and reference types) are always passed by value.


Q2: Explain the Java Platform.
Answer:
  • It is a software-only platform and it runs on top of other hardware-based platforms like UNIX, NT etc.
  • Java has a set of classes written in the Java language. Such classes are called the Java Application Programming Interface (Java API). It runs on the Java Virtual Machine.
  • Java Virtual Machine (JVM) is a software that is installed on the hardware platforms. JVM uses Byte codes as the machine language.

Q3 : What are the uses of Java packages? 
Answer:
Java package is a namespace. It helps to group a set of related classes and interfaces together. e.g. java.lang package is used to  group classes to the design of the Java programming language. Packages play a significant role in resolving conflicts in class names. 

For example, in the real time world we keep documents in one folder, images are kept in a separate folder and scripts or code are kept in a different folder. Packages keep classes in different packages for better organization of source code and also to resolve conflicts if class names are the same.

In order to create a package for your class use the statement below as the first statement - 
package com.abc.pqr;

Here, package is the keyword in Java and com.abc.pqr is the package name.

If you are going to import any other class then import the package in your class as,
import java.io.*;


Q4: What is Classpath in Java?
Answer: Classpath is a parameter in the Java Virtual Machine. It specifies the location of user-defined classes and packages. It can be set either on the command-line or through an environment variable.

Have you noticed the error below while running the  Java program?
Exception in thread "main" java.lang.NoClassDefFoundError: com/abc/pqr/MyWorld

If so, then you have not set the classpath in your system. To resolve this issue you can use one of the approaches below -

1. Set your project in the CLASSPATH environment variable of your system. e.g. "c:/TestProject"
2. Set the jar file of your project in the CLASSPATH environment variable of your system. This jar file should contain your .class file.to have a jar file e.g. we need to set the "c:/TestProject/HelloWorld.jar"" jar file in CLASSPATH and this .jar file has the MyWorld.class file in it. 
3. Run it with –cp or –classpath commands as shown below:
c:\>java –cp c:/TestProject com.abc.pqr.MyWorld
OR
c:\>java -classpath c:/TestProject/HelloWorld.jar com.abc.pqr.MyWorld


Q5: What are the advantages of the Object Oriented Approach?
Answer: Java is the Object Oriented Language and it comes with the benefits mentioned below due to its Object Oriented approach:
  1. We can achieve code re-usability with help of implementation inheritance and object composition.
  2. Everything in Java is an object and it maps to the real world. E.g vehicles, customers
  3. It helps to create modular architecture with the help of objects, systems, frameworks etc which are the building blocks of the big application.
  4. An Object Oriented Program forces designers to go through an extensive planning phase, which makes for better designs with less flaws.
  5. An Object Oriented Program is much easier to modify and maintain than a non-Object Oriented Program. 



Thursday, August 9, 2018

Important File and Directory permissions in Unix


Are you looking for how permissions works in the Unix Operating system? Would you be interested in knowing what types of permissions are available in the Unix environment? The details about permissions in the Unix are explained in this article. This article also provides highlights on various characteristics about File and Directory permissions.


What are the types of file permissions?

The file permissions categories are as follows:
  • Owner permissions − It determines what actions the owner of the file can perform on the file.
  • Group permissions − It determines what actions a user, who is a member of the group to which a file belongs, can perform on the file.
  • Other (world) permissions − It indicates what action all other users can perform on the file. 

How to display Permissions?

  •  To display permissions on screen use ‘ls –l’ command -> read (r), write (w), execute (x)          e.g.
          ls –l /usr/tmp
    -rwxr-xr-- 1 testuser users 1017 Jan 2 00:10 myfile
    drwxr-xr-- 1 testuer users 1017 Jan 2 00:10 mydir
  • Here, the first column represents different access modes, i.e., the permission associated with a file or a directory. The first character ‘-‘ stands for the file and the character ‘d’ stands for the directory.
  • The first three characters (2-4) represent the permissions for the file's owner. For example, -rwxr-xr-- represents that the owner has read (r), write (w) and execute (x) permission.
  • The second group of three characters (5-7) consists of the permissions for the group to which the file belongs. For example, -rwxr-xr-- represents that the group has read (r) and execute (x) permission, but no write permission.
  • The last group of three characters (8-10) represents the permissions for everyone else. For example, -rwxr-xr-- represents that there is read (r) only permission. 

Understanding File access modes

There are three types of file access modes: Read, Write and Execute. Mentioned below are the details about each mode:
  • Read : Grants the capability to read, i.e., view the contents of the file.
  • Write: Grants the capability to modify or remove the content of the file.
  • Execute: User with execute permissions can run a file as a program. 

Understanding Directory access mode

There are three types of directory access modes: Read, Write and Execute. Mentioned below are the details about each mode:
  • Read: Access to a directory means that the user can read the contents. The user can look at the filenames inside the directory.
  • Write: Access means that the user can add or delete files from the directory.
  • Execute: Executing a directory doesn't really make sense, so think of this as a traverse permission. A user must have execute access to the bin directory in order to execute the ls or the cd command. 

How to change permissions?

Use the chmod (change mode) command to change permissions.
There are two ways to use chmod:
  1. The symbolic mode
  2. The absolute mode 

Symbolic mode

With symbolic permissions we can add, delete, or specify the permission set we want by using the operators
 + : Adds the designated permission(s) to a file or directory
  - : Removes the designated permission(s) from a file or directory
  = : Sets the designated permission(s)
a) Change permission for other users
                  chmod o+wx test1file
b) Change permission for owner user
                  chmod u-x testfile
c) Change permission for group
                 chmod g=rx testfile
d) Change permission for users and groups
                 chmod o+wx,u-x,g=rx testfile

Absolute Mode

Use a number to specify each set of permissions for the file

Number
Description
Detail
0
No permission
---
1
Execute permission
--x
2
Write permission
-w-
3
Execute and write permission: 1 (execute) + 2 (write) = 3
-wx
4
Read permission
r--
5
Read and execute permission: 4 (read) + 1 (execute) = 5
r-x
6
Read and write permission: 4 (read) + 2 (write) = 6
rw-
7
All permissions: 4 (read) + 2 (write) + 1 (execute) = 7
rwx

Examples

a) chmod 755 testfile (all, read-write, read-write)
b) chmod 743 testfile (all, read,write-execute)
c) chmod 043 testfile (no permission, read, write-execute)


More details about the file and directory are explained with examples in the video below:



Wednesday, August 8, 2018

Informatica Master Data Management - MDM - Quiz - 4

Q1. Which is not Correct regarding Landing tables?

A. A Single landing table could receive data from different source systems.
B. A Staging table is mapped to only one Landing table.
C. Landing tables do not have system columns.
D. Delta Detection is not a Landing table property.

Q2. Which feature is supported by Informatica Data Director?

A. Task oriented workflow capability.
B. A mechanism for hiding(masking) information based on security roles.
C. Localization of the Lookup display values.
D. All choices are correct.

Q3. When you select view rejects from the batch job log, you can see the reason why each record was rejected

A. True
B. False

Q4. Which meta data table is used to track the changes to a base object?

A. C_baseObjectName_HXRF
B. C_baseObjectName_HCTL
C. C_baseObjectName_HIST
D. All are correct

Q5. When performing data analysis which one of the following would you look for?

A. The availability of primary keys.
B. Which fields can come from each source.
C. Data Cardinality.
D. All the choices are correct.

Previous Quiz             Next Quiz

Sample SOAP UI Request and Response for RecalculateBO and RecalculateBVT

Are you looking for sample SOAP UI requests for RecalculateBO and RecalculateBVT? Are you also interested in knowing the request and response structure with elements in it? If so, then this article provides all this information.

Sample executeBatchRecalculateBo request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:siperian.api">
   <soapenv:Header/> 
   <soapenv:Body>
      <urn:executeBatchRecalculateBo>
         <urn:username>xxxx</urn:username> 
         <urn:password> 
            <urn:password>yyyy</urn:password> 
            <urn:encrypted>false</urn:encrypted> 
         </urn:password> 
         <urn:orsId>localhost-orcl-CMX_ORS</urn:orsId> 
         <urn:tableName>C_ADDRESS</urn:tableName>         <urn:rowidObjectTable>TMP_ADDRESS_RECALCBO_1</urn:rowidObjectTable> 
      </urn:executeBatchRecalculateBo> 
   </soapenv:Body> 
</soapenv:Envelope> 



Sample executeBatchRecalculateBo response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=http://www.w3.org/2001/XMLSchema 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <executeBatchRecalculateBoReturn xmlns="urn:siperian.api">
         <message>Succeeded</message>
         <retCode>0</retCode>
         <jobRunStatus>0</jobRunStatus>
      </executeBatchRecalculateBoReturn>
   </soapenv:Body>
</soapenv:Envelope>

Sample executeBatchRecalculateBvt request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:siperian.api"> 
   <soapenv:Header/> 
   <soapenv:Body>
      <urn:executeBatchRecalculateBvt> 
         <urn:username>xxx</urn:username> 
         <urn:password> 
            <urn:password>yyyy</urn:password> 
            <urn:encrypted>false</urn:encrypted> 
         </urn:password> 
         <urn:orsId>localhost-orcl-CMX_ORS</urn:orsId> 
         <urn:tableName>C_ADDRESS</urn:tableName> 
         <urn:rowidObject>120001 </urn:rowidObject> 
      </urn:executeBatchRecalculateBvt> 
   </soapenv:Body> 
</soapenv:Envelope> 

Sample executeBatchRecalculateBvt response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=http://www.w3.org/2001/XMLSchema 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <executeBatchRecalculateBvtReturn xmlns="urn:siperian.api">
         <message>Succeeded</message>
         <retCode>0</retCode>
         <jobRunStatus>0</jobRunStatus>
      </executeBatchRecalculateBvtReturn>
   </soapenv:Body>
</soapenv:Envelope>

Tuesday, August 7, 2018

Top 10 questions about Informatica MDM - Synchronization and RecalculateBO Jobs

Would you like to know about synchronization and RecalculateBO jobs in Informatica MDM? Are you also interested in knowing about what is the difference between RecalculateBO and RecalculateBvt? If so, then this article answers all these questions and also provides highlights on the wide variety of features related to RecalculateBO.

Q1: What are the conditions under which the Synchronize Job appears in the Batch Viewer for a Base Object in MDM?
Answer: These are the conditions under which the Synchronize Job appears in the Batch Viewer:
  • Enable trust on an untrusted column 
  • No changes made to the Staging Table can cause the Synchronize job to appear. For instance, adding a column which is trusted in the Base Object to a Staging table.

Q2: What changes to Trust on a Base Object does NOT cause the Synchronize job to appear?
Answer: 
  • Enable trust on an untrusted column > release lock (see Synchronize job) > disable trust on same column > release lock (Synchronize no longer seen);
  • Change max trust value on a trusted column
  • Disable trust on a column
  • Enable Validation on a column
  • Disable Validation on a column

Q3: What causes the synchronize job to not become active when the Trust column is modified?
Answer: 
When an existing Trust column is modified by adding another Source system, the Trust does not work as expected because there are missing CTL entries for the newly added Trusted source. 

To enable the Synchronize job follow the steps mentioned below:
  1. Run the SQL script UPDATE C_REPOS_COLUMN  SET  DIRTY_CTL_IND=1  WHERE  ROWID_COLUMN='<rowid_column>';
  2. After the script is commited, run the job from Console.
  3. Refresh the Console. 
Q5: What is the difference between "Recalculate_BO" and "Recalculate_BVT" in MDM? 
Answer: 
1) Recalculate_BO job is used when you want to run it for the entire Base Object, or a few records in the Base Object.
  • ROWID_OBJECT_TABLE parameter: Recalculates all the Base Objects identified by the ROWID_OBJECT column.
  • No ROWID_OBJECT_TABLE parameter: Recalculates all the records in a Base Object in batches of MATCH_BATCH_SIZE or one fourth of the total number of records in the table, whichever is less. 
2) Run Recalculate_BVT job is used to run it for a single record.

Q6: Which API is faster  "executeBatchRecalculateBvt SIF API" or "executeBatchRecalculateBo SIF API"? 
Answer: 
  • The ​executeBatchRecalculateBo API is usually faster when multiple records need to recalculate BVT. 
  • The executeBatchRecalculateBvt API is faster when a single record needs to recalculate BVT.

Q7: Is the "<BO>_VXR" table impacted when a record is changed in MDM?
Answer: Yes, when we perform DELETE, PUT, MERGE and UNMERGE tasks, Master Data Management (MDM) recalculates the Best Version Of Truth (BVT) on existing Active records. 


Q8: Is it enough to run the Synchronize job after adding trust to a new column in MDM? 
Answer: No, Synchronize job just handles correcting the <BASE_OBJECT>_CTL table. We need to run executeBatchRecalculateBo after adding trust to a column.


Q9: When should we run "Revalidate" jobs in MDM? 
Answer: 
  • If the validation rules are modified in the Base Object, then run the Revalidate job. 
  • We have to manually run this job from the Batch Viewer. 
  • Validation job gets enabled only when you have modified any column for validation after the initial load and before the merge job is run.

Q10: What is the behavior of the Revalidate job across MDM tables? 
Answer: 
  • The Revalidate Base Object will check and/or change the trust score. 
  • It only calculates the trust score according to validation rules. 
  • It will be used during the recalculate Best Version of Truth (BVT) job.
  • When recalculate BVT is run, the records in the Base Object may/may not change. It depends on the trust score during that time.
The video below provides details about Synchronization and RecalculateBO jobs in Informatica MDM?


Monday, August 6, 2018

Important and Useful Unix commands

Are you looking for an article which provides a list of important commands used for daily unix activities? This article provides a consolidated list of unix commands.

Introduction

In this article we have listed unix commands for : File and Directories, Compressed Files and Manipulating Data

File and Directory

Command
Details
cat
Displays File Contents
cd
Changes Directory to another directory
chgrp
Changes file group
chmod
Changes permissions
cp
Copies source file into destination
file
Determines file type
find
Finds files
grep
Searches files for regular expressions
head
Displays first few lines of a file
ln
Creates softlink on oldname
ls
Displays information about file type
mkdir
Creates a new directory dirname
more
Displays data in paginated form
mv
Moves (Renames) an oldname to newname
pwd
Prints current working directory
rm
Removes (Deletes) filename
rmdir
Deletes an existing directory provided it is empty
tail
Prints last few lines in a file
touch
Updates access and modification time of a file
vi
To view file content

Compressed Files

Command
Details
compress
Compresses files
gunzip
Helps uncompress gzipped files
gzip
GNU alternative compression method
uncompress
Helps uncompress files
unzip
List, test and extract compressed files in a ZIP archive
zcat
Cat a compressed file
zcmp
Compares compressed files
zdiff
Compares compressed files
zmore
File perusal filter for crt viewing of compressed text
apropos
Locates commands by keyword lookup
info
Displays command information pages online
man
Displays manual pages online
whatis
Searches the whatis database for complete words
yelp
GNOME help viewer

Manipulating Data

Command
Details
awk
Pattern scanning and processing language
cmp
Compares the contents of two files
comm
Compares sorted data
cut
Cuts out selected fields of each line of a file
diff
Differential file comparator
expand
Expands tabs to spaces
join
Joins files on some common field
perl
Data manipulation language
sed
Stream text editor
sort
Sorts file data
split
Splits file into smaller files
tr
Translates characters
uniq
Reports repeated lines in a file
wc
Counts words, lines, and characters
vi
Opens vi text editor
vim
Opens vim text editor
fmt
Simple text formatter
spell
Checks text for spelling error
ispell
Checks text for spelling error
emacs
GNU project Emacs
ex, edit
Line editor


The video below provides a tutorial on Unix topics -


What is CRM system?

  In the digital age, where customer-centricity reigns supreme, businesses are increasingly turning to advanced technologies to manage and n...