Cisco Systems
3.5 of 5 4,534 reviews
www.cisco.com San Jose, CA 5000+ Employees

Cisco Systems Software Engineer Interview Question

I interviewed in Boxborough, MA and was asked:
"Given 3 systems: system 1 reaches 0xFF, then system 2 increment by 1. Everytime system 2 increments, system 3 would fetch the package. When can there be a problem? What is the problem with this system? How can we fix this?"
Add Tags [?]
Answer Flag Question

Part of a Software Engineer Interview Review - one of 1,055 Cisco Systems Interview Reviews

Answers & Comments

0
of 0
votes
Problem:
system 2 counter can overflow (that answers what and when) or will overflow eventually (if its also 1 byte that after 256*256)

Solution:
Well, if its interrupt based (i.e.interrupt for every tick), we put boundaries i.e system2 == 0xFF , reset system2 counter
if its polling, its possible that when we check , system2 could have increased by 'k' amount (where k=0,1,2,....,0xFF), in that case if system1 increments periodically, we can time-bound our polling to a multiple of 256*m periods and fetch 'm' packages, making sure that 0xFF falls on that boundary. RTOS will be required to guarantee our task a CPU slice every 256*m intervals
if its random, interrupt polling is better, else we have to check for overflow,
i.e at time 't' , system2 = c1
and time 't+k', k>0 , system2 = c2,
then if c2 < c1 => overflow and total ticks is (0xff - c2) + c1

Anyway, more you think, you can get even better approaches and if you know which OS and CPU is being used , it can help too
- R on Jun 24, 2014 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Cisco Systems – Why Work for Us?

We’re the people who made the Internet what it is today. From its early days of simple connectivity to the future of the Internet of Everything, we’ve pioneered it every step of the way. Now we’re building the best team… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Cisco Systems interview questions and advice. All interview reviews posted anonymously by Cisco Systems employees and interview candidates.