Wednesday, December 22, 2021

Places to visit in Hyderabad

 

1. Golconda Fort, Qutub shahi tombs, Hatiyan Jhad baobab tree(600 year old giant banyan tree)
2. Charminar, chowmahalla palace
3. Tank bund, boat ride to buddha statue.
4. Boating in durgam cheruvu (Evening times)
5. Khajaguda hiking, lake & statue
6. Ramoji film city
7.  Ms Maqta art district

8.  Jagannath temple, birla mandir

9.  Nehru zoo park

10. Salar jung Museum
11. Shilparamam

Saturday, December 11, 2021

Introducing solids - 6 months baby

WHEN TO START SOLIDS
1. Start when child is developmentally ready. Till then offer only bm /fm.
Criteria for solid readiness:
Child can sit with support and hold head steady
- Has lost tongue thrust: does not push out food
2. Most health authorities (eg WHO, NHS) recommend waiting till the completion of 6 months (180 days) before starting solids.
3. Some signs that can be mistaken for a child being ready for solid foods:
- chewing fists
- waking in the night when they have previously slept through
- wanting extra milk feeds
4. Till 1 year bm/fm is the main source of nutrition and solids are complimentary
HOW TO OFFER SOLIDS
5. Child should be seated in upright position for feeding - Can be in your lap or booster chair or high chair. Lying down or in inclined position increase the risk of choking and not recommended #twupright
FREQUENCY
6. At 6 months, start with one meal.
- Increase meals slowly to offer 2-3 meals by 8m.
- By 1 year, child should be offered 3 meals + 1 or 2 snacks
7. Offer solids around 30-45 min after breastfeeding or 1-1.5 hours after formula feed. A very hungry child expects feed and might reject solids. This ensures that BM/FF feeds are not dropped in favour of solids. #twresponsivefeeding
WHAT TO OFFER
8. Infant food should be rich in micronutrients like iron and zinc. Also include fat which is required for brain development. #twiron
9. Can start with steamed veggies, porridges, grains, lentils. Also check #twvegfirstweaning.
10. Food should be thick enough to not fall off the spoon #twsolidconsistency. Runny food lacks enough calories and additionally risks displacing the much more nutritious BM/FF.
11. Pureeing is not mandatory. Though babies do not have teeth, their gums are strong enough to bite. It's fine to start with lightly mashed food or textured food. #twnoteeth
12. There is no need to add BM or formula to food. We recommend keeping food and feeds separate.
13. Gradually move on to family food minus salt, sugar and less spices by 7-8 months #twnosaltsugar #twnosalt #twnosugar #twfamilypot
14. Allow baby to touch and explore the food being fed from day 1. It could be a preloaded spoon of puree or finger food.
15. Babies are not habituated to eating added salt/sugar unless exposed, so do not worry about food being tasteless or bland. Use other spices to compensate. All spices apart from salt/sugar can be used, please use discretion with chilly and such. Avoid poppy seeds or nutmeg in large amounts #twspicelist
16. Do not always offer alternatives to food, but provide one safe option if child seems to be picky about food #twdor
17. Don't give animal milk as a drink, but using dairy products in food is fine in limitations #twdairy #twiron
ALLERGIES
19. Common allergens
- dairy (milk products)
- egg
- soya
- nuts
- some seafood
20. Latest allergy recommendations suggest introducing all allergens early (by 8m) . Delaying allergens worsens allergies. Offering the same food for 3 days (or 5 days) is not required as per the latest recommendations. Be slow and careful with known allergens, otherwise new food can be offered everyday. Offer new food in the early part of the day to check reactions #twnuts #twallergies
WHAT NOT TO OFFER
21. It's not recommended to give:
- Honey
- Choking hazards (see #twchokinghazard)
- Any form of sugar (sugar, jaggery, palm sugar, palm jaggery) #twnosugar
- Any form of salt #twnosalt
- Liquid foods (juices, soups, dal water, rice water, runny purees and porridges) – they displace bm and can cause malnutrition risk #twsolidconsistency
- processed baby foods like cerelac and biscuits #twprocessedfood
- do not offer food lying down #twupright
HOW MUCH TO OFFER
22. Baby decides the quantity. Look for subtle signs of rejection like turning head, pursing lips #twresponsivefeeding
23. Do not resort to distractions or force baby to eat more #tw_distraction_feeding
WATER
24. Limit water intake to few sips after meals. Can be offered with spoon, straw cup or open cup. Hard/soft spout cups are not recommended for prolonged use #twhydration #twcups

CSS tricks

 






Saturday, November 13, 2021

Ladakh Trip

Ladakh was on my bucket list since couple of years now!! I have heard lot of nice stories from my colleagues who went for biking trip and other adventurous stuff they have done and I too wanted to explore. 

I had went to Rajasthan trip and pinged Arnab, my college friend if he was in Delhi as I had 5 hours of layover. This reminded him of me and after couple of weeks, he pinged me asking if I'm interested in Ladakh trip. I jumped it and asked my college best buddy to join in too! All things fell into place and the two couples booked flight tickets couple of weeks before the trip! 

Here are few pictures and small details from the trip which you can find it useful while planning yours!! 

Itinerary:

Day 01

Arrive at Leh Reach Leh by flight; Drive to Leh (5 min); rest, acclimatize and walk around;

 

Outside our stay at Leh

Day 02: Leh to Hunder (Nubra valley) via Khardung La After breakfast, drive to Nubra Valley via Khardung La. This pass has one of the highest motorable roads in the world. After spending some time at Khardung La, we proceed to Nubra. On the way, we can visit Diskit monastery and the giant Maitreya Buddha statue. Enjoy Camel Safari in the late afternoon. Overnight stay will be in Nubra. 

Butter tea, a very famous local tea



Enjoying the view at Nubra Valley @ camel safari

Day 03: Hunder to Turtuk and back to Hunder We drive to the beautiful Balti village of Turtuk. The LOC is quite close to this place and if allowed at that moment, we can visit a border check-post. We drive back along the beautiful valley to Hunder. 

In the lanes of the Balti village


At the northern most point of India, Thang Village


Day 04: Nubra to Pangong via Shyok We will start the day following the same route towards Leh till we reach Khalsar. From the Agyam bridge, we will take the left route which leads us to the villages of Shyok and Durbuk. The route is rarely used for commuting so traffic is very sparse. After Durbuk, we take left towards Tangtse and follow the traditional route. We drive further to reach Pangong Lake, one of the most beautiful natural brackish lakes in the Himalayas. After spending some time walking and exploring beside the lake, we drive further on the road along the lake. Our stay will be at the small lakeside village of Merak. 

Day 05: Pangong Lake to Tso Moriri On this day, we embark on a journey towards another high-altitude and more offbeat saltwater lake, Tso Moriri (higher than Pangong in altitude). The route goes through some of the most remote parts of Ladakh with villages such as Chushul and Nyoma. Keep an eye out for some wildlife. Our destination, Korzok is a quaint village with a rustic look located beside the lake. 

Day 06: Explore the region of Tso Moriri This entire day is for you to relax, rejuvenate and explore the village and area of the highest saltwater lake of India, Tso Moriri. 

Day 07: Tso Moriri to Leh After breakfast, we start our journey for Leh. On the way we visit Hemis Monastery, Thiksey Monastery and Shey Palace. 

Day 08: Leh – local sights Visit Leh palace, Shanti Stupa, Leh market and Hall of Fame. 

Maitreya Monastery, on the way back to Leh 
Such a big statue of Maitreya Buddha inside the monastery

Day 09: Departure from Leh After breakfast, get transferred to Leh Airport for boarding your return flight.

Friday, November 12, 2021

Program Manager Roles questions

Case studies, Business plans, Guesstimates

Design the world's best coffee machine

You're sitting next to the CEO of Indian Oil, he says that govt is planning to close down all the free-lefts in India. Should he be concerned? What's the impact on his business?

I want to start a startup in Home Automation area. What should I do? How should I go about it?

How do we solve the parking problem in hyderabad? Can we make something like airbnb for parking? that you can book parking slots? Design it completely, all features and prioritization etc

Tuesday, October 19, 2021

Sooji Besan Idli

1/2 cup besan,  1/2 cup sooji , 1 tsp sugar, 1/4 tsp haldi powder, salt to taste, 1 tbsp oil, 1/2 curd, 1/2 water.

Mix well, cover and keep aside for 10-15 mins.

Mix, add 1tsp eno, add little water on eno.

Mix, pour the batter on greased idli plates.

Steam for 15 mins, done.

Make tadka of raai, kadi patta and green chillies.

Add idli to tadka, mix well and enjoy.



Wednesday, October 6, 2021

System Design - Things to focus on

This allows you to demonstrate your

design skill, defend your design choices, and respond to feedback in a constructive manner

An effective system design interview gives strong signals about a

person's ability to collaborate, to work under pressure, and to resolve ambiguity

constructively. The ability to ask good questions is also an essential skill, and many

interviewers specifically look for this skill.


1. Scalable

2. How easy is it to add or change feature 

3. Easy maintenance 

4. Create proper interface for extensibility

5. Which database use - Sql or no Sql 

6. How to optimize query so that multiple calls don't bring the system down.

1. Gather requirements(use case, who is customer, why is this needed etc.)
2. Discuss system constraints (any limitations, what is allowed vs what is not)
3. Do capacity estimation, specifically
- traffic estimation (read request per sec, write requests per sec)
- storage estimation (storage needed to store worth 3 yrs of stored 'object')
- bandwidth estimate (#of bytes/sec system should handle for incoming and outgoing traffic)
- cache estimate (memory needed to cache some of the hot read responses, 80-20 rule)

4. Define System APIs - Rest style mostly (read about Rest vs Soap)
5. Draw top level system diagram (client, web servers, platform, database, worker services)
6. Discuss database design choice (schema, SQL or no-SQL)
7. Perfect your design for a single user -> get a Minimum Viable Product
8. Discuss scaling
- find bottlenecks and single point of failures (put load balancer, caching, replication, Message queues, Asynchronous workers)
9. Test and Review your design (Treat this one as same what you do in coding interview)
- walk through your system and see if we met each customers need
- did we provide APIs for each customer ask
- did we walk over failover scenarios (not just vanilla passing case)
- did we draw system boundaries/or blocks to explain different parts of systems


My Approach to System Design - Blind (teamblind.com)

https://github.com/kilimchoi/engineering-blogs
http://blog.gainlo.co/index.php/category/system-design-interview-questions/
https://github.com/donnemartin/system-design-primer


Designing a URL Shortening service like TinyURL - Grokking the System Design Interview (educative.io)

Designing Instagram - Grokking the System Design Interview (educative.io)


Algo questions to prepare from:


https://leetcode.com/discuss/interview-question/448285/List-of-questions-sorted-by-common-patterns
https://www.educative.io/courses/grokking-the-coding-interview
https://leetcode.com/discuss/general-discussion/458695/dynamic-programming-patterns
https://medium.com/leetcode-patterns
https://www.firecode.io/problems/index

A distributed key-value store is also called a distributed hash table, which distributes keyvalue pairs across many servers. When designing a distributed system, it is important to understand CAP (Consistency, Availability, Partition Tolerance) theorem. CAP theorem CAP theorem states it is impossible for a distributed system to simultaneously provide more than two of these three guarantees: consistency, availability, and partition tolerance. Let us establish a few definitions. Consistency: consistency means all clients see the same data at the same time no matter which node they connect to. Availability: availability means any client which requests data gets a response even if some of the nodes are down. Partition Tolerance: a partition indicates a communication break between two nodes. Partition tolerance means the system continues to operate despite network partitions. 

Gossip protocol works as follows: • Each node maintains a node membership list, which contains member IDs and heartbeat counters. • Each node periodically increments its heartbeat counter. • Each node periodically sends heartbeats to a set of random nodes, which in turn propagate to another set of nodes. • Once nodes receive heartbeats, membership list is updated to the latest info. • If the heartbeat has not increased for more than predefined periods, the member is considered as offline. 


https://pdfcoffee.com/system-design-interview-an-insiders-guidepdf-pdf-free.html?fbclid=IwAR0_1I7i8qEvNfdJjpYgxX42_ncqLDvrU6IcCWr4YnnmtLW15kkZKdlVYXE

Thursday, September 23, 2021

Difference between SQL and No SQL

 SQL: 

    If Schema doesnt change

    Pros- Normalization and Joins

    Cons- Usually its hosted server in machines


No SQL:

    Scaling is easy

    Schema not defined

    High load Json schema 

    Consistency not checked

1. Your application requires super-low latency

2. Data are unstructured or you do not have any relational data.

3. You only need to serialize and deserialize data JSON, XML or YAML.

4. You  need to store a massive amount of data.


Wednesday, September 8, 2021

Self check

 In what circumstance would you use BFS (Breadth First Search) instead of Dijkstra's for finding a shortest path in a graph?

a) When you have an unweighted graph

or

b) When you have a weighted graph


What is the worst-case lookup time for a self-balancing binary search tree? Can you name a common example or type?


What is the average running time of heapsort in big-O notation? What is one benefit of using heap sort compared to merge sort?

Which of the following typically uses a Queue for an efficient implementation?

a) Breadth First Search (BFS)

b) Depth First Search (DFS)

c) Recursion


Which of the following data structures do NOT guarantee O(log n) lookup time?

a) red-black tree

b) binary tree

c) linked list

d) hash table


bcd


1. Score Negative 

2. Communication - was good 

3. Explain theory very well

4. Better solution - pick up hints

5. Data Structure & Algorithm 

6. Coding - Pretty readable and boundary cases.

7. Time Management - M 20 mins, H 35 mins 


A Supply Chain

Cap Theorem  where cosmos db stads for ?

how Distributed system works 

Gossip protocol - they maintain consistency with this

Raft protocol - 

consensus protocol

Adapter Pattern

SOLID Principles

composition over inheritance 

Strategy Pattern - DI - change dynamically 

Anti Patterns 

Flatten [[1,2],[3,[4,[5]]]] in javascript 

1. Given a set of boxes, reduce the total number of boxes by placing smaller box inside a bigger box.

you can't put more than one box of same size inside a bigger box. return the sum of final box sizes.
{10, 50, 20, 40, 30} Returns: 50
{100, 50, 100, 50, 50, 100} Returns: 300

2. Given an array of integers of size 2n, write an algorithm to arrange them such that first n elements and last n elements are set up in alternative manner.

Say n = 3 and 2n elements are {x1, x2, x3, y1, y2, y3} , then result should be {x1, y1, x2, y2, x3, y3}.
2n is always in power of 2, that is 2^i

Example:

 A [] = {1, 3, 5, 7, 9, 2, 4, 6, 8, 10}, n= 5
Output: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

A SAP :

3. Given a stream of integers, find the first non-duplicate integer

4. Check whether the tree is complete binary tree or not.


Topics to cover:

Binary search
Graphs, BFS/DFS/Flood fill Tree traversals Hash tables Linked list, stacks, queues, two pointers/sliding window Binary heaps Dynamic programming Union find Ad hoc/string manipulations Arrays Recursion. Backtracking. Greedy algorithms. Other good to know topics: Trie, segment trees/fenwick trees, bitmasks

SF:
1. Trapping Rain water
2. Generate Paranthesis
3. Design rating system of employee
4. Maximum Subarray square

M365:

Input:

Hex Array= [0, a, f]

Roll Array = [2,3,1]


RollArray[0] = 2 => Roll the first two elements

Hex array = [1,b,f]

RollArray[1] = 3

HexArray=[2,c,0]

0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f

RollArray[2] = 1

HexArray = [3,c,0]

Design Tiny bit shorten url 

Viva:

Given a binary matrix mat[][] of dimensions of N * M and pairs of integers src and dest representing source and destination cells respectively, the task is to find the shortest sequence of moves from the given source cell to the destination cell via cells consisting only of 1s. The allowed moves are moving a cell left (L), right (R), up (U), and down (D) (if exists). If no such path exists, then print “-1”. Otherwise, print the sequence of moves.

Substrate:

Design online paint - enums for tools, bucket fill algo - utilised surrounding 1 in matrix coloring

m365  

Design coauth in editor

Rotate an array by shifting its elements 3 positions to right

Find 3rd highest element  in BST


Internal team

Given a linked list with duplicate elements, remove all duplicate elements

a bit tricky -     You are given a maze (unknown dimensions) & a robot is placed somewhere in the maze. The robot has 4 functions… canMoveLeft(), canMoveRight()….etc

       There is gold somewhere in the maze. Return the path from start to gold. Follow up - There is no gold now…. just traverse the entire maze…. How do you traverse the entire maze?

3. Given a binary tree, return the reverse level order traversal….. ie the first entry should be the list of all leaves

4. Given a string, find the biggest palindrome & return the biggest palindrome

Microsoft - PowerBI

Find the Kth largest element in an array

Microsoft - Azure

Given a list of integers, all intergers occur more than once except one. Find that element

Given a list of integers, all elements occur twice except one. Find it


2nd team -

Given 2 linked list , findout if its merged & return the first common element

Given a list of stock prices of a company , find the best time to buy & sell


Amazon

1. events[i] = [startTimei, endTimei, valuei]


Example : 

Input: events = [[1,3,2],[4,5,2],[2,4,3]]

Output: 4

Max value from 2 events or 1.

(1) Two Best Non-Overlapping Events - LeetCode

2. /*

      a
     /  \
    b    c
   / \   / \
  d   f c   b
  
  ab < aba
Lexicographically smallest from leaf to root

Fb:
1. https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/
2. https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/

Rubrik:
/**

class Work:
  def do_work(self):
    // few mins to days.
    pass

class WorkCompleter:
 
  # Fill in as necessary.
  def __init__(self):
    pass
 
  # Schedules work to be done on [work], i.e. the user
  # schedules work.do_work() to be called.
  # This method should return as quickly as possible.
  def schedule(self, work):
    pass
 
  # Does not return until all previously scheduled work
  # has been completed.
  def block_until_complete(self):
    pass

*/

Victoria Canada Trip

 Victoria city to do and must have  1. Parliament building  2. Waterfront  3. Mini sea-bus at waterfront  4. Fisherman wharf   5. Museum (op...