Posts

Apache Airflow Wait Between Tasks

 Apache Airflow allows you to create custom workflows that can be triggered on a recurring basis at specific time intervals based on your needs. Some concepts to learn are DAGs - this defines the entire workflow Tasks - are the Individual tasks that constitute the workflow Operators - This is an airflow-specific concept, which needs to be understood, Based on what type of tasks you would like to perform there are multiple operators. To run a bash script there is a BashOperator, to run a python code you need to have a Python Operator. For more details, refer  https://airflow.apache.org/docs/apache-airflow/stable/concepts/index.html Above 3 are sufficient to get started, ofcourse there are others like interprocess communication, variables, process dependency management, etc. Let's Define a Simple Workflow we want to achieve DAG = Tasks1 >> Wait for a Day >> Task2 Above is the DAG, where two tasks are executed, second task depends on first task and is executed after a d

Spring Mircorservices interview questions

 1. How would create a transaction with multiple services 2.  Junit and Integration tests 3. does a container get created for each junit test 4. build process 5. your role 6. 

Design and Agile Interview Questions

 1. what are the key design considerations when designing a form say a mortgage form   2. What are the traits you would like to see in your manager team mates      3. Every company has its own way to implement agile, elaborate your experience     -- in retrospective - we do the Sail boat analogy 4. How would you improve the performance of an application. 5. How would you make an existing application more scalabe 6. Give a big story, how would you approach it 7. if a Design team gives  say a complex diaog, but you are not in a position to implement it, how would you approach 8. How do you measure the success of your implementation any KPIs 9. How would you approach Tech debt; 10. What would you prefer, Product centric approach or Customer-centric approach

Java J2EE Security Considerations

Java Application Security Considerations   1. Authentication Insecure Coding Practices Secure Coding Practices Concatenated SQL queries for login validation. In most cases it is seen that user credentials, as retrieved from the request is used to form concatenated login queries. Such instances result in injection flaws in the login page. In case of concatenated SQL query, it leads to SQL Injection vulnerability. String  username =request.getParameter(“username”); String  password =request.getParameter(“password”); String query = “SELECT * FROM users WHERE username = “+ username +” AND password=”+ password ; Statement st = con. createStatement(); Results res = st.executeQuery(query); Use Parameterized or pre-compiled queries. String username=request.getParameter(“username”); String password=request.getParameter(“password”); String query = “SELECT * FROM users WHERE  username =?  AND  password=? “; PreparedStatement  ps = con.prepareStatement(query); ps.setString(1, username); ps.setStri

Hibernate Interview Questions

1. What are the main classes of  Hibernate Session SessionFactory Criteria Query Transaction 2. Lazy loading vs Eager Loading 3. Why is second-level caching not enabled by default? The second Level cache is disabled by default because the configuration and choice of which entities are cacheable is application-specific. In JPA, you can turn on cache for a particular domain with annotation @Cacheable

Java Spring Interview Questions

Java Spring Interview Questions 1. Have you used any Docker? 2. Suppose there is a requirement that for every call we need to create a new instance, how can that be done in Spring Boog Answer - using Spring bean with Scope as Prototype and then every time you need a bean, get the SpringApplicationContext and call ctx.getBean() 3. When a REST API POST call is made, how is that converted to Java objects to work in your controller or service layer Answer - Spring offers ViewResolvers, you can use JSONResolver to convert the JSON inputs to a Java Bean which then can be consumed by Controllers 4. How can you achieve Auto Scaling in kubernetes 5. Have you worked in Hibernate JPA or Spring JDBC in your projects? Answer - both , while Hibernate JPA is good for queries, there are some queries where its not efficient enough and you need to have SQLs itself, like if you want to do a bulk update 6. Explain the process of having your Spring WAR deployed on Kubernetes Cluster? 7. Explain how JWT Aut

Design Patterns

Image
Design Patterns are nothing but proven solutions to recurring problems. 1. Some favorite design patterns      Creational Patterns         - Prototype              - used to create objects by cloning other objects                             - Factory         - Singleton      Structural Design Patterns       They show how the objects are composed, is there an inheritance between them, or is one object composed in another object, interfaces present Proxy Pattern                        e.g credit card is the proxy of the Bank Account Decorator Adds more functionality without opening the object Wraps the decorator another class, it is a component and has a component Advantage - allows you to have multiple combinations among classes Adapter Making two interfaces which are incompatible compatible Facade Simplify the interactions with  too many working complex objects and complex interactions, something you want to call Hides complex behavior