Saturday, 3 July 2021

InteviewPrep

Hardware, OS, Processor are influencers of performance. As software engineer we take only Execution time of algorithm

Big O Notation

  • Time Complexity
  • Space Complexity
  • O(1) -> Constant time and space
  • O(n) -> Linear time and space
  • O(n^2) -> nested loops
  • O(logn) -> for (i=1, i<n, i=i*2)

Searching & Sorting

  • Binary Search 
    • O(log N)

  • Binary Tree Search
  • Hashmap
  • Trie

Sorting

Mergesort

  • O(NLogN)
  • Divide and concur approach
  • Divide the list into 2 equal parts and continue until each list has one element

Counting Sort

  • Array has only 0, 1 & 2s
  • When value is 2, swap with right element, when 0 swap with left element
  • when value is 1 increment mid

Modified QuickSort


Quicksort

Heap

Counting sort 


Design Patterns

  • Singleton
    • Constructor will be private. 
    • Separate static  method to create object in synchronized block and store in private variable when it is null
  • Factory design pattern
    • Create the object with out exposing the creation logic to client
    • Create Abstract class and its implementations

      Public MiModel getInstance(String model){
          MiModel mobile=null;

      If (model.equalsIgnoreCase(“MiBolt”)){
                mobile = new MiBolt();
           } else if (model.equalsIgnoreCase(“MiFire”)){
                Mobile = new MiFire();
      }}
  • Abstract Factory design pattern
    •  Factory class is abstract and it will happen implementations
  • Builder Design pattern
    • Creates multiple instances using Assembly class and returns single inscance of arraylist with all required objects
    • This is used for complex business cases like buy mobile + insurance + service
  • Adaptor Design Pattern
    • Structural design pattern
    • It is used when client has to use another class that it cannot recognize
    • Adapter class implements Interface of class which wants to use Other incompatible class
    • Adapter class creates instance of Other incompatible class and invokes the methods
  • Decorator Design Pattern
    • Structural design pattern
    • Decorator patterns allow a user to add new functionality to an existing object without altering its structure. So, there is no change to the original class
    • Decorator design pattern uses abstract classes or interfaces with the composition to implement the wrapper.
    • The decorator design pattern is structurally almost like the chain of responsibility pattern.
  •  Strategy Design Pattern
    • Used when multiple algorithms for one task
    • eg: Client decides payment Gateway
    • Strategy Class will take instance of the interface and call the actual implementation method
  • Observer Design Pattern
    • Publish Subscription pattern
    • Used for automatic notifications to subscribers
    • Push based notifications
MicroServices Architecture
  • Casestudy
    • Uber had monolithic system
      • It has all modules Passenger Management, Driver Management, Trip Management, Billing, Notifications in single app/code base
      • Problems faced
        • Update on single feature requires complete system upgrade. It requires build & test end-end.
        • Fixing bug becomes extreme dificult
        • Scaling a module and parallel implement a new feature becomes very difficult
      • Solution & Benefits
        • Break into multiple modules & REST api to access them
        • Deploy modules independently
        • Inter-dependency between modules is removed
        • API Gateway 
          • to load balancer 
          • single entry point
          • Validations
          • Analytics
        • Modules communicate with each other via message queues(async communication)
  • ActiveMQ(JMS model)
    • Queue based approach(Point-point communication)
    • Topic based approach(Pub-sub model)
    • JMS client
      • Both publishers & subscribers
    • JMS provier
      • Queue & topic
      • eg: Rabbit MQ
    •  If receiver is blocking use receive(), OR for non blocking asynchronous use event listner
  • How to handle cascading failure 
    • When does it happen
      • When a service is down
      • When service is slow
    • Who to solve 
      • Circuit breaker pattern
        • Services don't communicate directly
        • Instead communicate via Interceptor
        • Interceptor will stop communicating with target service once it identifies it is slow/down
        • Interceptor will send back response itself until target service is back and up
      • How will Interceptor decide target service is down
        • Main counter of pass/fail requests
        • Once the fail requests go beyond threshold, declare target service as down
        • Once timer expired interceptor ALLOW Partial requests to send target service
        • Interceptor can have 3 statuses- Open, Closed, half-open
      • Two main projects that implement Circuit breaker concept
        • Hystrix
          • Implemented by Netflix and is in maintenance mode 
          • This implements only Circuite breaker
        • resilience4j
          • Advisable by Netflix to use it
          • supports Circuit breaker, Rate Limiter, Retry, Bulkhead feature
        •  Uses Decorative design pattern
  • Handling cluster of machines in distributed environment
  • Service Discovery
    • How will one micro service know the address of other microservice
      • Service discovery stores ServiceId/ServiceName
      • One service gets the IPaddress by sending serviceID to Service Discovery and then send the request to other microservice
  • Load Balancer
    • Ribbon
  • Distributed Tracking
    • Used for Debugging
    • TraceId
  • Security
    • Authentication
    • Authorization
    • Network Policy
  • ServiceMesh
    • Popular solution for managing communication between microservices
    • Istio -> control panal which injects sidecar proxy into microservice
    • It does traffic split. We can configure traffic % to new version of deployment(Canary deployment)
Kafka
  • When requests come in form of streams- we need distributed systems like Kafka
  • Kafka is highly available & resilient in node failure.  
  • Supports in automatic recovery.
  • Components
    • Kafka Broker 
      • Messaging system. It has set of machines/brokers. Full set is called Cluster. Producer sends message to Kafka Cluster. Cluster sends to Consumer.
    • Topic 
      • Named Streams of records 
      • Topics distributed among brokers
    • Partitions
      • Topics are huge. These are broken into different partitions.
    • Consumer groups
      • Set of consumers.
      • One consumer can take data from different Brokers
      • One broker can send to only one consumer in a Consumer Group
    • Producer 
    • Consumer
    • zookeeper
      • Maintains Kafka machines
      • Maintains all the brokers that are currently working in Kafka system.
      • It sends heartbeat to each broker. 
Distributed transactions
  • Two phase commit
    • Transaction coordinator sends requests to microservices to Prepare followed by commit
      • Prepare -> locks the transactions
      • Commit -> 
    • This will help system failure cases & concurrency cases
    • If any microservice fails then coordinator will send Abort transaction to other services
    • Disadvantages
      • Slow & dependent on Coordinator
      • Can lead to deadlock
  • SAGA
    • Async in nature
    • Services communicate with Event Bus & Queue
    • Event Bus works with Pub-Sub model
Deployment
  • sidecar pattern
  •  Envoy
System Design Pattern
  •  Sharding Techniques
    • Process of splitting DB across multiple machines to improve scalability of applns
    • Horizontal scaling
    • Pros
      • manageability, Perf, availability & Load Balance
    • Techniques
      • Horizontal/range based Scaling based on zipcode
      • Directory based Partioning
      • Hash-based partitioning
    • Cons
      • Joins, referential integrity
      • Rebalancing
  •  Backend systems
    • SQL
      • Fixed structure, Query slow when joining multiple tables
    • NoSql
      • Scalable projects
      • Key-value DB
        • Redis
      • Document DB-> This have DB-> Collection -> Documents
        • Mongo DB
      • Graph DB
        • Most complex
        • When data is highly interconnected like social networking sites like facebook
        • Nodes(entity) and edges(Relationship)
        •  
  • CAP Theorem - Says only 2/3 features can be achievable with any Distributed system.
    • Consistency(All nodes should be consistent always)
    • Availability(Always available irrespective of traffic, network failure)
    • Partition tolerance(sustain network failure. Whole system doesn't fail)
    • Availability & Consistency -> rdbms
    • Consistency & Partition Tolerance -> Redis, MongoDB, Memcache, Hbase
    • Partition Tolerance & Availability -> Cassandra, CouchDB, DynamoDB
SQL & No-SQL
  • Document Store -> MongoDB
  • Key-Value -> Redis, DynamoDB
  • Column Store -> Cassandra
  • Graph Store -> Neo4j
  • Benefits of No-SQL
    • Insert/delete is easy
    • Add new attribute is easy
  • Disadvantages
    • Doesn't support ACID properties
    • Availability is more important than consistency
    • Read is complex 
HTTP Polling, Long Polling, WebSockets, Serverside Events
  • HTTP Polling
    • Client sends xml http request(Ajax request) to server at small regular intervals 
    • Used in Weather updates
  • Long Polling
    • Technique where server holds client connection until timeout or new info available
    • Drawbacks
      • Latency issue
      • Message Reliability due to delay
  • Websockets
    • Connection will be alive unless either client/server cancels it
    • Bidectional message (dupliex async connection)
    • Real time web applications
    • Online stock broking systems like Zerodha
    • Gaming Application
    • Chat Applns
  • Serverside Events
    • Client sends persistent connection to Server
    • Server will keep on sending responses
Latency, Throughput, Load balancer
Response time,  Processing time
  • HTTP Request includes
    • TCP handshake
    • Request travel time(t1)
    • process time at server(t2)
    • Response travel time(t3)
  • Latency is t1+t3
  • Response time
    • t1+t2+t3
  • Processing time
    • t2
  • Throughput -> Effeciency of server
    • # Requests that can be processed per unit of time
How to design system with low latency
  • Use HTTP/2 protocol - This combines different css+js files into single consolidated file
  • Use CDN - This brings static content closer to user geographically
  • Browser Cache
Load Balancer
  • Add remove servers is easy
  • Health check of servers
  • Reduce network traffic by compression
  • algorithms
    • round robin
    • Hasing method-on RequestID
    • least connections server

Integration Project
  • The integration solution is managed using these middleware components: ƒ 
    • Oracle BPEL (Business Process Execution Language) Process Manager 
    • ƒOracle Retail Integration Bus (RIB)  
Oracle BPEL Process Manager is a Java-based solution that runs on Oracle Application Server. Oracle BPEL Process Manager uses database adapters to connect to data sources in Oracle E-Business Suite
RIB is an asynchronous message bus that subscribes to messages created and published by BPEL processes, to inject the message payload data elements into the RMS database. These Oracle Retail applications use Java Message Service (JMS) adapters to connect to RIB
 
 AP-AR netting across currencies
  • Netting_agreement_rules (je_net_agreements)
    • Currency
    • Bank Account
      • Pay group
      • AP invoice types je_net_suppliers
      • AR Invoice types  je_net_ar_trx_types
      • Trading partner names
  •  Netting Settlement(JE_NET_BATCHES)
    • Create settlement
    • Submit settlement
  • JE_NET_AP_INVS & JE_NET_AR_INVS
  • Payment
    • Netting Payment type
 Complex PO
  • Setup requirements
  • Retainage invoice
  • Retainage Release invoice
  • Business benefits
    • Highvalue  projects
    • Longer lead time
    • progress payments
    • eg: Engineering & construction, Airospace & defence, professional services
      • High value contract, long duration, complex payment terms govered by % of work complete
  • Retainage rate
    • at retainage line & schedule
    • max retainage amount on PO line
  • Retainage Release invoice
  • Document Style

Projects especially those relating to the Engineering and Construction (E&C), Aerospace and Defense (A&D), Professional services have diverse business requirements. These projects are typically characterized by high dollar value (multi-million dollar project), comparatively longer project duration (extending over months or several years) and complex payment terms that are governed by percentage of work completion. Further, such projects require the ability to:

  • finance the contractors/suppliers to start the work (Advance Payment). The advance amount paid to the supplier will be gradually recovered (recoupment) as and when next invoices of actual work are raised based on the recoupment percentage specified in the contract.
  • withhold/retain a percentage of the invoice value before payment is made (Retainage) to the supplier. This is a common business practice in these type of projects to ensure the suppliers/contractors have  enough incentive/motivation to complete the work and deal with quality issues later. The retained amount is later released after a substantial portion or all of the service procurement work is completed.
  • define the individual elements of work or services that need to be completed by the subcontractors and payment terms (Progress Payment Schedule with Pay Items).

  • submit a 'work confirmation' by which suppliers indicate completion of that work element, which are then approved by the PO owner and payments released (invoice paid) based on the Progress Payment Schedule.

As of today, these business processes cannot be managed in Oracle's cloud offering and are considered to be a critical gap by many customers who have transitioned into or looking to transition to the cloud.

Complex payment terms and conditions for fixed price contracts can be captured during the procurement contract flow.  This includes options for progress payments, advances and contract financing, and retainage.  These terms and conditions are supported in Fusion Payables when recording invoices and managing payment execution during the lifetime of the contract.  Seamless and real time status of the purchasing contract, progress, financing and advances balances, retainage and retainage release is provided to both Fusion Payables and Purchasing users.

Contract purchasing is different from normal purchasing in following aspects:

• High dollar value projects.

• Long lead time delivery schedules.

• Progress payments based on work completion.

• Advances and progress based financing options.

• Retainage options


 
Dual UOM Catch Weight
 

Catch weight processing is used for items that naturally vary in size such as blocks of cheese or cuts of meat. Catch weight products use two units of measure: an inventory unit and a catch weight unit.

  • The inventory unit is the unit of measure in which the product is sold, received, transferred, picked, and shipped.
  • The catch weight unit is the unit by which the the item is weighed and invoiced. A nominal or standard weight is generally defined for the inventory unit, making it easy to determine whether a recorded actual weight is within tolerance.

Example

  • Supplier sells chicken by cases, where each case weighs approximately 10 LBs.
  • Buyer places order for 10 cases of chicken and agrees to pay $3 per LB of chicken. They expect roughly 100 LBs of chicken.
  • When supplier fulfills the order, the 10 cases are packed and weighed. The actual weight may deviate from the nominal weight. Say, the actual weight of these 10 cases is 105 LBs.
  • The suppliers sends the invoice for 105 LBs at $3/LB

 

 People Management, Vision and Strategy
  • Mission : Why we exist
    • exampls
      • Prepare students spiritually, academically, professionally to think with clarity, act with integrity, serve with passion
      • To be most innovative and cost-efficient provider of memory based solutions. 
      • Be Emplyeable for ever
  • Vision: Where we want to be
    • Vision can see yourself on top of mountain
    • Dream: Mountain comes to you
  • Core values: how will we behave
  • Core strategy: Where will we foucs
  • Priorities: What are we doing now
    • Strategic priorities: Driving towards long term differentiating vision
    • Operating priorities: Focus on short term, high impact performance improvement

Strategy
  • Currenct course of action to correct future. Management & professional course
  • Differentiated one
    • cost, online
    • aicte approved
    • practical
  • contextual: Make employeble for ever
  •  
 
 Confidence building:
 
 
Vision(Dream): eg: Yound skilled India
  • Effecient
  • quick service
  • innovative
  • technolgy driven
Miaaion(is path to acheieve): 
  • Employable for ever
  • Make everyone effecient. Either process or people
Strategy: 
  • cost efficient mgmt course
  • Upgrade/upskill everyone
  • New technology adoption/experiment
Tactics;
  • Execution method. 
Planning
  • Creating procedure, rules & guidelines for achieving stated objectives
  • Planning is carried at both macro level and micro level
  • Managers need to create broad objectives and mission statements as well as look after the day to day running of the company.
Vision leads to Mission which enables to create strategies that provides guidelines for Tactics to be implemented Operations to carry out what has to be done daily Metrics to measure their effectiveness.
 
Vision: What a company wants to be. It concentrates on future.
  • eg: Microsoft: To help people and business throughout the world realize their full potential.
  • Disney: To make people happy
  • Google's vision statement is “to provide access to the world's information in one click.”
Mission: A statement is used by company to explain, in simple concise terms its purpose for being 
  • Microsoft: Empower every person and every organization on the planet to achieve more
  • Disney: To entertain, inform and inspire people around the globe through the power of storytelling, reflecting the iconic brands, creative minds and innovative technologies that make ours the worlds premier entertainment company.
  • Google mission is to organize the world's information and make it universally accessible and useful. That's why Search makes it easy to discover a broad range of information from a wide variety of sources.
Strategic Planning: High level overview of entire business, its vision, mission and value. The scope of the plan can be 2,3, 5 or 10 years. Managers at every level will turn to the strategic plan to guide their decisions. Hence, it should be forward looking, robust but flexible, with a keen focus on accommodating future growth. 

Crucial components of Strategic planning are
  • Vision: Where does organization want to be 5 years from now.
  • Mission: Realistic overview of the company's aim and ambitions. 
  • Values: 
    • Be the senior whom you looked up. Automate manual process. Helping hand to juniors.
    • TataMotors: Integrity, Responsibility, Excellence, Unity, Pioneering
    • Microsoft: Innovative, trustworthy, Environment, Philanthropy, Corporate social responsibility, Diversity and inclusion
    • Amazon: Customer Obsession, Innovation, Lifelong learning, Ownership, Collaboration, trust, meritocracy
    • Ford: People, products, Profits
Strategic planning process
  1. Identify the business and align it with its vision, mission, & values
  2. Evaluate the business thru the application of its internal strengths, weaknesses, as well as threats, and opportunities that come from external sources
  3. Device novel business statements.
  4. Transform business mission into tactical objectives
  5. implement the tactical objectives

Final steps: To attain the competitive advantage in the implementation of the strategies and evaluating the performance.  


Venkat Values: Service, Integrity, quality, efficiency, innovation, collaboration

Venkat Strategy: People, Quality, growth

Tell me about yourself and the skills and qualities you can bring to this strategic leadership role

  • Show you are someone who can lead thru vision, innovation, courage and the creativity.
    • I am a leader who always focuses my work on the long term vision and objectives of the organization.
    • I can bring confidence and many years experience managing and leading projects and teams. I am an articulate communicator, delegate, and who is not just self-aware but work/needs of customer/clients.
    • 100% guidance, quality, delivery that projects and objectives of the company. The way I am doing for my current organization.
  • Why do you want to work for us
    • Your reputation is excellent. You employ very bright talented people, that makes to create positive impact and stay longer duration.
    • Every one I spoke gave positive feedback.
    • Strategic leadership requires specific level of thinking and action taking. It requires supportive, innovative & forward-looking employers.
  • Give me example of product/service that is marketed well
  • What do you consider when creating or developing a specific Strategic Plan
    1. Write Objective and Vision
    2. Mission Statement- target audience, What makes us different, and  prod/service we want to develop to get us there.
    3. Gap analysis will help skills and resources we need to meet our objectives and realize our vision.
    4. SMART goals - Specific, Measurable, Actionable, results-based and timely.
    5. Monitor progress - to make sure we are on track to achieve our goal/mission
  • What are the biggest challenges our business will face in future
    • Stay ahead wrt consumer demand
    • Attract, recruit and retain talented individuals
  • Name of company that has been disruptive in its market
    • Tesla - electric cars - transition to sustainable energy
22 STRATEGIC LEADERSHIP INTERVIEW QUESTIONS AND ANSWERS 
Q1. Tell me about yourself and the skills and qualities you can bring to this strategic leadership role? 
I am leader who always focuses my work on the long-term vision and objectives of the organization. I am very passionate about my work and others have often described me as a dedicated leader who can not only get the most out of people, but who always ensures everyone within a team takes full responsibility for their actions and for ensuring we all work towards our goals. 
 
I can bring confidence, and many years experience managing and leading projects and teams. I am an articulate communicator and delegate and someone who is not just self-aware, but aware of how the work we do needs to be socially responsible and in line with the needs and expectations of your customers and your client base. 
 
If you hire me within this strategic role, you have my guarantee I will be one hundred percent committed, one hundred percent of the time. I promise to deliver on all of my projects and objectives to ensure the organization continues to grow and develops well into the future.
 
Q2. Why do you want to work for us in this strategic leadership role? 
 
Q3. Give me an example of a great product or service that was marketed extremely well? 
Q4. What do you consider when creating or developing a specific STRATEGIC PLAN? 
Q5. What are the biggest challenges our business will face in the future? 
Q6. Give me an example of a company that has been disruptive in its market? 
Q7. Describe a project you were working on that was going wrong and you took control? 
Q8. What’s the toughest team or department you’ve ever had to manage? 
Q9. What do you like the most and the least about managing teams of people? 
  • I most like is the challenge of consistently delivering team goals for my employer through hard work, the creation of a robust strategic plan and also motivating and inspiring my team to be the best they can be. 
  • In regard to the one thing I most dislike, it’s team members who do not work to the best of their abilities. I have high personal and professional standards, and I would expect my team to be the same.
Q10. How would you help our company to grow within this strategic leadership role? 
Q11. If we gave you the responsibility of creating our company Vision Statement, what would it look like? Q12. What is your approach to strategic leadership? 
  • My approach to leadership is one of vision, transformation and sustainability. I am a strong believer that you cannot achieve your commercial and financial goals if you do not create a clear vision that everyone in the organization believes in and signs up to. 

    Everybody, from the person right at the top of the organization, through to the team who creates and delivers our products and services, must be aware of the vision. It would be my responsibility to ensure we, as an organization, focus on the vision in everything we do. I am also someone who enjoys the challenge of transforming and driving a business forward to keep ahead of industry trends and the demands our customers rightly come to expect. 

    Finally, sustainability in leadership for me is about making sure our business is profitable and it has a healthy balance sheet to enable us to overcome the many challenges that lie ahead. I feel I am a strong leader who has the adaptability and the flexibility to meet the demands of every situation that comes my way.

Q13. Describe a time when you had a disagreement with a colleague or an important client? 
Q14. Talk me through the process you would follow when developing a team of people? 
  • I would develop the team by using a 5-stage process. Stage one would involve clearly defining the ORGANIZATIONAL OBJECTIVES and where I needed the team to be within a set period of time.

    Stage two would involve CONDUCTING APPRAISALS of each team member to identify their strengths, their weaknesses, their career aspirations and what they needed from in order to achieve the organizational objectives. 

    Stage four would involve providing appropriate TRAINING, GUIDANCE AND SUPPORT to help the team achieve their goals and objectives. 

    Finally, stage five would involve a PERIODIC REVIEW PROCESS to look at what we have learnt as a team from the actions we have taken in order to allow us to continually improve and develop collectively.

Q15. When have you delegated effectively? Q16. What’s the toughest decision you’ve ever had to make? 
Q17. Tell me a time when you successfully resolved conflict within a team? 
Q18. Describe a time when you had to use effective negotiation and persuasion techniques to achieve your goal? 
  •  
Q19. What are your strengths? 
  • Visionary who always work towards organizational objectives.
  • Embrace change, Understand necessity in consistent performance & ensure to stay ahead of curve
  • Set high standard and expect same from team.
Q20. What’s your biggest weakness? 
  • Unplugged from work, work-life balance. Learning skills to complete work efficiently and  complete on time.
Q21. What are your salary expectations in this leadership role? 
Q22. That’s the end of your strategic leadership interview, do you have any questions?
 
3rd round
  •  

No comments:

Post a Comment