Tuesday, August 4, 2015

CTS

What are the chanlleges :

Dynamic loading and static loading in partition : hive

Hive

How to use  custom partition in hive?

How to stop flume agent ?

If Flume is installed via an RPM or Debian package, you can use the following commands to start, stop, and restart the Flume agent via init scripts:

$ sudo service flume-ng-agent <start | stop | restart>
You can also run the agent in the foreground directly by using the flume-ng agent command:
$ /usr/bin/flume-ng agent -c <config-dir> -f <config-file> -n <agent-name>
For example:
$ /usr/bin/flume-ng agent -c /etc/flume-ng/conf -f /etc/flume-ng/conf/flume.conf -n agent

describe your architecture using flume ?

describe oozie job  ?

How to enable bucketing what are the steps ?

how to develop UDF and use it as hive functions for what are the steps ?

when do we use partition and when do we use bucketing ?



Read More

Wednesday, July 1, 2015

Wipro

1. How Hbase update the table and Hive will not provide it ?

2. Partition and Bucketing in Hive ?

3. How to merge small files in Hadoop ?

4. If merging happen locally or on cluster ?

5. Merging file is sequencial process or parellel ? if its parellel then how can we achieve parellel processing during it ?


Read More

Monday, June 15, 2015

Visa

JAX-RS?

Folder structure and control flow in details for spring application

How JAX-RS diff than Spring MVC  ?

What type of interceptor avaialble in Spring integration

What is outbound channel in Spring Integration ?


Diff  between apache camel and

Mongo command for search element and update element ?

What is shrading ?

Can we create index in mongo collection ?

JProfiler ?

Can we store map key as Object ?

What is hashing ? The idea of hashing is to distribute the entries (key/value pairs) across an array of buckets.

Find out memory leak in Java program ? JProfiler

Can we change the order for JSON marshalling ?

Can we remove not null element from JSON

How web service support both format JSON + XML ?

@component, @service , @controller,

API managemrnet

Spring REST security

Rest expose

WADL,

How to expose rest service to external service

Swagger

JSON Mapper for ignore properties

Specialization
Generalization
Composition
Encapsualtion

xjc.exe to generate JAXB classes for the given XSD:

Concurrency ...reentrant lock


When a request is sent to the Spring MVC Framework the following sequence of events happen.
-The “DispatcherServlet” first receives the request
-The “DispatcherServlet” consults the “HandlerMapping” and invokes the “Controller” associated with the request
-The “Controller” process the request by calling the appropriate service methods and returns a “ModeAndView” object to the “DispatcherServlet”. The “ModeAndView” object contains the model data and the view name
-The “DispatcherServlet” sends the view name to a “ViewResolver” to find the actual “View” to invoke
-The “DispatcherServlet” passes the model object to the “View” to render the result
-The “View” with the help of the model data renders the result and return it back to the user


http://java.dzone.com/articles/secure-rest-services-using


http://www.jpalace.org/document/36/spring-integration-tutorial


hashCode()

The hashCode() method of objects is used when you insert them into a HashTable, HashMap or HashSet.

If equal, then same hash codes too.
Same hash codes no guarantee of being equal.
================================================================================================================================

Spring Controller ---------------------------

@Controller
class AccountController {
    // RESTful method
    @RequestMapping(value="/accounts", produces={"application/xml", "application/json"})
    @ResponseStatus(HttpStatus.OK)
    public @ResponseBody List<Account> listWithMarshalling(Principal principal) {
        return accountManager.getAccounts(principal);
    }

    // View-based method
    @RequestMapping("/accounts")
    public String listWithView(Model model, Principal principal) {
        // Call RESTful method to avoid repeating account lookup logic
        model.addAttribute( listWithMarshalling(principal) );

        // Return the view to use for rendering the response
        return ¨accounts/list¨;
    }
}


=================================================================================================================================
@RequestBody and @ResposneBody

http://www.beabetterdeveloper.com/2013/07/spring-mvc-requestbody-and-responsebody.html

@RequestMapping
http://www.journaldev.com/3358/spring-mvc-requestmapping-annotation-example-with-controller-methods-headers-params-requestparam-pathvariable


Mongo Commands
http://www.mkyong.com/mongodb/mongodb-hello-world-example/

==================================================================================================================================

import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.message.GenericMessage;





Hibernate has few fetching strategies to optimize the Hibernate generated select statement, so that it can be as efficient as possible. The fetching strategy is declared in the mapping relationship to define how Hibernate fetch its related collections and entities.

Fetching Strategies
There are four fetching strategies

1. fetch-“join” = Disable the lazy loading, always load all the collections and entities.
2. fetch-“select” (default) = Lazy load all the collections and entities.
3. batch-size=”N” = Fetching up to ‘N’ collections or entities, *Not record*.
4. fetch-“subselect” = Group its collection into a sub select statement.

===================================================================================================================================================================================================

Adapter – Convert the interface of a class into another interface clients expect. / Adapter lets classes work together, that could not otherwise because of incompatible interfaces. Note that there are two types of adapter, one is class level adapter and other is object level adapter. Examples –

java.io.InputStreamReader(InputStream) (returns a Reader)
java.io.OutputStreamWriter(OutputStream) (returns a Writer)
javax.xml.bind.annotation.adapters.XmlAdapter#marshal() and #unmarshal()


Bridge – Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. Examples –

JDBC-ODBC Bridge
It is quite difficult to understand from its definition So here are few links to refer –
Link 1 Link 2

Composite – Compose objects into tree structures to represent part-whole hierarchies. / Composite lets clients treat individual objects and compositions of objects uniformly. Examples –

Includes in JSP
java.util.Map#putAll(Map)
java.util.List#addAll(Collection)
java.util.Set#addAll(Collection)
java.nio.ByteBuffer#put(ByteBuffer) (also on CharBuffer, ShortBuffer, IntBuffer, LongBuffer, FloatBuffer and DoubleBuffer)
java.awt.Container#add(Component) (practically all over Swing thus)
A very detailed explanation about Composite pattern is Here

Decorator – add additional responsibilities dynamically to an object. Examples –

All subclasses of java.io.InputStream, OutputStream, Reader and Writer have a constructor taking an instance of same type.
Almost all implementations of java.util.List, Set and Map have a constructor taking an instance of same type.
java.util.Collections, the checkedXXX(), synchronizedXXX() and unmodifiableXXX() methods.
javax.servlet.http.HttpServletRequestWrapper and HttpServletResponseWrapper
Display tag custom tag library proved option to decorator for rendering of tables in JSP.
Any client side JavaScript library which has render-er or parser like Yahoo UI datatable, JQuery grid


Flyweight – use sharing to support a large number of objects that have part of their internal state in common where the other part of state can vary. Examples –

java.lang.Integer#valueOf(int) (also on Boolean, Byte, Character, Short, Long, Float and Double)
Java String creation. (Read about string creation in Java specification)
Swing borders


Proxy – provide a “Placeholder” for an object to control references to it. If you use spring framework, you should be very well acquainted with Proxy. Examples –

Java RMI
Spring AOP creates proxies for supplied objects
All libraries which use Java proxy , Reflection proxy and CGLIB proxy

Memento – capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.

java.util.Date (the setter methods do that, Date is internally represented by a long value)
All implementations of java.io.Serializable
All implementations of javax.faces.component.StateHolder


Types and Examples of NoSQL Databases

1. Key-Values Stores : Examples: Tokyo Cabinet/Tyrant, Redis, Voldemort, Oracle BDB, Amazon SimpleDB, Riak
2. Column Family Stores : Examples: Cassandra, HBase
3. Document Databases : Examples: CouchDB, MongoDb
4. Graph Databases : Examples: Neo4J, InfoGrid, Infinite Graph

Read More

Wednesday, December 17, 2014

BigData : Infosys

Tell me about your prject

Is Hbase providing secondary index ?


Scenario :

if you have billions of  records in DB2 and you want to migrate it to Hadoop because of performance hit while processing like searching , inserting , deleting operation what technologies are you going to use ?

What is the difference between Cassndra and Hbase ?

What is bucketing & partitioning ?

When to use hive and when to use pig ?
What is flow of map reduce code ?
how to access file from hdfs using hive ?
what is external table and manage table ?
using scoop how to import whole db to hdfs ?
which join is better : mapper join or reducer join ?
How does you are joining ip address with use profile  and ipaddress with web logs?
In what formate you will get the data directly from client ?
What is your data size ?
Where are you involve in big data ?
Pros and cons about bigdata ?
Have you heard about impala ?
What is difference between hive and impala ?
Row level locking and table level locking in hive ?
Have you heard about cube in hadoop ?




Read More

Wednesday, December 3, 2014

Raj Interview

What is diff between StringBuilder and StringBuffer

Difference between HashMap and HashTable

Difference between concurrent hashmap and Hashtable

What is mutable class ? How to make class mutable ?

What is dependency injection and IOC. ?

How many type os dependency injection ?

How to integrate Hibernate with Spring ?

What is deadlock ?

What is ORM ?

What is diff between TDD and traditional approach of software development ?

What is lazy loading in hibernate ?

What is AOP ? when its should use ?

How to call stored procedures from java programe ?

What is difference between PreparedStatement and CallableStatement ? 
Read More

Tuesday, November 18, 2014

UTV

1. Collection
how to find out common elements from 2 attay list ?
How can you find out


2. What is best exceptional handling for Web service
3. How to handle http code for user defined error message
4. how to deploy UDF to hive
5. how to develop UDF , UDAF, UDTF
6.

user_id, search_key_ timestamp

how to create external table

7. use above file and design query
count the search_key used by user

8. use above file and design query
top 10  searcy_key used by user

9.  Dictributed Cache ? How it is working ?

10. What is transform functionality in Hive ?

11. What are the aggregative UDF there in Hive ?

12. What are the scope of bean in spring ?

13. If we decalre it as prototypr then how does to handle multiple request ? Will it create instance of bean every time when we call bean ?

14. How can we handle content based routing using spring restful service?

15. if you want to design service through Spring for getAllCustomer, findCustoberById ? what is your approch What kind of designpatern you are going to use and describe in details ?

16. What all design pattern you used ?Example for Singlton , Proxy ?

17. What is the differerence bettern delegation and proxy ?

18. How can prevent to create a class from Sington using reflection?

19 . Difference between iterrator and for loop ?  which one is better for loop large data set ?

20. For frequent insertion and deletion which data structure is good? 
Read More

Tuesday, June 24, 2014

Automotive



  • How does HBase fit in your system

  • You are part of cloud computing department ? how ? 

  • What do you mean by cloud computing ? How its related to SOA?

  • Why map-reduce and why hive ? 

  • In Hadoop cluster management system ? What is your roles and responsibilities ? 

  • What kind of Map-reduce and Hive jobs you have developed ? 

  • How can we prevent Single point of  failure in CDH3 ? 

  • Why not pig instead of Java and SQL ?

  • What is the disadvantage of Hadoop ? 

    • Now, Hadoop is not a magic bullet that solves all kinds of problems. 
    •  
    • Hadoop is not good to process transactions because it is random access. 
    •  
    • It is not good when the work cannot be parallelized. 
    •  
    • It is not good for low latency data access. 
    •  
    • Not good for processing lots of small files. 
    •  
    • And not good for intensive calculations with little data. 


Read More

Pages

Copyright by Alpesh. Powered by Blogger.