Senior Software Engineer
MicrosoftPrincipal Software Engineer
Dell TechnologiesSenior Software Engineer
Dell TechnologiesSoftware Engineer
Wisdomleaf TechnologiesTechnical Lead
TavantIT Architecture Senior Analyst
TrueBlue Inc.Senior Systems Engineer
Infosys
Azure DevOps

TFS

SVN

Raspberry Pi

Ubuntu
Yeah, so in terms of my background, I've been mostly in web development. I've worked on web, full-stack web development throughout my career. And.NET has been a constant for me, with C# being the language. I've worked on that throughout my career. In terms of the front end, I have experience in Angular and React, with React being the most recent one, along with HTML, CSS, and JavaScript, of course, which is included in this. And in terms of the database side, I also have experience in SQL Server, as well as MySQL. This is basically the tech stack I've worked with. Given my current experience as a senior engineer in Microsoft, I'm also involved in leadership activities, including code reviews, mentoring junior folks, and design and architectural discussions. So I contribute there as well. At the same time, I'm excited about web development in general. Although I have full-stack web development experience so far, I'm fairly comfortable with front-end and back-end aspects. So I'm happy to work on the front end, given the current requirements.
In a microservice ecosystem, in terms of handling distributed transactions, one thing is that we need to follow the ACID properties in database development and database setup. So, either we could have a master-slave configuration in terms of data sources. Let's take an example of SQL Server. If I have a master and slave, all writes happen to one single database, which is then distributed across different nodes. Reads can be handled through all of them simultaneously. That's one thought I have in a microservice system: how to handle it. Another thought would be that every time there's a write, the region or the distributed system closest to the user can have the write operation, and it can further replicate that data across all other databases in time. And one other option would be to have an event system or event queuing system, which would enable the way writes happen: the queue would be filled up, and the queue would be processed in time, given that there's no requirement for instant access to the written items. So, that's basically three approaches I have in mind. And given the exact scenario, we can decide on which of these three options to go for.
So when it comes to optimizing the React application component tree, one of the best ways we can approach it is to have a single responsibility component. A component could be specifically specified for one single operation or rather one single render of a section in the web page. Given that, because of how React works behind the scenes in terms of how the virtual DOM is updated and how the real DOM is updated based on that, it takes the basic difference in terms of what changes. So given the lowest node component of the React application, the lowest node change will trigger only the lowest HTML and CSS associated with that component alone. It will not update anything from the tree above that, any of the components above that, the parents, I mean. So it's better to have that segregation and component inside of a component approach that will definitely improve the performance of rendering in React. And at the same time, some of the features that we can use when it comes to caching, like useMemo or useCallback, that can be used to prevent re-rendering of something when the inputs for any of the functions can be the same. We don't need to fetch any other data or we don't need to refresh anything in the rendering. So we can save some rendering performance as well there. And at the same time, we can use useRef, one of the hooks available to access the elements directly. So in this case, we can use this to change values according to our business requirements without really re-rendering anything on the screen. And so using useRef is also one of the ways that can be applied for improving the rendering performance.
So in terms of NoSQL databases, one of the best things it can do in terms of scalability is that you can have a distributed system in a shard manner where all the data does not need to reside in one node of the DB. That way, we have the power of those multiple nodes instead of one single node in case of RDBMS systems. So distributed systems can work very well in such a situation because of the sharding. And at the same time, we can also have a NoSchema defined in a NoSQL database, which also gives flexibility in terms of data handling. And of course, when it comes to speed, we also have the distributed systems where any query to the NoSQL DB, which is distributed in the method of sharding, can access all the nodes at the same time, get all the data, and do whatever needs to be done. And at the same time, this can be achieved in a much faster way, considering that there are multiple nodes that can be processed or queried in parallel. And given these two factors, I think NoSQL databases work very well in highly scalable systems where we require a highly scalable system. And this will also help in terms of handling better writes, as well as following the asset properties. So that way, not all the nodes are being used simultaneously for writes. And that helps as well.
I haven't really worked on a Node.js application on the backend, so I can't really provide an answer to this. I'll skip this one.
In micro front ends, managing user sessions can be done by either having a global storage that can be used across, or we could even use the local storage or assistance storage. That way, considering that all the micro front ends will still use a similar or rather the same host URL, we can use local storage or session storage to store whatever information that we need to store in the user session. And at the same time, considering we would use REST APIs, all the user sessions can be internally managed on the server side no matter where which of the micro frontend application the request is coming from, given that we have a common storage. This is how I would design it.
So, I'm just going through the code to understand what it's supposed to do. Given that fetch data is a method that fetches data from an API, which will have some latency associated with it, and given that we are setting the state using set data for the response coming from the promise and fetch data. So it's possible that the API, because we are using use effect here, there could be a possibility that there are multiple API calls that can be associated with one. Or rather, I do observe that the dependency array does not have anything in there. So in this case, mostly the data will be updated once on load, but it will never be called again because it doesn't really have a dependency array filled up. So in this case, any update needed will not go through the fetch data method and we won't really have an update at the state. And at the same time, even if the dependency array is filled up and there is fetching of the data happening multiple times based on the change on the screen, here each API can take different times. Maybe the first call can take five seconds, but the second call could take only two seconds. So the second call will have the response first and the first call will have the response next. So given that, the set data will be done only after the API call is finished. So given that, we will definitely not have a consistent display of the response data on the screen. So that is another possible issue on this code.
Just going through the CSS code, we have a class container, and the closing arrow brackets define that the box should contain the element with the class box, which is the element that should be contained inside the container. One of the reasons this might not work as expected is that the element with the class box does not have height or width, or it's possible that the box class item is present not immediately inside of the container, but could have been nested inside. That's also a possibility that the background color might not be applied. And other problems possibly would be, we need the box element to be a block element, ideally. I think an inline element would work in this case as well. Considering other possibilities why the box element might not be styled, I think that should cover it. Either it's in a nested form, it's not the immediate child of the container, or it doesn't have a height or a width, or it may not be displayed on the screen given the situation of what the box element is about.
Given a microservice system, one of the ways to ensure fault tolerance is to have a retry mechanism. The retry mechanism can be used in case an API fails, and we want to retry that a couple of times. So, a maximum of three or four times can be the API call can be retried to ensure that the API is successful. If it is not successful, even in that case, it's very possible that some systems might be down. And given that, if we're pointing to the same node, which is down, all four retries would obviously fail. But one of the logics that can be used is to have this API call done to a different node on every single retry, which can definitely be handled by a load balancer of sorts, which decides which node the request should go to. That way, even if one of them fails on the next try, or even the third try for that matter, it is sure to work because the possibility of all nodes in the given system failing at the same time is very low. So this would be one of the ways I would go about it. I am thinking about another approach. One of the other ways we can use is, especially in write scenarios, to use a queuing mechanism to have that in a queue instead of having it done live. So that way, whatever writes need to happen can happen asynchronously behind the scenes. And even if there's a failure, the retry mechanism can be used again in this case. This is another approach I am thinking about.
Given that JavaScript, especially in later versions, has a lot of new features added, and there's a lot of support from web browsers as well, it's better to use native web components. For instance, when we have an email field that the user needs to fill up, there are some basic or rather built-in error checks happening on an email for HTML5 components, or HTML5 input boxes. That's just one example of how we can use native web components. However, at the same time, given that we don't use any external libraries, there's a lot of savings in terms of the learning curve. We also have the benefit of being able to control our code, and one of the main benefits is that it can help us customize the way we want it. This is one of the primary factors for any web development team, where they would like to control how things look on the web page. Given these factors, I think we can definitely use native web components to build a JavaScript application.
So given my experience, I have utilized the Jest test framework. Using Jest, we can definitely capture a good amount of scenarios on the UI. We have the option to test a snapshot testing, which basically renders a component and checks if the snapshot is valid or not. Jest also provides features where we can focus on the user interface in terms of how the screen changes based on user clicks or entry of information from the user. All of these features, including clicks and entering data, are available as part of the Jest framework. This is one of the ones I could use in terms of having unit testing at the component level. At the same time, Selenium would be a good approach in terms of testing functional testing on the whole web page. This will definitely help with the integration testing aspects of it. Coming back to Jest for unit testing, we do have a good amount of mocking features available. Using the mocking features available, we can test individual components without depending on any of the other components that might be used within a web page. So, given this, I would say Jest and Selenium is a good approach to go about with unit testing and integration testing respectively.